You are on page 1of 4

Monitoring Network Printers Nagios Core Doc... https://assets.nagios.com/downloads/nagioscore/...

Monitoring Network Printers

Up To: Contents (toc.html)


See Also: Monitoring Publicly Available Services (monitoring- Need Help Conguring
Nagios?
publicservices.html)
Our tech support team is
happy to help you with any
questions you might have.
Introduction Contact us on our online
This document describes how you can monitor the status support forum at
of networked printers. Specically, HP printers that have https://support.nagios.com
internal/external JetDirect cards/devices, or other print /forum/
servers (like the Troy PocketPro 100S or the Netgear (https://support.nagios.com
PS101) that support the JetDirect protocol. /forum/)

The check_hpjd plugin (which is part of the standard


Nagios plugins distribution) allows you to monitor the status of JetDirect-
capable printers which have SNMP enabled. The plugin is capable of
detecting the following printer states: Nagios XI Makes
Monitoring Easier:
Paper Jam

Out of Paper

Printer Oine

Intervention Required

Toner Low (https://www.nagios.com


/products/nagios-xi/)
Insucient Memory
Nagios XI
Open Door
(https://www.nagios.com
Output Tray is Full /products/nagios-xi/) is the
easy-to-use, enterprise
and more ... version of Nagios that
features:
Note: These instructions assume that you've installed Nagios according
Web-Based
to the quickstart guide (quickstart.html). The sample conguration entries
Conguration provides
below reference objects that are dened in the sample cong les
advanced conguration
(commands.cfg, templates.cfg, etc.) that are installed if you follow the
features
quickstart.
Monitoring Wizards
make it easy to monitor
new devices, applications,
Overview and services

Monitoring the status of a networked printer is pretty simple. JetDirect- Customizable


enabled printers usually have SNMP enabled, which allows Nagios Core to Dashboards allow for

1 de 4 29/10/17 18:19
Monitoring Network Printers Nagios Core Doc... https://assets.nagios.com/downloads/nagioscore/...

per-user customization

Integrated
Performance Graphs
provide trending and
capacity planning
information
monitor their status using the check_hpjd plugin. Advanced Reports
The check_hpjd plugin will only get compiled and installed if you have the provide data insight and
net-snmp and net-snmp-utils packages installed on your system. Make sure exporting capabilities
the plugin exists in /usr/local/nagios/libexec before you continue. If it doesn't, Data Visualizations
install net-snmp and net-snmp-utils and recompile/reinstall the Nagios enable powerful analysis
plugins. of patterns and problems

Nagios Core Import


functionality makes it
Steps easy to migrate from
There are several steps you'll need to follow in order to monitor a new Nagios Core
network printer. They are:
... and many other
1. Perform rst-time prerequisites features
(https://www.nagios.com
2. Create new host and service denitions for monitoring the printer /products/nagios-xi/)
3. Restart the Nagios daemon Download a free 60-day trial
(https://www.nagios.com
/downloads/nagios-xi/) of
Nagios XI or give the online
What's Already Done For You
demo
To make your life a bit easier, a few conguration tasks have already been (http://nagiosxi.demos.nagios.com/)
done for you: a spin.

A check_hpjd command denition has been added to the


commands.cfg le. This allows you to use the check_hpjd plugin to
monitor network printers.

A printer host template (called generic-printer) has already been


created in the templates.cfg le. This allows you to add new printer
host denitions in a simple manner.

The above-mentioned cong les can be found in the /usr/local/nagios


/etc/objects/ directory. You can modify the denitions in these and other
denitions to suit your needs better if you'd like. However, I'd recommend
waiting until you're more familiar with conguring Nagios Core before doing
so. For the time being, just follow the directions outlined below and you'll be
monitoring your network printers in no time.

Prerequisites
The rst time you congure Nagios Core to monitor a network printer, you'll
need to do a bit of extra work. Remember, you only need to do this for the
*rst* printer you monitor.

Edit the main Nagios cong le.

vi /usr/local/nagios/etc/nagios.cfg

Remove the leading pound (#) sign from the following line in the main
conguration le:

2 de 4 29/10/17 18:19
Monitoring Network Printers Nagios Core Doc... https://assets.nagios.com/downloads/nagioscore/...

#cfg_file=/usr/local/nagios/etc/objects/printer.cfg

Save the le and exit.

What did you just do? You told Nagios to look to the /usr/local/nagios
/etc/objects/printer.cfg to nd additional object denitions. That's where you'll
be adding host and service denitions for the printer. That conguration le
already contains some sample host, hostgroup, and service denitions. For
the *rst* printer you monitor, you can simply modify the sample host and
service denitions in that le, rather than creating new ones.

Conguring Nagios Core


You'll need to create some object denitions (objectdenitions.html) in order
to monitor a new printer.

Open the printer.cfg le for editing.

vi /usr/local/nagios/etc/objects/printer.cfg

Add a new host (objectdenitions.html#host) denition for the networked


printer that you're going to monitor. If this is the *rst* printer you're
monitoring, you can simply modify the sample host denition in printer.cfg.
Change the host_name, alias, and address elds to appropriate values for the
printer.

define host {
use generic-printer ; Inherit default values from a templat
host_name hplj2605dn ; The name we're giving to this printer
alias HP LaserJet 2605dn ; A longer name associated with the pri
address 192.168.1.30 ; IP address of the printer
hostgroups allhosts ; Host groups this printer is associate
}

Now you can add some service denitions (to the same conguration le) to
monitor dierent aspects of the printer. If this is the *rst* printer you're
monitoring, you can simply modify the sample service denition in
printer.cfg.

Note: Replace "hplj2605dn" in the example denitions below with the


name you specied in the host_name directive of the host denition you
just added.

Add the following service denition to check the status of the printer. The
service uses the check_hpjd plugin to check the status of the printer every 10
minutes by default. The SNMP community string used to query the printer is
"public" in this example.

3 de 4 29/10/17 18:19
Monitoring Network Printers Nagios Core Doc... https://assets.nagios.com/downloads/nagioscore/...

define service {
use generic-service ; Inherit values from a
host_name hplj2605dn ; The name of the host
service_description Printer Status ; The service descripti
check_command check_hpjd!-C public ; The command used to m
normal_check_interval 10 ; Check the service eve
retry_check_interval 1 ; Re-check the service
}

Add the following service denition to ping the printer every 10 minutes by
default. This is useful for monitoring RTA, packet loss, and general network
connectivity.

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
}

Save the le.

Restarting Nagios Core


Once you've added the new host and service denitions to the printer.cfg le,
you're ready to start monitoring the printer. To do this, you'll need to verify
your conguration (verifycong.html) and restart Nagios (startstop.html).

If the verication process produces any errors messages, x your


conguration le before continuing. Make sure that you don't (re)start Nagios
Core until the verication process completes without any errors!

4 de 4 29/10/17 18:19

You might also like