diff options
author | dvl <dvl@FreeBSD.org> | 2015-07-23 23:59:13 +0800 |
---|---|---|
committer | dvl <dvl@FreeBSD.org> | 2015-07-23 23:59:13 +0800 |
commit | f2c1d170d49264ea26b8105e7c162fa5415d0312 (patch) | |
tree | 4339595600f565d86007ede07fa08446b1243e65 /net-mgmt/nagios-check_smartmon | |
parent | 4633a9618630db551ea35e73df072d03829470ee (diff) | |
download | freebsd-ports-gnome-f2c1d170d49264ea26b8105e7c162fa5415d0312.tar.gz freebsd-ports-gnome-f2c1d170d49264ea26b8105e7c162fa5415d0312.tar.zst freebsd-ports-gnome-f2c1d170d49264ea26b8105e7c162fa5415d0312.zip |
Allow check_smartmon to work with da* devices
PR: ports/201767
Approved by: Krzysztof (maintainer), X (mat)
Diffstat (limited to 'net-mgmt/nagios-check_smartmon')
-rw-r--r-- | net-mgmt/nagios-check_smartmon/Makefile | 2 | ||||
-rw-r--r-- | net-mgmt/nagios-check_smartmon/files/patch-check_smartmon | 42 |
2 files changed, 25 insertions, 19 deletions
diff --git a/net-mgmt/nagios-check_smartmon/Makefile b/net-mgmt/nagios-check_smartmon/Makefile index 85a0509ae93a..419809df397d 100644 --- a/net-mgmt/nagios-check_smartmon/Makefile +++ b/net-mgmt/nagios-check_smartmon/Makefile @@ -3,7 +3,7 @@ PORTNAME= check_smartmon PORTVERSION= 20100318 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt MASTER_SITES= http://nognu.de/s/FreeBSD/distfiles/ PKGNAMEPREFIX= nagios- diff --git a/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon b/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon index 11fb9037f299..1e584a9fe0e0 100644 --- a/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon +++ b/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon @@ -1,20 +1,26 @@ ---- ./check_smartmon.orig 2010-03-18 18:56:53.000000000 +0100 -+++ ./check_smartmon 2010-04-23 22:53:13.000000000 +0200 -@@ -229,11 +229,14 @@ - # fi +--- check_smartmon.orig 2015-07-22 17:32:58 UTC ++++ check_smartmon +@@ -59,7 +59,7 @@ def parseCmdLine(args): + 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)") +@@ -291,10 +291,10 @@ if __name__ == "__main__": + vprint(2, "Get device type") + devtype = options.devtype + if not devtype: +- devtype = "ATA" +- +- if device_re.search( device ): +- devtype = "scsi" ++ if device_re.search( device ): ++ devtype = "scsi" ++ else: ++ devtype = "ata" - if temperature > criticalThreshold: -- return (2, "CRITICAL: device temperature (%d) exceeds critical temperature threshold (%s)" % (temperature, criticalThreshold)) -+ return (2, "CRITICAL: device temperature (%d) exceeds critical temperature threshold (%s)|TEMP=%d;%d;%d;" -+ % (temperature, criticalThreshold, temperature, warningThreshold, criticalThreshold)) - elif temperature > warningThreshold: -- return (1, "WARNING: device temperature (%d) exceeds warning temperature threshold (%s)" % (temperature, warningThreshold)) -+ return (1, "WARNING: device temperature (%d) exceeds warning temperature threshold (%s)|TEMP=%d;%d;%d;" -+ % (temperature, warningThreshold, temperature, warningThreshold, criticalThreshold)) - else: -- return (0, "OK: device is functional and stable (temperature: %d)" % temperature) -+ return (0, "OK: device is functional and stable (temperature: %d)|TEMP=%d;%d;%d;" -+ % (temperature, temperature, warningThreshold, criticalThreshold)) - # fi - # end + vprint(1, "Device type: %s" % devtype) |