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

Automation Scripts


Show module script

Posts: 13
120     0



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?



                    $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,


Re: Show module script

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




This should directly open the test tool on the Tab


Re: Show module script

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