Page 1 of 1

unable to configure printer with Nagios Core

Posted: Thu Jul 23, 2020 6:14 am
by Rajubudde
Hi

This is Raju, I have configured nagios core server with linux machines correctly. But When I am struck at configure printer with Nagios server.

In the server side
Edit the main Nagios config file.
vi /usr/local/nagios/etc/nagios.cfg
Remove the leading pound (#) sign from the following line in the main configuration file:
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg
Save the file and exit.
Open the printer.cfg file for editing.
vi /usr/local/nagios/etc/objects/printer.cfg

Code: Select all

     define host {
    use         generic-printer     ; Inherit default values from a template
    host_name   hplj2605dn          ; The name we're giving to this printer
    alias       HP LaserJet 2605dn  ; A longer name associated with the printer
    address     <PrinterIP>       ; IP address of the printer
    hostgroups  allhosts            ; Host groups this printer is associated with
    }
define service {
    use                     generic-service         ; Inherit values from a template
    host_name               hplj2605dn              ; The name of the host the service is associated with
    service_description     Printer Status          ; The service description
    check_command           check_ping!3000.0,80%!5000.0,100%   ; 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
}

define service {
    use                     generic-service         ; Inherit values from a template
    host_name               hplj2605dn              ; The name of the host the service is associated with
    service_description     Printer Status          ; The service description
    check_command           check_hpjd!-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
}
save and close the file.
I have restart the nagios core server
I have enable the snmp service in printer and nagios server.
From the /usr/local/nagios/etc/objects/printer.cfg file, check_ping plugin works correctly.
But check_hpjd plugin was not running. It shows CRITICAL.

Code: Select all

[color=#FF0000]PING OK	07-23-2020 16:31:33	1d 1h 50m 46s	1/3	PING OK - Packet loss = 0%, RTA = 0.78 ms 
Printer Status CRITICAL	07-23-2020 16:24:59	1d 1h 47m 26s	3/3	Timeout: No Response from PrinterIP:161. : Timeout from host PrinterIP[/color]


snmp was running on printer

Please help me to fix this issue.

Thanks,
Raju