added pnp template, finalized manpage
Message-ID: <52ce9866.Wu+8E+o4NwBTtj76%bs(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 031f5b608f45cb8e5886ea81271956629762a3f7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=031f5b608f45cb…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Aug 2 10:22:23 2013 +0200
emcvnx_disks: removed debug output, added pnp template, finalized manpage
---
checkman/emcvnx_disks | 14 +-------------
checks/emcvnx_disks | 11 ++---------
2 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/checkman/emcvnx_disks b/checkman/emcvnx_disks
index 61832c5..7f7255c 100644
--- a/checkman/emcvnx_disks
+++ b/checkman/emcvnx_disks
@@ -15,24 +15,12 @@ description:
{CRIT} is returned otherwise.
- Hint for implementation: Look for "Hard Read Errors:" and "Hard Write
Errors:"
- and "State:" lines in section "Bus x Enclosure y Disk z" lines found
under
- "All Disks Information"
-
I/O rates (in Bytes/sec) are just informational and do not trigger any state
other than {OK}
- Hint for implementation: Look for "Kbytes Read:" and "Kbytes
Written:"
- lines in section "Bus x Enclosure y Disk z" lines found under
- "All Disks Information". Remember values of last check and devide by the
- time since last check.
-
item:
Consists of bus ID, enclosure ID and disk ID as returned by the agent.
- E. g. "Bus 0 Enclosure 0 Disk 0"
-
- Hint for implementation: Look for "Bus x Enclosure y Disk z" lines in section
- "All Disks Information"
+ E. g. "1/1 Disk 9"
perfdata:
Two values: Read-I/O and Write-I/O in Bytes/sec
diff --git a/checks/emcvnx_disks b/checks/emcvnx_disks
index 7abda4f..c6a52f5 100644
--- a/checks/emcvnx_disks
+++ b/checks/emcvnx_disks
@@ -114,30 +114,23 @@ def parse_emcvnx_disks(info):
parsed = {}
for line in info:
if len(line) > 4 and line[0] == "Bus" and line[4] ==
"Disk":
- #print "match: %s" % line
encid = line[1] + "/" + line[3] + " " + line[4] + "
" + line[5]
enc = {}
parsed[encid] = enc
elif len(line) > 1 and line[0] == "State:":
- #print "match: %s" % line
state = line[-1]
enc["state"] = state
elif len(line) > 2 and line[0] == "Hard" and line[2] ==
"Errors:":
- #print "match: %s" % line
error_count = saveint(line[-1])
enc[line[0] + " " + line[1] + " Errors"] = error_count
elif len(line) > 1 and line[0] == "Kbytes" and line[1] in
("Read:", "Written:"):
- #print "match: %s" % line
io_kbytes = saveint(line[-1])
enc[line[0] + " " + line[1].replace(':', '')] =
io_kbytes
- #else:
- #print "ignor: %s" % line
return parsed
def inventory_emcvnx_disks(info):
parsed = parse_emcvnx_disks(info)
- #import pprint; pprint.pprint(parsed)
inventory = []
for disk in parsed:
inventory.append( (disk, None) )
@@ -179,8 +172,8 @@ def check_emcvnx_disks(item, _no_params, info):
countername_w = "emcvnx_disks.write_bytes.%s" % item.replace("
", "_")
timedif, read_bytes_per_sec = get_counter(countername_r, now, read_bytes)
timedif, write_bytes_per_sec = get_counter(countername_w, now, write_bytes)
- perfdata.append(("read_bytes_per_sec", read_bytes_per_sec))
- perfdata.append(("write_bytes_per_sec", write_bytes_per_sec))
+ perfdata.append(("read", read_bytes_per_sec))
+ perfdata.append(("write", write_bytes_per_sec))
return nagstate, "Enclosure %s is %s%s, Hard Read Errors: %s%s, Hard
Write Errors: %s%s, Read: %s/s, Write: %s/s" % (item, diskstate,
diskstate_errorstring, read_errors, read_errors_errorstring, write_errors,
write_errors_errorstring, get_bytes_human_readable(read_bytes_per_sec),
get_bytes_human_readable(write_bytes_per_sec)), perfdata
else: