This just in:
$ /usr/local/bin/sudo /usr/local/libexec/nagios/check_smartmon -d /dev/da0
Traceback (most recent call last):
File "/usr/local/libexec/nagios/check_smartmon", line 307, in <module>
(healthStatus, temperature) = parseOutput(healthStatusOutput, temperatureOutput, devtype)
File "/usr/local/libexec/nagios/check_smartmon", line 216, in parseOutput
vprint(3, "Health status: %s" % healthStatus)
UnboundLocalError: local variable 'healthStatus' referenced before assignment
But I can’t fix that now. I’m off to the Oscars party.












see also https://dan.langille.org/2013/07/25/nagios-check_smartmon-fails-with-sata-presented-as-scsi-devices/
Here is an ata device:
Here is the same type of device, presented as a scsi device:
Here is the patch which ignores that incomplete response line:
$ diff -ub /usr/local/libexec/nagios/check_smartmon ~/tmp/check_smartmon --- /usr/local/libexec/nagios/check_smartmon 2014-03-03 16:50:31.633784726 +0000 +++ /usr/home/dan/tmp/check_smartmon 2014-03-03 16:59:06.385990486 +0000 @@ -59,7 +59,7 @@ metavar="LEVEL", help="set verbosity level to LEVEL; defaults to 0 (quiet), \ possible values go up to 3") parser.add_option("-t", "--type", action="store", dest="devtype", default="ata", metavar="DEVTYPE", - help="type of device (ATA|SCSI)") + help="type of device (ata|scsi)") parser.add_option("-w", "--warning-threshold", metavar="TEMP", action="store", type="int", dest="warningThreshold", default=55, help="set temperature warning threshold to given temperature (defaults to 55)") @@ -162,6 +162,7 @@ getNext = 0 for line in lines: if getNext: + if line <> "SMART STATUS RETURN: incomplete response, ATA output registers missing": statusLine = line break elif line == "=== START OF READ SMART DATA SECTION ===": @@ -290,11 +291,12 @@ # check device type, ATA is default vprint(2, "Get device type") devtype = options.devtype + vprint(2, "command line supplied device type is: %s" % devtype) if not devtype: - devtype = "ATA" - if device_re.search( device ): devtype = "scsi" + else: + devtype4= "ata" vprint(1, "Device type: %s" % devtype) @@ -304,6 +306,7 @@ if value != 0: exitWithMessage(value, message) vprint(2, "Parse smartctl output") + (healthStatus, temperature) = parseOutput(healthStatusOutput, temperatureOutput, devtype) vprint(2, "Generate return information") (value, message) = createReturnInfo(healthStatus, temperature,