check_snmp_printer problem

This forum is intended for the discussion of Nagios Core development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagios-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_snmp_printer problem

Postby onemore » Tue Apr 02, 2019 2:04 pm

Dear Forum!

I have installed a Nagios Core on Ubuntu 16.04 .
I would like monitoring my printers (Xerox).
I follow this site steps: https://ittutorials.net/open-source/nag ... th-nagios/ , but when I check nagios site then i get this:
http://www.kepfeltoltes.eu/view.php?filename=639error.jpg

after i type this lines in printer.cfg:
define service{
use generic-service
hostgroup_name printers
service_description Check Model
check_command check_snmp_printer!public!"MODEL"
}

define service{
use generic-service
hostgroup_name printers
service_description Check Toner
check_command check_snmp_printer!public!"CONSUM ALL"!5!2
}
....but again i get a problem:
http://www.kepfeltoltes.eu/view.php?filename=267error2.jpg

If I type example this lines on the ubuntu then i get perfect answer.
./check_snmp_printer -H 10.0.0.5 -C public -t MODEL

./check_snmp_printer -h 10.0.0.5 -t


./check_snmp_printer -H 10.0.0.5 -C public -t "CONSUM ALL" -w 25 -c 10

./check_snmp_printer -H 10.0.0.5 -C public -t "CONSUM ALL" -w 25 -c 10./check_snmp_printer -H 10.0.0.5 -C public -t PAGECOUNT

snmpwalk -v 2c -c public 10.0.0.5

Please help me for this problem solved and please tell me step by step how to can I install the check_snmp_printer.

Thanks!
onemore
 
Posts: 2
Joined: Tue Apr 02, 2019 1:32 pm

Re: check_snmp_printer problem

Postby tgriep » Tue Apr 02, 2019 5:00 pm

Can you post how you defined the check_snmp_printer command so we can check the Arguments to see if they line up with the service check?
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!
User avatar
tgriep
Madmin
 
Posts: 8173
Joined: Thu Oct 30, 2014 9:02 am

Re: check_snmp_printer problem

Postby onemore » Wed Apr 03, 2019 2:04 am

Hello!

(/usr/local/nagios/etc/objects/commands.cfg)
I wrote in the commands.cfg :
define command {
command_name check_snmp_printer
command_line /usr/local/nagios/libexec/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$
}

After i allowed the printer.cfg in /usr/local/nagios/etc/nagios.cfg . (uncomment this line: cfg_file=/usr/local/nagios/etc/objects/printer.cfg)

Finally i give wrote this lines in /usr/local/nagios/etc/objects/printer.cfg :
define host {
use generic-printer ; Inherit default values from a template
host_name xerox ; The name we're giving to this printer
alias xerox ; A longer name associated with the printer
address 192.168.1.30 ; IP address of the printer
hostgroups network-printers ; Host groups this printer is associated with
}
define hostgroup {

hostgroup_name network-printers ; The name of the hostgroup
alias Network Printers ; Long name of the group
}
define service{
use generic-service
host_name xerox
service_description Check Model
check_command check_snmp_printer!public!"MODEL"
}

define service{
use generic-service
host_name xerox
service_description Check Toner
check_command check_snmp_printer!public!"CONSUM ALL"!5!2
}
define service{
use generic-service
host_name xerox
service_description check-toners
check_command check_snmp_printer!public!”CONSUM Toners”!20!10
}
onemore
 
Posts: 2
Joined: Tue Apr 02, 2019 1:32 pm

Re: check_snmp_printer problem

Postby tgriep » Wed Apr 03, 2019 9:00 am

The settings look good to me. I created a check on my Nagios server and it all worked as expected.
In your examples, you use 2 different IP addresses, do both of the printer support polling of that data using SNMP?
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!
User avatar
tgriep
Madmin
 
Posts: 8173
Joined: Thu Oct 30, 2014 9:02 am


Return to Nagios Core Development

Who is online

Users browsing this forum: No registered users and 3 guests