Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Nov 2011 13:31:29 -0600 (CST)
From:      Thomas Johnson <tom@claimlynx.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/162975: net-mgmt/nagios-check_smartmon causes error when run
Message-ID:  <20111130193129.41C17358D0F@leopard.claimlynx.com>
Resent-Message-ID: <201111301940.pAUJeCw1031817@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         162975
>Category:       ports
>Synopsis:       net-mgmt/nagios-check_smartmon causes error when run
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 30 19:40:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Johnson
>Release:        FreeBSD 8.2-RELEASE-p3 amd64
>Organization:
ClaimLynx, Inc.
>Environment:
System: FreeBSD leopard.claimlynx.com 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #0: Tue Sep 27 18:45:57 UTC 2011 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64


>Description:
	The check script provided by net-mgmt/nagios-check_smartmon produces an error when run. I just installed this port today, along with sysutils/smartmontools.

	I receive the following output when run against a SATA disk in a USB enclosure:

-> /usr/local/libexec/nagios/check_smartmon -d /dev/da0 -v 3
Get device name
Device: /dev/da0
Check device
Check if /dev/da0 does exist and can be read
Check if /usr/local/sbin/smartctl does exist and can be read
Path to smartctl: /usr/local/sbin/smartctl
Get device type
Device type: scsi
Call smartctl
Get device health status: /usr/local/sbin/smartctl -H /dev/da0
Get device temperature: /usr/local/sbin/smartctl -A /dev/da0
Parse smartctl output
parseOutput: Device type is scsi
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

>How-To-Repeat:

Repeatable when run in the manner described in the description. My relevant port versions are as follows:

python27-2.7.2_3
nagios-check_smartmon-20100318_1
smartmontools-5.42_1
>Fix:

Nagios Exchange has an updated version of this script that appears to work fine.

http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check_smartmon/details

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111130193129.41C17358D0F>