From owner-svn-ports-all@freebsd.org Thu Feb 21 21:33:51 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 608AA14F1FA0; Thu, 21 Feb 2019 21:33:51 +0000 (UTC) (envelope-from pierre@guinoiseau.nz) Received: from mail-01.yggdrasil.nz (mail-01.yggdrasil.nz [IPv6:2a01:4f8:171:1cf0::10:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 594DF8EF22; Thu, 21 Feb 2019 21:33:47 +0000 (UTC) (envelope-from pierre@guinoiseau.nz) Received: from [10.22.50.32] (unknown [203.83.196.110]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-01.yggdrasil.nz (Postfix) with ESMTPSA id A1327EBDC; Fri, 22 Feb 2019 10:33:28 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=guinoiseau.nz; s=mail; t=1550784810; bh=kKxx0B6Qwx+o3h0MTT27rhpJZEOvpH0Iw4Bm7n83pIM=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=eCygFVqfXZ2Y8GdwZAxtyk8BbV4iNCI2P6sFK9BCyxfo7Ca9G9DLnN/v7aYvZdG2I tLBDqlckuHO1ovc6d3yGiorkj/u+9llwUlzLxAeeHBX/euSavKLEHhtJYH5Kv6yOe7 9owNnEa3SbLESPvfGnayHVW+fguhnzxYcVS4XKAg= Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r493266 - in head/net-mgmt/nagios-check_smartmon: . files From: Pierre Guinoiseau In-Reply-To: <201902181508.x1IF8lhS049907@repo.freebsd.org> Date: Fri, 22 Feb 2019 10:33:23 +1300 Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7563B519-9277-4AEC-A1C1-FED1B469C3D7@guinoiseau.nz> References: <201902181508.x1IF8lhS049907@repo.freebsd.org> To: Dan Langille X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 594DF8EF22 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=guinoiseau.nz header.s=mail header.b=eCygFVqf; spf=pass (mx1.freebsd.org: domain of pierre@guinoiseau.nz designates 2a01:4f8:171:1cf0::10:1 as permitted sender) smtp.mailfrom=pierre@guinoiseau.nz X-Spamd-Result: default: False [-3.75 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[guinoiseau.nz:s=mail]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[guinoiseau.nz]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DKIM_TRACE(0.00)[guinoiseau.nz:+]; MX_GOOD(-0.01)[mail.yggdrasil.nz,mail2.yggdrasil.nz]; NEURAL_HAM_SHORT(-0.82)[-0.816,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.93)[ipnet: 2a01:4f8::/29(-2.41), asn: 24940(-2.22), country: DE(-0.01)]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 21:33:51 -0000 Hi, I=E2=80=99m getting this error now after this change: Info: Traceback (most recent call last): File "/usr/local/libexec/nagios/check_smartmon", line 309, in (healthStatus, temperature) =3D parseOutput(healthStatusOutput, = temperatureOutput, devtype) File "/usr/local/libexec/nagios/check_smartmon", line 220, in = parseOutput vprint(3, "Temperature: %d" %temperature) UnboundLocalError: local variable 'temperature' referenced before = assignment Cheers, Pierre > On 19/02/2019, at 04:08, Dan Langille wrote: >=20 > Author: dvl > Date: Mon Feb 18 15:08:46 2019 > New Revision: 493266 > URL: https://svnweb.freebsd.org/changeset/ports/493266 >=20 > Log: > Patch check_smartmon to cater for changed smartctl output >=20 > We previously patched the code to look for: >=20 > SMART STATUS RETURN: incomplete response, ATA output registers = missing >=20 > That line is now: >=20 > SMART Status not supported: Incomplete response, ATA output registers = missing >=20 > It also seems like the temperature has moved from part 190 to 194. >=20 > PR: 235475 > Approved by: Krzysztof (maintainer) > MFH: 2019Q1 >=20 > Modified: > head/net-mgmt/nagios-check_smartmon/Makefile > head/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon >=20 > Modified: head/net-mgmt/nagios-check_smartmon/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/net-mgmt/nagios-check_smartmon/Makefile Mon Feb 18 = 15:01:50 2019 (r493265) > +++ head/net-mgmt/nagios-check_smartmon/Makefile Mon Feb 18 = 15:08:46 2019 (r493266) > @@ -3,7 +3,7 @@ >=20 > PORTNAME=3D check_smartmon > PORTVERSION=3D 20100318 > -PORTREVISION=3D 2 > +PORTREVISION=3D 3 > CATEGORIES=3D net-mgmt > MASTER_SITES=3D = http://ftp.bsdserwis.com/pub/FreeBSD/ports/distfiles/ > PKGNAMEPREFIX=3D nagios- >=20 > Modified: = head/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon = Mon Feb 18 15:01:50 2019 (r493265) > +++ head/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon = Mon Feb 18 15:08:46 2019 (r493266) > @@ -1,26 +1,42 @@ > ---- check_smartmon.orig 2015-07-22 17:32:58 UTC > -+++ check_smartmon > -@@ -59,7 +59,7 @@ def parseCmdLine(args): > - metavar=3D"LEVEL", help=3D"set verbosity = level to LEVEL; defaults to 0 (quiet), \ > - possible values go up to 3") > - parser.add_option("-t", "--type", action=3D"store", = dest=3D"devtype", default=3D"ata", metavar=3D"DEVTYPE", > -- help=3D"type of device (ATA|SCSI)") > -+ help=3D"type of device (ata|scsi)") > - parser.add_option("-w", "--warning-threshold", = metavar=3D"TEMP", action=3D"store", > - type=3D"int", dest=3D"warningThreshold", = default=3D55, > - help=3D"set temperature warning threshold to = given temperature (defaults to 55)") > -@@ -291,10 +291,10 @@ if __name__ =3D=3D "__main__": > +--- check_smartmon.orig 2019-02-01 04:28:13.000000000 +0000 > ++++ check_smartmon 2019-02-04 22:27:35.297345000 +0000 > +@@ -161,9 +161,12 @@=20 > + lines =3D healthMessage.split("\n") > + getNext =3D 0 > + for line in lines: > ++ vprint(3, "parseOutput: line is: '%s'" % = line) > + if getNext: > +- statusLine =3D line > +- break > ++ if line <> "SMART STATUS RETURN: = incomplete response, ATA output registers missing" and \ > ++ line <> "SMART Status not = supported: Incomplete response, ATA output registers missing" : > ++ statusLine =3D line > ++ break > + elif line =3D=3D "=3D=3D=3D START OF READ = SMART DATA SECTION =3D=3D=3D": > + getNext =3D 1 > + # fi > +@@ -181,7 +184,7 @@=20 > + parts =3D line.split() > + if len(parts): > + # 194 is the temperature value id > +- if parts[0] =3D=3D "194": > ++ if parts[0] =3D=3D "194" or parts[0] = =3D=3D "190": > + temperature =3D = int(parts[9]) > + break > + # fi > +@@ -225,6 +228,7 @@=20 > +=20 > + # this is absolutely critical! > + if healthStatus not in [ "PASSED", "OK" ]: > ++ vprint(2, "Health status: %s" % healthStatus) > + return (2, "CRITICAL: device does not pass health = status") > + # fi > +=20 > +@@ -287,6 +291,7 @@=20 > + # check device type, ATA is default > vprint(2, "Get device type") > devtype =3D options.devtype > ++ vprint(2, "command line supplied device type is: %s" % = devtype) > if not devtype: > -- devtype =3D "ATA" > -- > -- if device_re.search( device ): > -- devtype =3D "scsi" > -+ if device_re.search( device ): > -+ devtype =3D "scsi" > -+ else: > -+ devtype =3D "ata" > -=20 > - vprint(1, "Device type: %s" % devtype) > -=20 > + if device_re.search( device ): > + devtype =3D "scsi" > _______________________________________________ > svn-ports-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-ports-all > To unsubscribe, send any mail to = "svn-ports-all-unsubscribe@freebsd.org" =E2=80=94 Pierre Guinoiseau