Reply
Accepted Solution

Print output to a file

kart
Techie
Posts: 3
2986     0

I am new to CCS scripting. I am working on a script where the output should directed to a file. For example: when i give show run | i access-class, the devices that are not having the access-class comands should be present in the output file. Thanks in advance for your help

Re: Print output to a file

Expert
Posts: 263
2987     0

You could accomplish this within a CCS script using the ARCHIVE command but it would require a bunch of work to extract a zip file of one file for each device, and merge/massage those.  From what you wrote about your objective, it sounds like a script is not the ideal approach.  Assuming NetMRI has been collecting the configs of all of the devices, there's no need to log in to each device to perform the search.

 

You could use Config Management -> Config Search.  Specify "Config Text" "Does Not Match" "access-class" and Add that as a condition..  Select the appropriate Device Groups to search.  Click "Run" and you'll see a list of all devices that meet the condition.  You can then select some or all of them on which to execute a script.

 

If you want to perform this check on an ongoing basis, then it would be worth using the Policy Design Center.  Create a Rule that requires the desired statement(s) to be present.  Create a policy based on that rule.  Apply the policy to the appropriate Device Groups.  Any devices which fail the policy will appear in the main issues list as "Policy Violation: <policy_name>".  The issue details will list the failing devices.  You could then select some or all of them on which to execute a script.

 

The rule could also check for a block of statements such as:

  line vty 0 4

    access-class My_VTY_ACL in

 

Re: Print output to a file

kart
Techie
Posts: 3
2987     0

Thanks. The config search was really helpful. I am having problem creating the rule but the config search was really useful.

Showing results for 
Search instead for 
Do you mean 

Recommended for You