Hi ,
I am unable to configure check_snmp_printer in my nagios server running Nagios® Core™ 4.0.8. i am running CentOS release 6.6 (Final).
While executing manually command ./check_snmp_printer -H x.x.x.x -C public -x STATUS -w 20 -c 10. i am getting the result. but not through printer.cfg
.
below is the entry of command.cfg file.
define command{
command_name check_printers
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2 -w $ARG3$ -c
}
and here goes the printer.cfg file entry.
define service{
use generic-service
host_name My Printer
service_description Model
check_command check_snmp_printer!public!"MODEL"
normal_check_interval 10
retry_check_interval 1
}
getting error
Error: Service check command 'check_snmp_printer!public!"MODEL"' specified in service 'MODEL' for host 'MY Printer' not defined anywhere!
Please help on this.
Unable to configure Printer in Nagios.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Unable to configure Printer in Nagios.
First thing is that your command line test is for STATUS yet you are trying to define a MODEL check in your service.
Also, both STATUS and MODEL check do not require a warning and critical argument so I would define the command slightly different.
This is missing the trailing $ sign for $ARG2$ and completely missing $ARG4$ (I think it was a copy and paste error):
You're not referencing the correct command_name in your service, it should be:
Here is the STATUS check:
Finally, if you later need to use a check that has warning and critical, put it all in $ARG3$, like:
Does this help?
Also, both STATUS and MODEL check do not require a warning and critical argument so I would define the command slightly different.
This is missing the trailing $ sign for $ARG2$ and completely missing $ARG4$ (I think it was a copy and paste error):
I would define it as follows:xavmit wrote:Code: Select all
define command{ command_name check_printers command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2 -w $ARG3$ -c }
Code: Select all
define command{
command_name check_printers
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ $ARG3$
}
Code: Select all
define service{
use generic-service
host_name My Printer
service_description Model
check_command check_printers!public!"MODEL"
normal_check_interval 10
retry_check_interval 1
}
Code: Select all
define service{
use generic-service
host_name My Printer
service_description Status
check_command check_printers!public!"STATUS"
normal_check_interval 10
retry_check_interval 1
}
Finally, if you later need to use a check that has warning and critical, put it all in $ARG3$, like:
Code: Select all
check_command check_printers!public!"CONSUM Toners"!-w 20 -c 10
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Unable to configure Printer in Nagios.
Thanks buddy,
I run the same command.
but now getting error
(No output on stdout) stderr: execvp(/usr/lib64/nagios/plugins/check_snmp_printer, ...) failed. errno is 2: No such file or directory
Below is the status of Service
define service{
use generic-service
host_name MY Printer
service_description Model
check_command check_printers!public!"MODEL"
normal_check_interval 10
retry_check_interval 1
}
define command{
command_name check_printers
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ $ARG3$
}
I run the same command.
but now getting error
(No output on stdout) stderr: execvp(/usr/lib64/nagios/plugins/check_snmp_printer, ...) failed. errno is 2: No such file or directory
Below is the status of Service
define service{
use generic-service
host_name MY Printer
service_description Model
check_command check_printers!public!"MODEL"
normal_check_interval 10
retry_check_interval 1
}
define command{
command_name check_printers
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ $ARG3$
}
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Unable to configure Printer in Nagios.
What happens when you test this at the command line?
Is /usr/lib64/nagios/plugins/ where the check_snmp_printer plugin is located?
Code: Select all
su nagios
/usr/lib64/nagios/plugins/check_snmp_printer -H xxx.xxx.xxx.xxx -C public -x "MODEL"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Unable to configure Printer in Nagios.
Thanks Box293,
You saved my life. thanks a lot
i rechecked check_snmp_printer plugin location and fixed the issue.
You saved my life. thanks a lot
i rechecked check_snmp_printer plugin location and fixed the issue.
Re: Unable to configure Printer in Nagios.
Glad to hear that this is working!xavmit wrote:Thanks Box293,
You saved my life. thanks a lot
i rechecked check_snmp_printer plugin location and fixed the issue.
I am going to close this thread. Please feel free to let us know if you have any more issues.
Former Nagios Employee.
me.
me.