check_snmp_printer

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
chris_l
Posts: 2
Joined: Thu Oct 29, 2015 10:03 pm

check_snmp_printer

Post by chris_l »

Hi everyone,
I'm having issues with the check_snmp_printer which i have downloaded from the nagios exchange.

Basically, downloaded the plugin and loaded in my ubuntu system /usr/lib/nagios/plugins
Run it manually and it works fine.

./check_snmp_printer -H 192.168.1.38 -C public -x "CONSUM ALL" -w 20 -c 10
Black Toner [K] Cartridge;SN071ACE80E0000495 is at 84% - OK! Yellow Toner [Y] Cartridge;SN122B4E80E00004AC is at 100% - OK! Magenta Toner [M] Cartridge;SN0139A980E00004EA is at 73% - OK! Cyan Toner [C] Cartridge;SN140FE180E0000498 is at 52% - OK! Waste Toner Container is OK! Black Drum Cartridge is at 77% - OK! Yellow Drum Cartridge is at 26% - OK! Magenta Drum Cartridge is at 28% - OK! Cyan Drum Cartridge is at 28% - OK! | Black Toner [K] Cartridge;SN071ACE80E0000495=84;20;10; Yellow Toner [Y] Cartridge;SN122B4E80E00004AC=100;20;10; Magenta Toner [M] Cartridge;SN0139A980E00004EA=73;20;10; Cyan Toner [C] Cartridge;SN140FE180E0000498=52;20;10; Waste Toner Container=-3;20;10; Black Drum Cartridge=77;20;10; Yellow Drum Cartridge=26;20;10; Magenta Drum Cartridge=28;20;10; Cyan Drum Cartridge=28;20;10;

i have put my command definition in /etc/nagios-plugins/config
define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c
}

Run the command in /etc/nagios3/conf.d
# Check PRINTER - Consumables
define service {
use generic-service ; Inherit values from a template
host_name printer_groupmain
service_description Printer Model
check_command check_printer!public!"CONSUM Magenta"!20!10
}

and it comes up with the message

Error: Could not find any host matching 'printer_groupmain' (config file '/etc/nagios3/conf.d/printers-service.cfg', starting on line 46)
Error: Could not expand hostgroups and/or hosts specified in service (config file '/etc/nagios3/conf.d/printers-service.cfg', starting on line 46)
Error processing object config files!

Please help. Thanks. :D :D :D
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_snmp_printer

Post by jdalrymple »

chris_l wrote:Error: Could not find any host matching 'printer_groupmain' (config file '/etc/nagios3/conf.d/printers-service.cfg', starting on line 46)
Did you define a host?

Code: Select all

define host{
     host_name                         printer_groupmain
     address                           111.222.333.444
     some other stuff
     }
chris_l
Posts: 2
Joined: Thu Oct 29, 2015 10:03 pm

Re: check_snmp_printer

Post by chris_l »

The host name is already defined in the separate file. It's been working fine for other services but for this service i have to put it on the same file.
After that, i got an error about the hostgroup. So instead of putting the host name, then i put the hostgroup.
Also i have to correct the command below

define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRES$S -C $ARG1$ -x $ARG2$ -w $ARG3$ -c
}

It's all working fine after that. I can't believe i just solved the issue here. I have a lot of things to learn about nagios.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_snmp_printer

Post by tgriep »

Glad you figured it out. Shall we lock up this post?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked