Module: check_mk
Branch: master
Commit: 51cc5e0d1b33bd90ae8accdf6743839cfcdf8632
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=51cc5e0d1b33bd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 21 17:40:39 2011 +0100
use snmp commands always with -Ot
---
ChangeLog | 2 ++
modules/check_mk.py | 4 ++--
modules/snmp.py | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dbb55b8..6a42a02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@
* local.mk: This file is read after final.mk and *not* backup up
or restored
* read all files in conf.d/*.mk in alphabetical order now.
+ * use snmp commands always with -Ot: output time stamps as UNIX epoch
+ (thanks to Ulrich Kiermayr)
Checks & Agents:
* ucd_cpu_load: new check for CPU load via UCD SNMP agent
diff --git a/modules/check_mk.py b/modules/check_mk.py
index c3acd35..6685637 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -617,7 +617,7 @@ def get_single_oid(hostname, ipaddress, oid):
return None
command = snmp_get_command(hostname) + \
- " -On -OQ -Oe %s %s 2>/dev/null" % (ipaddress, oid)
+ " -On -OQ -Oe -Ot %s %s 2>/dev/null" % (ipaddress, oid)
try:
if opt_debug:
sys.stdout.write("Running '%s'\n" % command)
@@ -2710,7 +2710,7 @@ def do_snmpwalk_on(hostname, filename):
if opt_verbose:
sys.stdout.write("%s:\n" % hostname)
ip = lookup_ipaddress(hostname)
- cmd = snmp_walk_command(hostname) + " -On -Ob -OQ %s " % ip
+ cmd = snmp_walk_command(hostname) + " -On -Ob -OQ -Ot %s " % ip
if opt_debug:
print 'Executing: %s' % cmd
out = file(filename, "w")
diff --git a/modules/snmp.py b/modules/snmp.py
index 5ed920d..7ff3e74 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -113,7 +113,7 @@ def get_snmp_explicit(hostname, ipaddress, mib, baseoid, suffixes):
def snmpwalk_on_suboid(hostname, ip, oid):
command = snmp_walk_command(hostname) + \
- " -OQ -OU -On %s %s 2>/dev/null" % (ip, oid)
+ " -OQ -OU -On -Ot %s %s 2>/dev/null" % (ip, oid)
if opt_debug:
sys.stderr.write(' Running %s\n' % (command,))
snmp_process = os.popen(command, "r").xreadlines()