cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

Script not executing properly

On a Juniper router, need to drop down into the shell to execute a command to get some extra low-level grep commands.

NCM doesnt seem to want to do anything with it and fails to execute the command.

Any ideas on what I am doing wrong, or how to help this along?

start shell

${Delay:2}

cli -c "show ethernet-switching table interface all|match xe-" | egrep -v database | awk '{print $2 " " $4}'

Email I get shows:

SolarWinds Network Configuration Manager

  Scheduled Job Notification

 

 

___________________________________________________________________________

 

  8/22/2019 5:21:23 PM : Started interface mac check for multiples

 

  Execute Command Script on Devices

  1 devices selected

 

 

  Devices: 1

  Errors: 0

___________________________________________________________________________

 

  OCC2 (10.22.6.146):

 

 

 

 

  %

 

___________________________________________________________________________

  8/22/2019 5:22:25 PM : Completed interface mac check for multiples

  Execution time : 1 minute 1 second

___________________________________________________________________________

Labels (1)
0 Kudos
2 Replies

Off the top of my head, when you change the shell does the prompt change?  You can modify device templates to recognize a different prompt like so

https://support.solarwinds.com/SuccessCenter/s/article/Adjust-modify-or-change-a-device-template-use...

- Marc Netterfield, Github
0 Kudos

when you log into in the shell it changes the prompt to % which is seen above.Using tht link you sent, I am not sure how to read the instructions on that.

Add below line (command) to the template:

<Command Name="VirtualEnablePrompt" Value="#"/>

So the value instead of # becomes a % and then execute my command?
so like this?

<Command Name="VirtualEnablePrompt" Value="%"/>
cli -c "show ethernet-switching table interface all|match xe-" | egrep -v database | awk '{print $2 " " $4}'

looks like i got an error back in the email.

  %

  Missing name for redirect.

 

 

  %

 

  %

0 Kudos