Page 1 of 1

How to monitor multple options on a custom pl script

Posted: Thu Sep 21, 2017 5:42 am
by lpereira
Hello all:
I founded an APC UPS plugin, and i want to implement it on my environment, the script is: https://exchange.nagios.org/directory/P ... PS/details

The script has the hability to monitor multiple options (id, battery status, battery charge, etc, etc).

But if i want to see (for instance) the id, battery status and power_modules running a single command via CLI, i only see one output.

Code: Select all

[root@NagiosXI libexec]# ./check_apc.pl -H 172.27.XXX.XXX -C COMMUNITY -l out_current
OK: Output Current is: 25A|'Output Current'=25;;
[root@NagiosXI libexec]# ./check_apc.pl -H 172.27.XXX.XXX -C COMMUNITY -l id
OK: UPS Name: Symmetra 48K, Firmware: 550.0321.I, Microproc S/N: XXXXXXXX, Manufacture Date: 01/29/12
My question is, how to run this query using more than one option after "-l" parameter.

Re: How to monitor multple options on a custom pl script

Posted: Thu Sep 21, 2017 8:40 am
by mcapra
Two options come to mind:
  • Modify the Perl script by hand
  • Use something like check_multi

Re: How to monitor multple options on a custom pl script

Posted: Thu Sep 21, 2017 9:29 am
by lmiltchev
Thanks @mcapra!

@lpereira, it is going to be probably easier to use check_multi. I used it in the past, and it worked pretty well for me. Let us know if mcapra's suggestions helped.

Re: How to monitor multple options on a custom pl script

Posted: Thu Sep 21, 2017 1:37 pm
by lpereira
The last option should be create one service per output, so, if i want to monitor 4 o 5 outputs, i would need to create 4 or 5 services, all of them calling the same .pl file.

is there any "problem" having differents querys to the same script? can it generate some conflict?

Re: How to monitor multple options on a custom pl script

Posted: Thu Sep 21, 2017 1:55 pm
by scottwilkerson
lpereira wrote:is there any "problem" having differents querys to the same script? can it generate some conflict?
No, this is common practice