HomeSection_sub_breakBlogsSection_sub_breakTechnical Blog
Icon_blog_forum_small Detecting Problems with your Printers via Paglo Alerts and the SNMP Get Plugin Crawler Plugin
Icon_person
Scanner
Icon_time
11/25/2009 at 15:36
Icon_post
0 comments

One of the great tools of network and IT management is SNMP. Many devices purchased today have support for some set of SNMP MIBs. The Paglo Crawler has a plugin that can capture specific SNMP OIDs from any device it scans. Coupled with a Paglo Crawler Schedule, and a Paglo Alert you can be notified of many errors and warning conditions on devices on your network.

In this post we show you how to be notified when there is an exception with a network attached printer that supports SNMP. (This is just one example of how SNMP and Paglo can work for you)

First we need to configure the Paglo Crawler’s SNMP Get Plugin to query some parts of the SNMP tree that contain the information we care about. We want to track two additional OIDs: HOST-RESOURCES-MIB::hrDeviceStatus and HOST-RESOURCES-MIB::hrPrinterDetectedErrorState. This first will tell us if the printer is behaving normally, or if something is wrong. The second can tell us what the printer thinks is wrong.

By clicking on the ‘Plugins’ tab for your Paglo Crawler in the ‘Crawlers’ App in your Paglo account you will see the plugin SNMP Get Plugin” in the list of available plugins. When you select this plugin make sure that Enabled is checked. To monitor the two OIDs we mentioned above you need to add them. By clicking on the Custom… button brings up a dialog when you can enter the OIDs one at a time.

Currently you need to use the numerical representation of the OIDs. For HOST-RESOURCES-MIB::hrPrinterDetectedErrorState this is: “1.3.6.1.2.1.25.3.5.1.2.1” and for HOST-RESOURCES-MIB::hrDeviceStatus it is: “1.3.6.1.2.1.25.3.2.1.5.1”. We also get the HOST-RESOURCES-MIB::hrPrinterStatus OID to differentiate between other types of devices and printers. Its numerical representation is: “1.3.6.1.2.1.25.3.5.1.1.1”.

The SNMP Get Plugin is a ‘device’ plugin which means it will be run at least once a day automatically against all hosts that the Paglo Crawler discovers. For monitoring a service for problems this is not often enough. So we are going to create a schedule that will run this plugin against our printers every 5 minutes. We also throw in the Service Health Check plugin because it is inexpensive (in terms of resource utilization) to run and can tell you other valuable things about your printer like “is it available?”

Now we have the Paglo Crawler checking up on our printers every 5 minutes we can now construct an alert to tell us when the printer is unhappy.

This involves delving a little in to how Paglo stores data for data retrieved via the SNMP Get Plugin. Paglo uses a sub-tree named ‘snmp’ rooted for every device. At every level of the OID we create a new level in Paglo. Thus, the hrDeviceStatus OID’s value is stored at: /network/device/oid_1/oid_3/oid_6/oid_1/oid_2/oid_1/oid_25/oid_3/oid_2/oid_1/oid_5/oid_1 The value stored here will be ‘2’ if the device is running normally, ‘3’ if it is in some unspecified warning state, and ‘5’ if it is down — ie: not operating due to some error.

The heart of a Paglo Alert is a PQL query. (Go to the end of this post if you just want to click on a link and have the Alert created for you). We can turn any PQL query that returns any result when an error condition is true in to an alert. So what we ned is a query that will tell us the hrPrinterStatus and hrPrinterDetectedErrorState when any printer is down. For it to be considered a printer it must have the hrPrinterStatus OID. For it to be having a problem the hrDeviceStatus must be ‘5’.

In the Paglo Alerts app we create an alert and use the following PQL query:

select nvl(../../../../../../../../../system/name, ../../../../../../../../../system/dns_name)||'('||first(../../../../../../../../../interface/inet/ip_address)||')' as "Printer",
oid_2/oid_1/oid_5/oid_1 as "Device Status",
oid_5/oid_1/oid_1/oid_1 as "Printer Status",
oid_5/oid_1/oid_2/oid_1 as "Detected Error State"
from /network/device/snmp/oid_1/oid_3/oid_6/oid_1/oid_2/oid_1/oid_25/oid_3
where oid_2/oid_1/oid_5/oid_1 = '5' and oid_5/oid_1/oid_2/oid_1 != '0x00'

Here is what the results of the above PQL would look like if a printer was offline:

Now you will be alerted whenever any of your Paglo monitored printers is having problems.

One of the nice things about such PQL queries is that you can easily view the history of any of the results. If you click on a label, such as ‘Device Status’ in the above query results you will get a popup menu. From this select History and you will see the history of this value over time as a chart, if the value is numeric.

This alert has already been created as a public Share-It in Paglo’s community: Printer Having Problems .

Add a Comment