Stripping output of check_ command

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.
Locked
nov1ce
Posts: 3
Joined: Fri Mar 16, 2018 10:09 am

Stripping output of check_ command

Post by nov1ce »

Hello,

Nagios Core 4.3.4 running on Debian Stretch.

I'm using check_snmp_environment.pl plugin (from https://exchange.nagios.org/directory/P ... 29/details) to monitor the power supply status and temperature of one of the ICX Brocade switches.

Here is the output I get:

Code: Select all

./check_snmp_environment.pl -H icx6450.local.net -C public -T brocadeTurboIron

Power supply 1 (NA - AC - Regular) present, status ok: OK; Power supply 2 (NA - AC - Regular) present, status ok: OK; 
Rear Side Fan 1  (1): OK; 
Chassis temperature of 42.5OK; 
Management module: CPU temperature of 47.5OK; 
Management module: MAC 1 temperature of 42.5OK; 
Management module: CPU temperature of 42.5OK; 
Management module: MAC 1 temperature of 42.5OK; 
all OK
My question is: how do I strip the output to one result per line? For example, in the Nagios Web GUI, I'd like to see one check for Power supply 1:

Power supply 1 (NA - AC - Regular) present, status ok: OK;

Then another check for Power supply 2:

Power supply 2 (NA - AC - Regular) present, status ok: OK;

And so on.

Do I need to have separate commands per line piping the output to awk/sed?

Thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Stripping output of check_ command

Post by scottwilkerson »

This plugin doesn't seem to allow them to be run separately, so you would need to do as you said, somehow manipulate the results, OR write your own plugin that just does the checks one at a time
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked