Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Network Change & Configuration Management

Reply
Highlighted

NetMRI Script to Determine if a command is missing.

Posts: 75
1480     0

HI All,

Below is the script I used to change a no command to a positive command in the show run.  What I need help with is making a script to find something that is missing.  For example, if there is no local username on the Cisco router, how do I determine this and make it an issue?

Script-Filter:
 $Vendor eq "Cisco" and $sysDescr like /IOS/

########################################################################
Action:
 Ensure Service Encryption is set

Action-Commands:
SET: $UpdateMade = "no"
SET: $encrypt = "yes"
sh run | i service

Output-Triggers:
Encrypt Passwords

Trigger:
Encrypt Passwords

Trigger-Template:
no service password-encryption

Trigger-Commands:
SET: $encrypt = "no"

######################################################################

Action:
Encrypt Passwords Yeah

Action-Commands: {$encrypt eq "no"}
conf t
service password-encryption
SET: $UpdateMade = "yes"


########################################################################
Action:
End and Write Memory

Action-Commands: {$UpdateMade eq "yes"}
end
write mem

Highlighted

Susan, I would suggest you

Adviser
Posts: 431
1481     0

Susan, I would suggest you use these two ways instead to handle this problem:

1 - Write a policy and the policy will trigger an issue for you.  - This is the best option 

2 - Do a basic config search looking for username but instead of using the operator "matches" use "does not match" this will give you your desired results and then you can execute a command on all the devices to add the missing username.

 

Sif

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

www.sifbaksh.com
Showing results for 
Search instead for 
Do you mean 

Recommended for You