Can't get check_printer plugin to work in Nagios Core
Posted: Wed Dec 02, 2015 10:08 am
I'm hoping someone can help me get this working. I'm trying to monitor our Ricoh printers and copiers beyond the check_hpjd plugin (which is part of the standard Nagios plugins distribution). This plugin works well with our HP printers, but I can't get it to do anything for the Ricoh devices. I found a 3rd party plugin in the Nagis Exchange community, that claims it monitors Ricoh printers, and others, quite well. It received a high rating and got 16 votes.
HERE IS THE LINK:
https://exchange.nagios.org/directory/P ... es/details
BUT...There isn't any clear documentation to get it installed and configured...and to make things even more difficult, it's in German, lol. I managed to successfully run it in a command line, but it spits out German results, and even after translating in Google Translate, it still doesn't make sense.
I'm including some steps I took, as well as the details from my command.cfg and printers.cfg files below. The only thing I could find on the web about this plugin, wasn't very helpful at all and, at best, outlined a solution to create a new service per check, which is not efficient at all, nor what this plugin is capable of. Here is that link as well:
https://www.reddit.com/r/nagios/comment ... r_to_work/
Thanks very much for taking the time to read this and help me. I am new to Nagios Core in general, but really struggling with installing additional third party plugins. I really want to get this working and understand working with these custom plugins.
Here is my config...
COMMANDS.CFG:
# 'check_printer' command definition
define command{
command_name check_printer
command_line /usr/bin/php $USER1$/check_printer $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
}
PRINTER.CFG:
define service{
use generic-ricoh ; Inherit values from a template
host_name RicohFiery-0517,COPBEN ; The name of the host the service is associated with
service_description Ricoh Status ; The service description
check_command check_printer!-C public ; The command used to monitor the service
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
TEMPLATES.CFG:
# Test service for Ricoh printers.
define service{
name generic-ricoh ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined
contact_groups nagios-testers ; Notifications get sent out to everyone in the 'nagios-testers' group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 0 ; Send notifications when a service status is changed
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
...and finally, here is my COMMANDS.CFG config for the check_hpjd plugin for comparison:
# 'check_hpjd' command definition
define command{
command_name check_hpjd
command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
}
HERE IS THE OUTPUT IN THE NAGIOS WEB GUI:
Current Status:
UNKNOWN
(for 0d 17h 19m 56s)
Status Information: /usr/local/nagios/libexec/check_printer ip community snmp command
-> snmp versions = 1, v2c
-> counter num
Gibt verschiedenen Counter des Druckers aus. Counter 2-num sind Ricoh spezifisch.
Counter 1 ist immer Lifetimecounter fuer gedruckte Seiten. Liefert perfdata.
Status ist immer OK wenn Counter existiert ansonsten UNKNOWN.
-> toner_kyocera_monochrome
-> toner_ricoh_monochrome / toner_ricoh_color
-> toner/ink num [warn] [crit] [max]
Gibt den Status des Toners bzw der Tinte aus. Liefert Fuellstand als perfdata wenn
moeglich. Wenn der Drucker falsche Maximalwerte fuer Patronen/Toner liefert
(z.b. HP Businessink) kann mit max der richtige Wert angegeben werden (meist 100).
warn gibt die Schwelle zwischen ok und warning an (0.0 bis 1.0; default: 0.2 = 20%)
-> paper num [warn] [crit]
Gibt den Status des Papiertrays num aus. Liefert Fuellstand als perfdata wenn moeglich.
warn gibt die Schwelle zwischen ok und warning an (0.0 bis 1.0; default: 0.2 = 20%)
-> hardware num
Gibt Status der Komponente num aus (z.b. CPU, RAMDISK).
Liefert perfdata wenn moeglich (Bedeutung oft ungewiss).
-> parts num
Gibt den Status des Druckerteiles num aus (Bsp: Rear Unit).
-> alerts
Gibt alle wichtigen Druckermeldungen aus. Ignoriert soweit moeglich unwichtige Meldungen
(z.b. Energiesparmodus oder Aufwaermphase). Gibt bei jeder Meldung Status=warning.
Bei Meldungen die trained bzw fieldservice erfordern oder servity gleich critical ist
wird Status=critical zurueckgegeben.
-> accounting pw num [warn]
Gibt den Status der Kostenstelle 1-num aus (Kyocera). Kostenstellen koennen per
"KM Net for Accounting" oder im Druckermenu durch gedrueckt halten von OK und
Druck auf Menu erstellt werden.
Passwort setzt sich zusammen aus Druckernummer (4stellig) und wird dann mit 0 auf
15 Stellen aufgefuellt. (bsp FS-2000 => 200000000000000)
warn gibt die Schwelle zwischen ok und warning an (0.0 bis 1.0; default: 0.2 = 20%)
Liefert perfdata
HERE IS THE LINK:
https://exchange.nagios.org/directory/P ... es/details
BUT...There isn't any clear documentation to get it installed and configured...and to make things even more difficult, it's in German, lol. I managed to successfully run it in a command line, but it spits out German results, and even after translating in Google Translate, it still doesn't make sense.
I'm including some steps I took, as well as the details from my command.cfg and printers.cfg files below. The only thing I could find on the web about this plugin, wasn't very helpful at all and, at best, outlined a solution to create a new service per check, which is not efficient at all, nor what this plugin is capable of. Here is that link as well:
https://www.reddit.com/r/nagios/comment ... r_to_work/
Thanks very much for taking the time to read this and help me. I am new to Nagios Core in general, but really struggling with installing additional third party plugins. I really want to get this working and understand working with these custom plugins.
Here is my config...
COMMANDS.CFG:
# 'check_printer' command definition
define command{
command_name check_printer
command_line /usr/bin/php $USER1$/check_printer $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
}
PRINTER.CFG:
define service{
use generic-ricoh ; Inherit values from a template
host_name RicohFiery-0517,COPBEN ; The name of the host the service is associated with
service_description Ricoh Status ; The service description
check_command check_printer!-C public ; The command used to monitor the service
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
TEMPLATES.CFG:
# Test service for Ricoh printers.
define service{
name generic-ricoh ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined
contact_groups nagios-testers ; Notifications get sent out to everyone in the 'nagios-testers' group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 0 ; Send notifications when a service status is changed
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
...and finally, here is my COMMANDS.CFG config for the check_hpjd plugin for comparison:
# 'check_hpjd' command definition
define command{
command_name check_hpjd
command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
}
HERE IS THE OUTPUT IN THE NAGIOS WEB GUI:
Current Status:
UNKNOWN
(for 0d 17h 19m 56s)
Status Information: /usr/local/nagios/libexec/check_printer ip community snmp command
-> snmp versions = 1, v2c
-> counter num
Gibt verschiedenen Counter des Druckers aus. Counter 2-num sind Ricoh spezifisch.
Counter 1 ist immer Lifetimecounter fuer gedruckte Seiten. Liefert perfdata.
Status ist immer OK wenn Counter existiert ansonsten UNKNOWN.
-> toner_kyocera_monochrome
-> toner_ricoh_monochrome / toner_ricoh_color
-> toner/ink num [warn] [crit] [max]
Gibt den Status des Toners bzw der Tinte aus. Liefert Fuellstand als perfdata wenn
moeglich. Wenn der Drucker falsche Maximalwerte fuer Patronen/Toner liefert
(z.b. HP Businessink) kann mit max der richtige Wert angegeben werden (meist 100).
warn gibt die Schwelle zwischen ok und warning an (0.0 bis 1.0; default: 0.2 = 20%)
-> paper num [warn] [crit]
Gibt den Status des Papiertrays num aus. Liefert Fuellstand als perfdata wenn moeglich.
warn gibt die Schwelle zwischen ok und warning an (0.0 bis 1.0; default: 0.2 = 20%)
-> hardware num
Gibt Status der Komponente num aus (z.b. CPU, RAMDISK).
Liefert perfdata wenn moeglich (Bedeutung oft ungewiss).
-> parts num
Gibt den Status des Druckerteiles num aus (Bsp: Rear Unit).
-> alerts
Gibt alle wichtigen Druckermeldungen aus. Ignoriert soweit moeglich unwichtige Meldungen
(z.b. Energiesparmodus oder Aufwaermphase). Gibt bei jeder Meldung Status=warning.
Bei Meldungen die trained bzw fieldservice erfordern oder servity gleich critical ist
wird Status=critical zurueckgegeben.
-> accounting pw num [warn]
Gibt den Status der Kostenstelle 1-num aus (Kyocera). Kostenstellen koennen per
"KM Net for Accounting" oder im Druckermenu durch gedrueckt halten von OK und
Druck auf Menu erstellt werden.
Passwort setzt sich zusammen aus Druckernummer (4stellig) und wird dann mit 0 auf
15 Stellen aufgefuellt. (bsp FS-2000 => 200000000000000)
warn gibt die Schwelle zwischen ok und warning an (0.0 bis 1.0; default: 0.2 = 20%)
Liefert perfdata