Parsing output of Nagios checks

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
nov1c3
Posts: 3
Joined: Fri Mar 19, 2021 3:33 am

Parsing output of Nagios checks

Post by nov1c3 »

Hello,

I'd appreciate some hints regarding parsing of the output below.

I check the health of my Ruckus/Brocade ICX switches which produces the following output:

Code: Select all

Power supply 1 (AC - PoE) present, status ok: OK; Power supply 2 (DC - Regular) present, status ok: OK; Power supply 3 present, status failed: FAILURE; 
Fan 1 (Rear Side Fan 1, (1st From Right) (1): OK; Fan 2 (Rear Side Fan 2, (2nd From Right) (2): OK; 
Fan 3 (Rear Side Fan 3, (3rd From Right) (3): OK; 
Chassis temperature of 67.5OK; 
Management module: CPU temperature of 64.5OK; 
Management module: MAC 1 temperature of 64OK; 
Management module: CPU temperature of 67.5OK; 
Management module: MAC 1 temperature of 67.5OK; 
CRITICAL
The CRITICAL status is due to 'Power supply 3 present, status failed: FAILURE;', which is expected. How can I omit 'Power supply 3 present, status failed: FAILURE;' part and generate OK status, but only if it's failing for Power supply 3? If it's a failure for other PS, generate CRITICAL.

Thank you.
kg2857
Posts: 234
Joined: Wed Apr 12, 2023 5:48 pm

Re: Parsing output of Nagios checks

Post by kg2857 »

You'd need to write a script that does what you want.
Post Reply