How to monitor your Dymo printserver

About twice a week, I get a call that a Dymo LabelWriter 450 no longer works. In most cases, the reason was that the user pulled the USB cable.

My Dymo LabelWriters are connected to a Dymo printserver. While the printservers can be monitored using ping, this does not allow you to see if the printer it still connected to the printserver. Luckily the Dymo printserver has SNMP support with the option to see what device is connected.

I did a SNMPWalk against the printserver, first with the LabelWriter connected, then disconnected. Aside from some counters, three values were different:

Connected Disconnected
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: DYMO LabelWriter 400 HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: [nothing here]
HOST-RESOURCES-MIB::hrDeviceStatus.2 = INTEGER: running(2) HOST-RESOURCES-MIB::hrDeviceStatus.2 = INTEGER: unknown(1)
HOST-RESOURCES-MIB::hrPrinterStatus.1 = INTEGER: idle(3) HOST-RESOURCES-MIB::hrPrinterStatus.1 = INTEGER: unknown(2)

I also found that HOST-RESOURCES-MIB::hrDeviceDescr.2 sometimes shows the correct printer string one time, but doesn't show it the second time:

$ snmpget -v 1 -c public dymo2  HOST-RESOURCES-MIB::hrDeviceDescr.2
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: DYMO LabelWriter 450
$ snmpget -v 1 -c public dymo2  HOST-RESOURCES-MIB::hrDeviceDescr.2
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: 
$ snmpget -v 1 -c public dymo2  HOST-RESOURCES-MIB::hrDeviceDescr.2
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: DYMO LabelWriter 450
$ snmpget -v 1 -c public dymo2  HOST-RESOURCES-MIB::hrDeviceDescr.2
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: 
$ snmpget -v 1 -c public dymo2  HOST-RESOURCES-MIB::hrDeviceDescr.2
HOST-RESOURCES-MIB::hrDeviceDescr.2 = STRING: DYMO LabelWriter 450

Therefore, I use a script that tries 10 times in a row. If it finds a valid string at least once, that's good enough:

#!/bin/bash
 
[ "$1" == "" ] && { echo "Syntax: $0 [hostname]" ; exit 1; }
 
i=0
while [ $i -lt 10 ]; do
        response=$(/usr/lib64/nagios/plugins/check_snmp -H $1 -o HOST-RESOURCES-MIB::hrDeviceDescr.2 -R dymo)
        retval=$?
        if [ $retval -eq 0 ]; then
                echo $response
                exit $retval
        fi
        i=$((i+1))
done
 
echo "Printer disconnected from printserver"
exit 2

This script can be used with Nagios to monitor the LabelWriter.

© GeekLabInfo How to monitor your Dymo printserver is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd met *

*

code