How to monitor multple options on a custom pl script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

How to monitor multple options on a custom pl script

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post by mcapra »

Two options come to mind:
  • Modify the Perl script by hand
  • Use something like check_multi
Former Nagios employee
https://www.mcapra.com/
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

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

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked