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

Automation Scripts

Reply
Highlighted

Show module script

Authority
Posts: 13
120     0

Hello,

 

I'm trying to write script to check 7k and 6k modules, by using "show module" command. The status could be more than one (other, unknown, faulty, errdisable, power-deny and power-bad). on the trigger-variables can I use OR to check the status?

 

Trigger-Variables:

                    $number int

                    $status  /\w+other/ OR /\w+unknown/ OR /\w+faulty/ OR /\w+errdisable/ OR /\w+power-deny/ OR /\w+power-bad/ string 

 

Thank you,

Highlighted

Re: Show module script

Adviser
Posts: 64
121     0

I haven't tested OR on Trigger Variables. However, I doubt if it will work. 

 

Since you already have the output of 'show module' handy, you can use the Regular expression Test tool within NetMRI to check if the template matches the output.

 

To access the test too, Login to Web UI and on a new Tab, navigate to this link

 

Your-NetMRI-URL/netmri/ccs/tx/regex_test/index.tdf

 

This should directly open the test tool on the Tab

Highlighted

Re: Show module script

Expert
Posts: 236
121     0

I'm uncertain how you expect to actually match on this but you can accomplish the logical OR like this:

  $status  /(\w+other|\w+unknown|\w+faulty|\w+errdisable|\w+power-deny|\w+power-bad)/ string

 

Just realize that $status will end up including whatever "\w+" matches before the actual status.  If you want to end up with $status containing just the status string, then you'll probably be better off including the "\w+", or whatever uniquely preceeds the status, in the Template.

Showing results for 
Search instead for 
Do you mean 

Recommended for You