Page 1 of 2
Check Cups Queue
Posted: Tue Jun 09, 2015 1:51 pm
by MilesDeep
I must be tired. I've done this for many of our Linux-based print queues, but cannot add a queue to be monitored. Within the Linux Servers Host Groups I have a server which contains several print queues. I'm simply monitoring whether or not the various queues are up.
From Nagios Server:
[root@asf-nagios libexec]# ./check_nrpe -H 10.0.10.1 -c check_queue_status -a PDFprinter
OK - PDFprinter is ready
[root@asf-nagios libexec]# ./check_nrpe -H 10.0.10.1 -c check_queue_status -a checkprinter
ERROR -
From App Server (where the queues reside):
[root@App-Server libexec]# ./check_queue_status PDFprinter
OK - PDFprinter is ready
[root@App-Server libexec]# ./check_queue_status checkprinter
OK - checkprinter is ready
Re: Check Cups Queue
Posted: Tue Jun 09, 2015 2:00 pm
by tgriep
Could you post your nrpe.cfg file from your remote system?
Re: Check Cups Queue
Posted: Tue Jun 09, 2015 3:14 pm
by MilesDeep
log_facility=daemon
pid_file=/var/run/nrpe.pid
server_port=5666
#server_address=127.0.0.1
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1
dont_blame_nrpe=1
debug=0
command_timeout=60
connection_timeout=300
command[check_queue_status]=/usr/local/nagios/libexec/check_queue_status $ARG1$
Re: Check Cups Queue
Posted: Tue Jun 09, 2015 3:16 pm
by MilesDeep
Is there any chance the issue is with the fact the printer is actually named check_printer as in a printer used to print checks, not a command that has something to do with checking the printer.
Re: Check Cups Queue
Posted: Tue Jun 09, 2015 3:42 pm
by tgriep
I don't think the name of the printer, it might be a permission problem. Try running this on the remote system logged in as the user nagios.
Code: Select all
su nagios
/usr/local/nagios/libexec/check_queue_status checkprinter
Re: Check Cups Queue
Posted: Wed Jun 10, 2015 7:49 am
by MilesDeep
That command, run from the remote computer, returns; OK - checkprinter is ready
Re: Check Cups Queue
Posted: Wed Jun 10, 2015 9:38 am
by jolson
Access your remote host and make a command definition in nrpe.cfg:
Code: Select all
command[check_queue_status_checkprinter]=/usr/local/nagios/libexec/check_queue_status checkprinter
After adding the above command, restart xinetd:
Run the following from Nagios:
Code: Select all
./check_nrpe -H 10.0.10.1 -c check_queue_status_checkprinter
Does the above work?
Re: Check Cups Queue
Posted: Wed Jun 10, 2015 10:20 am
by MilesDeep
[root@asf-nagios libexec]# ./check_nrpe -H 10.0.10.1 -c check_queue_status -a PDFprinter
OK - PDFprinter is ready
[root@asf-nagios libexec]# ./check_nrpe -H 10.0.10.1 -c check_queue_status -a checkprinter
ERROR -
Just to show that it works fine for another printer.
Re: Check Cups Queue
Posted: Wed Jun 10, 2015 10:28 am
by jolson
MilesDeep,
Please follow the instructions that I've posted. Let me know if you need help with any of the steps - basically we're adding a 'hard check' to your print servers nrpe.cfg and then we're calling that check from your nagios server. This is to see if the problem has anything to do with the arguments you're specifying.
Re: Check Cups Queue
Posted: Wed Jun 10, 2015 10:53 am
by MilesDeep
Yes. Command by command. When running the following command, I get the error.
./check_nrpe -H 10.0.10.1 -c check_queue_status_checkprinter
Error -
This obviously comes from this bit of code, still don't know why it's getting an error, then not returning what the error is in the $INFO part.
if [ $QUEUE -gt $ERROR ]; then
echo "ERROR - $INFO"