From owner-svn-ports-all@freebsd.org Fri Mar 8 18:42:33 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 43B0115258D3; Fri, 8 Mar 2019 18:42:33 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from clavin1.langille.org (clavin1.langille.org [162.208.116.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "clavin.langille.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB5E78631D; Fri, 8 Mar 2019 18:42:32 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from (clavin1.int.langille.org (clavin1.int.unixathome.org [10.4.7.7]) (Authenticated sender: hidden) with ESMTPSA id 8E94016DEB ; Fri, 8 Mar 2019 18:42:29 +0000 (UTC) From: Dan Langille Message-Id: <758AABED-4D5F-421C-9EB4-C5AFE8E1197D@FreeBSD.org> 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 Date: Fri, 8 Mar 2019 13:42:29 -0500 In-Reply-To: <98AC5D57-E207-47EE-A06E-560CB3724C13@FreeBSD.org> Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org To: Pierre Guinoiseau References: <201902181508.x1IF8lhS049907@repo.freebsd.org> <7563B519-9277-4AEC-A1C1-FED1B469C3D7@guinoiseau.nz> <98AC5D57-E207-47EE-A06E-560CB3724C13@FreeBSD.org> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: AB5E78631D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.92)[-0.917,0]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; ASN(0.00)[asn:11403, ipnet:162.208.116.0/22, country:US] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Fri, 08 Mar 2019 18:42:33 -0000 Pierre, Will you have some time to test this patch and verify it is good for = you? I've been running it on a few servers. --=20 Dan Langille - BSDCan / PGCon dan@langille.org > On Mar 4, 2019, at 3:12 PM, Dan Langille wrote: >=20 > Hello, >=20 > I was searching for this a few days ago. =20 >=20 > Please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236227 = >=20 > --=20 > Dan Langille - BSDCan / PGCon > dan@langille.org >=20 >=20 >> On Feb 21, 2019, at 4:33 PM, Pierre Guinoiseau > wrote: >>=20 >> Hi, >>=20 >> I=E2=80=99m getting this error now after this change: >>=20 >> 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 >>=20 >> Cheers, >> Pierre >>=20 >>> 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" >>=20 >> =E2=80=94 >> Pierre Guinoiseau > >>=20 >=20