Reply

CCS script for locating down module

jbader52
Techie
Posts: 6
5887     0

Hello all,

 

I am very new to scripting in general and I am working on a script that will detect a module failure on an HP chassis switch.  Here is a partial output (did not format well when pasted):

 

Status and Counters - Module Information

Chassis: 5412zl J8698A! Serial Number: 
Allow V1 Modules: Yes

Management Module: J8726A Serial Number:  Core Dump: YES

Core Mod
Slot Module Description Serial Number Status Dump Ver
---- -------------------------------------- -------------- -------- ----- ---
A HP J9637A 12p GT PoE+/12p SFP v2 zl... SG37DRQ6X6 Up YES 2
B HP J8705A Gig-T/SFP zl Module SG030AU01J Up NO 1
C HP J9534A 24p Gig-T PoE+ v2 zl Module SG3287R0SZ Up YES 2
D HP J9534A 24p Gig-T PoE+ v2 zl Module SG4127R132 Up YES 2
F HP J9534A 24p Gig-T PoE+ v2 zl Module SG3287R0T4 Up YES 2
L                     Failed -

 

The following seems to work to detect the L module:

 

Trigger-Variables:

$modStatus /Failed/

 

Trigger-Template:

L.*\s.+[[$modStatus]]\s

 

This will picked up 'Failed' and put it in the $modStatus which is a start. I am having issues because the modules are different, A-L, and there is no consistent identifier to use.  I've been battling finding a way to get it done.  Any help would be awesome! and I'll keep banging my head until then...

Re: CCS script for locating down module

Adviser
Posts: 57
5888     0

It's hard to provide an accurate answer without getting the complete script or knowing the purpose or end result.

 

However, the following is worth a try

 

Trigger-Template:

[A-L].*\s.+[[$modStatus]]\s

 

Also, use the following link on a new tab after login to NetMRI GUI

 

<Your-NetMRI-IP-Address>/netmri/ccs/tx/regex_test/RunRegex.tdf

 

This is an in-built regex tester within NetMRI and will give you outputs similar to the one seen after running jobs.

 

Hope this helps !

Re: CCS script for locating down module

jbader52
Techie
Posts: 6
5888     0

Thank you for your suggestions!

 

Is there a way to reset the RunRegex.tdf?  I used this for a few days and now when I open it comes up to the previous test run and will not reset to allow me to enter new information.

 

I will be testing the code below today, thanks!

Re: CCS script for locating down module

jbader52
Techie
Posts: 6
5888     0

As far as what I am attempting to accomplish, I am wanting to grab A-L into a variable so that I can understand when a module is in the failed state and create an issue or possibly run a trigger script to resolve.

 

Thanks!

Re: CCS script for locating down module

Expert
Posts: 228
5888     0

So you want to obtain the module letter and whether any have failed.  The following should only match on failed modules and only then execute any following commands/actions.

 

Trigger-Variables:

$module  /^[A-L]/

$modStatus  /Failed/

 

Trigger-Template:

[[$module]].+[[$modStatus]]

 

Trigger-Commands:

PRINT:  $module $modStatus

...fire custom issue, do whatever...

 

Re: CCS script for locating down module

Expert
Posts: 228
5888     0

I haven't experienced that but I'm not using it every day.  Actually, I'm delighted that the previous entries are now saved after executing it once, and then using the browser "back" to try again.  It was so tedious to have to save the three entries to a text editor and then paste them back in, just to iterate.  I'm guessing this behavior changed in 7.1.2.

Re: CCS script for locating down module

Adviser
Posts: 57
5888     0

I haven't seen the  RunRegex.tdf issue in the lab. May be a browser issue, clearing cache/cookies may reset that.

Re: CCS script for locating down module

jbader52
Techie
Posts: 6
5888     0

Seems to be in the software.  I cleared cache/cookies, even tried another browser.  I will open an issue with support.  Thanks!

Re: CCS script for locating down module

jbader52
Techie
Posts: 6
5888     0

This pulled back a match and gave me a status Failed for $modStatus which is great.  I would like to get this matched up A-L and create a variable for A-L when found.  Thanks!

 

Here is what was used:

 

Trigger-Variables

$modStatus /Failed/

 

Trigger-Template:

[A-L].*\s.+[[$modStatus]]\s

Re: CCS script for locating down module

jbader52
Techie
Posts: 6
5888     0

Hi Madkins,

 

Thanks for the response!

 

I'm currently unable to test through the Regex but I did modify my test script with the info below.  Unfortunately it did not return a match, could it be off by a small detail?

 

Thanks!

Showing results for 
Search instead for 
Do you mean 

Recommended for You