check_apc.pl --> running multiple check commands

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
Tal
Posts: 12
Joined: Wed Jun 06, 2012 1:40 pm

check_apc.pl --> running multiple check commands

Post by Tal »

Does anyone know what the magic syntax is for running multiple check commands with this plugin would be?
(see attached help page, etc.)

techservices@vpd-nagios:/usr/local/nagios/libexec$ perl check_apc.pl -H192.168.60.3 -Cpublic -l out_status; bat_capacity; out_phase; out_load; bat_run_remaining

<output>
OK: UPS is Running on GridLine
bat_capacity: command not found
out_phase: command not found
out_load: command not found
bat_run_remaining: command not found


If I run the command like this...
techservices@vpd-nagios:/usr/local/nagios/libexec$ perl check_apc.pl -H192.168.60.3 -Cpublic -l bat_capacity out_phase out_load bat_run_remaining out_status

<output>
OK: UPS is Running on GridLine
(it only runs the last command)

If you take out the spaces between the checks, it errors (doesn't recognize the command)
(ex. bat_capacityout_phase)

I've also tried (ex. $bat_capacity) and other variations (e.g. using $, using \, using --, )

I just can't find it.
Attachments
check_apc man page.txt
(3.83 KiB) Downloaded 158 times
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: check_apc.pl --> running multiple check commands

Post by mbellerue »

Can you post the plugin itself? We might be able to figure it out pretty quick by looking at the code.

Otherwise, you might also try multiple -l switches. So -l bat_status -l bat_capacity
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Tal
Posts: 12
Joined: Wed Jun 06, 2012 1:40 pm

Re: check_apc.pl --> running multiple check commands

Post by Tal »

check_apc.pl code (see attached)
Attachments
check_apc.pl
(33.36 KiB) Downloaded 158 times
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: check_apc.pl --> running multiple check commands

Post by mbellerue »

It doesn't look like this plugin supports checking multiple metrics in a single command. You'll have to make a service check per metric in order to use this plugin. Or you could have a single service check, and write a wrapper script that calls this plugin multiple times.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked