Check Cups Queue

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.
MilesDeep
Posts: 24
Joined: Thu Mar 13, 2014 12:22 pm

Check Cups Queue

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check Cups Queue

Post by tgriep »

Could you post your nrpe.cfg file from your remote system?
Be sure to check out our Knowledgebase for helpful articles and solutions!
MilesDeep
Posts: 24
Joined: Thu Mar 13, 2014 12:22 pm

Re: Check Cups Queue

Post 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$
MilesDeep
Posts: 24
Joined: Thu Mar 13, 2014 12:22 pm

Re: Check Cups Queue

Post 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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check Cups Queue

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
MilesDeep
Posts: 24
Joined: Thu Mar 13, 2014 12:22 pm

Re: Check Cups Queue

Post by MilesDeep »

That command, run from the remote computer, returns; OK - checkprinter is ready
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Check Cups Queue

Post 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:

Code: Select all

service xinetd restart
Run the following from Nagios:

Code: Select all

./check_nrpe -H 10.0.10.1 -c check_queue_status_checkprinter
Does the above work?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
MilesDeep
Posts: 24
Joined: Thu Mar 13, 2014 12:22 pm

Re: Check Cups Queue

Post 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.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Check Cups Queue

Post 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.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
MilesDeep
Posts: 24
Joined: Thu Mar 13, 2014 12:22 pm

Re: Check Cups Queue

Post 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"
Locked