Friday, August 19, 2011

Monitoring Network Printers

This is a quick instructions about how to monitor the network printers in Nagios monitoring system. First important things that you should know is SNMP. Your printer should support the SNMP and also enabled on printer. HP printers that support internal/external JetDirect or other printers that support JetDirect protocol are good for this purpose.
Fisrt, we should install check_hpjd plugin.  To install this plugin, we should install net-snmp and net-snmp-utils packages.
yum install net-snmp
yum install net-snmp-utils
Next step, edit the main Nagios Configuration file:
vi /usr/local/nagios/etc/nagios.cfg
and uncomment this line:
and then save it. Now edit the printer configuration file and add new host definition for the networked printer that you want to monitor.
vi /usr/local/nagios/etc/objects/printer.cfg
This is the output of this file which is a sample and modify it according to your needs
# Define a host for the printer we'll be monitoring
# Change the host_name, alias, and address to fit your situation

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            ; IP address of the printer
        hostgroups      network-printers        ; Host groups this printer is associated with

# A hostgroup for network printers

define hostgroup{
        hostgroup_name  network-printers        ; The name of the hostgroup
        alias           Network Printers        ; Long name of the group
# Create a service for monitoring the status of the printer
# Change the host_name to match the name of the host you defined above
# If the printer has an SNMP community string other than "public", change the check_command #directive to reflect that

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

# Create a service for "pinging" the printer occassionally.  Useful for monitoring RTA, packet loss, etc.

define service{
        use                     generic-service
        host_name               hplj2605dn
        service_description     PING
        check_command           check_ping!3000.0,80%!5000.0,100%
        normal_check_interval   10
        retry_check_interval    1

After editing this file, run the following command to make sure everything is fine, especially for spelling errors:
/usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/nagios.cfg
It supposes to show 0 and 0 errors if these is no error.
And finally restart the service:
service nagios restart

All the best,
Khosro Taraghi


  1. Nice post. I like the way you start and then conclude your thoughts. Thanks for this information .I really appreciate your work, keep it up and thanks for sharing information with me.
    DVD distributor

  2. Call at 1-888-989-8478, the genuine HP Support Number, provides quality support to the user via internet and over phone. The number is toll free you can call us any time and get 24x7 on-line technical support for your devices.

  3. Dell Printer Support provides quality support to the user via internet and over phone. A user needs to visit our site or dial our toll free dell support number 1-888-989-8478 and our expert will handle the call and will try to solve the problem.

  4. Excellent information.I like the way of writing and presenting

    123hpremoteassistance Deskjet 5737 Printer Setup

  5. Great blog! I really love how it is easy on my eyes and the information are well written.

    123HPEnvy OfficeJet3837 Install