File: monitoring-printers.html

package info (click to toggle)
icinga 1.0.2-2%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 33,952 kB
  • ctags: 13,294
  • sloc: xml: 154,821; ansic: 99,198; sh: 14,585; sql: 5,852; php: 5,126; perl: 2,838; makefile: 1,268
file content (251 lines) | stat: -rw-r--r-- 12,592 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Monitoring Network Printers</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<meta name="keywords" content="Supervision, Icinga, Nagios, Linux">
<link rel="home" href="index.html" title="Icinga Version 1.0.2 Documentation">
<link rel="up" href="ch02.html" title="Chapter 2. Getting Started">
<link rel="prev" href="monitoring-netware.html" title="Monitoring Netware Servers">
<link rel="next" href="monitoring-routers.html" title="Monitoring Routers and Switches">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<CENTER><IMG src="../images/logofullsize.png" border="0" alt="Icinga" title="Icinga"></CENTER>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Monitoring Network Printers</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="monitoring-netware.html">Prev</a> </td>
<th width="60%" align="center">Chapter 2. Getting Started</th>
<td width="20%" align="right"> <a accesskey="n" href="monitoring-routers.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="section" title="Monitoring Network Printers">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="monitoring-printers"></a><a name="monitoring_printers"></a>Monitoring Network Printers</h2></div></div></div>
  

  <p><span class="bold"><strong>Introduction</strong></span></p>

  <div class="informalfigure">
      <div class="mediaobject"><img src="../images/printer.png"></div>
    </div>

  <p>This document describes how you can monitor the status of networked printers. Specifically, HP printers that have
  internal/external JetDirect cards/devices, or other print servers (like the Troy PocketPro 100S or the Netgear PS101) that
  support the JetDirect protocol.</p>

  <p>The <span class="emphasis"><em>check_hpjd</em></span> 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:</p>

  <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
      <p>Paper Jam</p>
    </li>
<li class="listitem">
      <p>Out of Paper</p>
    </li>
<li class="listitem">
      <p>Printer Offline</p>
    </li>
<li class="listitem">
      <p>Intervention Required</p>
    </li>
<li class="listitem">
      <p>Toner Low</p>
    </li>
<li class="listitem">
      <p>Insufficient Memory</p>
    </li>
<li class="listitem">
      <p>Open Door</p>
    </li>
<li class="listitem">
      <p>Output Tray is Full</p>
    </li>
<li class="listitem">
      <p>and more...</p>
    </li>
</ul></div>

  <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top">
    <p>These instructions assume that you've installed Icinga according to the <a class="link" href="quickstart.html" title="Quickstart Installation Guides">quickstart
    guide</a>. The sample configuration entries below reference objects that are defined in the sample config files
    (<span class="emphasis"><em>commands.cfg</em></span>, <span class="emphasis"><em>templates.cfg</em></span>, etc.) that are installed if you follow the
    quickstart.</p>
  </td></tr>
</table></div>

  <p><span class="bold"><strong>Overview</strong></span></p>

  <div class="informalfigure">
      <div class="mediaobject"><img src="../images/monitoring-printers.png"></div>
    </div>

  <p>Monitoring the status of a networked printer is pretty simple. JetDirect-enabled printers usually have SNMP enabled, which
  allows Icinga to monitor their status using the <span class="emphasis"><em>check_hpjd</em></span> plugin.</p>

  <p>The <span class="emphasis"><em>check_hpjd</em></span> plugin will only get compiled and installed if you have the net-snmp and
  net-snmp-utils packages installed on your system. Make sure the plugin exists in <span class="emphasis"><em>/usr/local/icinga/libexec</em></span>
  before you continue. If it doesn't, install net-snmp and net-snmp-utils and recompile/reinstall the Nagios
  plugins.</p>

  <p><span class="bold"><strong>Steps</strong></span></p>

  <p>There are several steps you'll need to follow in order to monitor a new network printer. They are:</p>

  <div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
      <p>Perform first-time prerequisites</p>
    </li>
<li class="listitem">
      <p>Create new host and service definitions for monitoring the printer</p>
    </li>
<li class="listitem">
      <p>Restart the Icinga daemon</p>
    </li>
</ol></div>

  <p><span class="bold"><strong>What's Already Done For You</strong></span></p>

  <p>To make your life a bit easier, a few configuration tasks have already been done for you:</p>

  <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
      <p>A <span class="emphasis"><em>check_hpjd</em></span> command definition has been added to the <span class="emphasis"><em>commands.cfg</em></span> file.
      This allows you to use the <span class="emphasis"><em>check_hpjd</em></span> plugin to monitor network printers.</p>
    </li>
<li class="listitem">
      <p>A printer host template (called <span class="emphasis"><em>generic-printer</em></span>) has already been created in the
      <span class="emphasis"><em>templates.cfg</em></span> file. This allows you to add new printer host definitions in a simple manner.</p>
    </li>
</ul></div>

  <p>The above-mentioned config files can be found in the <span class="emphasis"><em>/usr/local/icinga/etc/objects/</em></span> directory. You
  can modify the definitions in these and other definitions to suit your needs better if you'd like. However, we'd recommend
  waiting until you're more familiar with configuring Icinga before doing so. For the time being, just follow the
  directions outlined below and you'll be monitoring your network printers in no time.</p>

  <p><span class="bold"><strong>Prerequisites</strong></span></p>

  <p>The first time you configure Icinga to monitor a network printer, you'll need to do a bit of extra work. Remember,
  you only need to do this for the *first* printer you monitor.</p>

  <p>Edit the main Icinga config file.</p>

  <pre class="screen"># vi /usr/local/icinga/etc/icinga.cfg</pre>

  <p>Remove the leading hash (#) sign from the following line in the main configuration file:</p>

  <pre class="screen"> #cfg_file=/usr/local/icinga/etc/objects/printer.cfg</pre>

  <p>Save the file and exit.</p>

  <p>What did you just do? You told Icinga to look to the <span class="emphasis"><em>/usr/local/icinga/etc/objects/printer.cfg</em></span>
  to find additional object definitions. That's where you'll be adding host and service definitions for the printer. That
  configuration file already contains some sample host, hostgroup, and service definitions. For the *first* printer you monitor,
  you can simply modify the sample host and service definitions in that file, rather than creating new ones.</p>

  <p><span class="bold"><strong>Configuring Icinga</strong></span></p>

  <p>You'll need to create some <a class="link" href="objectdefinitions.html" title="Object Definitions">object definitions</a> in order to monitor a new
  printer.</p>

  <p>Open the <span class="emphasis"><em>printer.cfg</em></span> file for editing.</p>

  <pre class="screen"> vi /usr/local/icinga/etc/objects/printer.cfg</pre>

  <p>Add a new <a class="link" href="objectdefinitions.html#objectdefinitions-host">host</a> definition for the networked printer that you're going to
  monitor. If this is the *first* printer you're monitoring, you can simply modify the sample host definition in
  <span class="emphasis"><em>printer.cfg</em></span>. Change the <span class="emphasis"><em>host_name</em></span>, <span class="emphasis"><em>alias</em></span>, and
  <span class="emphasis"><em>address</em></span> fields to appropriate values for the printer.</p>

  <pre class="screen"> 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         192.168.1.30    ; IP address of the printer
        hostgroups      allhosts                ; Host groups this printer is associated with
        } </pre>

  <p>Now you can add some service definitions (to the same configuration file) to monitor different aspects of the printer. If
  this is the *first* printer you're monitoring, you can simply modify the sample service definition in
  <span class="emphasis"><em>printer.cfg</em></span>.</p>

  <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top">
    <p>Replace "<span class="emphasis"><em>hplj2605dn</em></span>" in the example definitions below with the name you specified in the
    <span class="emphasis"><em>host_name</em></span> directive of the host definition you just added.</p>
  </td></tr>
</table></div>

  <p>Add the following service definition to check the status of the printer. The service uses the
  <span class="emphasis"><em>check_hpjd</em></span> 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.</p>

  <pre class="screen"> 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
        }</pre>

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

  <pre class="screen"> 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
        }</pre>

  <p>Save the file.</p>

  <p><span class="bold"><strong>Restarting Icinga</strong></span></p>

  <p>Once you've added the new host and service definitions to the <span class="emphasis"><em>printer.cfg</em></span> file, you're ready to start
  monitoring the printer. To do this, you'll need to <a class="link" href="verifyconfig.html" title="Verifying Your Configuration">verify your configuration</a> and <a class="link" href="startstop.html" title="Starting and Stopping Icinga">restart Icinga</a>.</p>

  <p>If the verification process produces any errors messages, fix your configuration file before continuing. Make sure that
  you don't (re)start Icinga until the verification process completes without any errors!</p>
  <a class="indexterm" name="id1922806"></a>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="monitoring-netware.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="monitoring-routers.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Monitoring Netware Servers </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> Monitoring Routers and Switches</td>
</tr>
</table>
</div>
<P class="copyright">© 2009-2010 Icinga Development Team, http://www.icinga.org</P>
</body>
</html>