Module: check_mk
Branch: master
Commit: 9d219166765abb6507e982c1317eca2742e6e35a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d219166765abb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 19 15:10:51 2010 +0200
Using the real enclosure number as check item now.
The problem with the 'enclosure device id' which was used before is
being generated somehow. So on identical hardware with identical
raid setup the 'enclosure device ids' can be different. This is a
bad behaviour when hardcoding checks for a group of hosts in check_mk.
Instead of the 'enclosure device id' the 'enclosure number' is used now.
Which is also better to identify the enclosure hardware without having
a look at the configuration.
---
ChangeLog | 2 ++
agents/check_mk_agent.linux | 5 +++++
checks/megaraid_pdisks | 29 +++++++++++++++++++++++------
3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f2e9ed5..dd78e6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
1.1.9i1
+ Checks & Agents:
+ * megaraid_pdisks: Using the real enclosure number as check item now.
Multisite:
* The custom open/close states of custom links are now stored for each
user
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 40b92cc..4c8f63c 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -213,6 +213,11 @@ fi
# http://www.lsi.com/DistributionSystem/AssetDocument/support/downloads/megar…
if which MegaCli >/dev/null ; then
echo '<<<megaraid_pdisks>>>'
+ for part in $(MegaCli -EncInfo -aALL -NoLog < /dev/null | egrep 'Enclosure|Device ID'); do
+ [ $part == 'Enclosure' ] && echo -ne "\ndev2enc"
+ echo -n " ${part//:/}"
+ done
+ echo
MegaCli -PDList -aALL -NoLog < /dev/null | egrep 'Enclosure|Raw Size|Slot Number|Device Id|Firmware state|Inquiry'
echo '<<<megaraid_ldisks>>>'
MegaCli -LDInfo -Lall -aALL -NoLog < /dev/null | egrep 'Size|State|Number|Adapter|Virtual'
diff --git a/checks/megaraid_pdisks b/checks/megaraid_pdisks
index d327fca..fed9ca1 100644
--- a/checks/megaraid_pdisks
+++ b/checks/megaraid_pdisks
@@ -36,26 +36,43 @@
# Firmware state: Unconfigured(good)
# Inquiry Data: FUJITSU MBB2147RC 5204BS04P9104BSC
+# The agent provides some new information since 1.1.9.
+# The dev2enc infos are sent from the agent to have the
+# real enclosure numbers instead of the device ids which
+# seem to be generated somehow.
+#
+# dev2enc Enclosure 0 Device ID 6
+# dev2enc Enclosure 1 Device ID 252
+#
+# On new inventory runs the enclosure number is used as
+# index and item part.
+
def inventory_megaraid_pdisks(checkname, info):
inventory = []
+ dev2enc = {}
for line in info:
- if line[0] == "Enclosure":
- enclosure = int(line[-1])
+ if line[0] == "dev2enc":
+ dev2enc[line[5]] = 'e'+line[2]
+ elif line[0] == "Enclosure":
+ enclosure = dev2enc.get(line[-1], line[-1])
elif line[0] == "Slot":
slot = int(line[-1])
elif line[0] == "Firmware" and line[1] == "state:":
- inventory.append(( "%d/%d" % (enclosure, slot), "", repr(line[2]) ))
+ inventory.append(( "%s/%d" % (enclosure, slot), "", repr(line[2]) ))
return inventory
def check_megaraid_pdisks(item, target_state, info):
# item is "$ENCLOSURE/$SLOT"
# param is the target state
+ dev2enc = {}
for line in info:
- if line[0] == "Enclosure":
- enclosure = int(line[-1])
+ if line[0] == "dev2enc":
+ dev2enc[line[5]] = 'e'+line[2]
+ elif line[0] == "Enclosure":
+ enclosure = item.startswith('e') and dev2enc[line[-1]] or line[-1]
elif line[0] == "Slot":
slot = int(line[-1])
- found = "%d/%d" % (enclosure, slot) == item
+ found = "%s/%d" % (enclosure, slot) == item
elif found and line[0] == "Firmware" and line[1] == "state:":
state = line[2]
elif found and line[0] == "Inquiry" and line[1] == "Data:":
Module: check_mk
Branch: master
Commit: e7837026995ac805ec0b52302eb5fb2ae62884ab
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e7837026995ac8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 30 19:20:13 2010 +0200
Updated internal doku
---
LIESMICH.zutun | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index fdd2c41..06e0e9c 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -117,7 +117,7 @@ werden soll.
Perfdatenformat per Default auf 'pnp'
-Aggregation per Default auf mehrzeilige Ausgabe
+aggregation_output_format: Aggregation per Default auf mehrzeilige Ausgabe
Direct rrd updates ganz entfernen.
@@ -125,7 +125,7 @@ Inventurchecks: severity per Default auf 1 stellen.
snmp_communities: dictionary nicht mehr verwenden, aus Doku raus, Defaultwert
leere Liste, aus Code raus, Hinweis im ChangeLog. Evtl einen Test mit
-Abbruch, wenn immer noch type ist dict.
+Abbruch, wenn immer noch type ist dict. Gleiches für bulkwalk_hosts
[""] deprecaten, aus der Doku raus und durch ALL_SERVICES ersetzen
Module: check_mk
Branch: master
Commit: a661e2e24c7b10c17aa9a26e52452f50b54b574f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a661e2e24c7b10…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 29 14:17:00 2010 +0200
Updated internal doku
---
LIESMICH.zutun | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 587ebf2..fdd2c41 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -525,3 +525,11 @@ nicht ähnlich wie Gruppieren? Allerdings wäre es dann gut,
wenn man die Aggregationen irgendwo separat editieren kann
und in der View nur noch drauf verweisen. Sonst muss
man soviel Copy&Paste zwischen den Views machen...
+
+Idee: Checks, die eigentlich keine Perfdaten liefern, könnten
+über eine Konfiguration künstlich perfdaten bekommen, ala
+status=0, status=1 etc. Das könnte man über eine Regel
+konfigurierbar machen:
+fake_perfdata = [ ... ]
+
+Idee: Inventurcheck könnte gleich die Checkergebnisse berechnen
Module: check_mk
Branch: master
Commit: d8516abc6edfb3f16da8cb765691dc20aa797dd8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8516abc6edfb3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 29 19:23:24 2010 +0200
nfsmounts: fix output of used space
---
ChangeLog | 1 +
checkman/nfsmounts | 40 +++++++++++++++++++---------------------
checks/nfsmounts | 6 ++++--
3 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 64eb7ac..567f5b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* hp_proliant_psu: Fixed multiple PSU detection on one system (Thanks to Andreas Döhler)
* megaraid_pdisks: Fixed coding error
* cisco_fan: fixed check bug in case of critical state
+ * nfsmounts: fix output (free and used was swapped), make output identical to df
Livestatus:
* Prohibit { and } in regular expressions. This avoids a segmentation
diff --git a/checkman/nfsmounts b/checkman/nfsmounts
index 0f87c98..561d307 100644
--- a/checkman/nfsmounts
+++ b/checkman/nfsmounts
@@ -4,37 +4,35 @@ author: Mathias Kettner <mk(a)mathias-kettner.de>
license: GPL
distribution: check_mk
description:
- This check probes the availability of NFS mounts. The
- Linux agent sends the status of all NFS mounts, if the
- command line utility {maxwait} is available (it is
- is used to avoid hanging if the NFS server is not
- responding). The probe is done by trying a {stat -f}
- (system call {statfs(2)}) on the mount point. If that
- lasts longer then 2 seconds, then the server is considered
+ This check probes the availability of NFS mounts. The Linux agent sends the
+ status of all NFS mounts, if the command line utility {maxwait} is available
+ (it is is used to avoid hanging if the NFS server is not responding). The
+ probe is done by trying a {stat -f} (system call {statfs(2)}) on the mount
+ point. If that lasts longer then 2 seconds, then the server is considered
to be not responding.
- When you install the Linux agent manually, please
- do not forget to also install {waitmax} into {/usr/bin}.
- That file is shipped together with the agent. When
- {waitmax} is missing, the agent will silently omit
- the section {nfsmounts}.
+ When you install the Linux agent manually, please do not forget to also
+ install {waitmax} into {/usr/bin}. That file is shipped together with
+ the agent. When {waitmax} is missing, the agent will silently omit the
+ section {nfsmounts}.
- If the NFS mount is "stale", then {stat -f} returns immediately
- but with a size of {-1}. The check detects that and results
- in a warning state.
+ If the NFS mount is "stale", then {stat -f} returns immediately but with
+ a size of {-1}. The check detects that and results in a warning state.
+
+ Please note, that though this check outputs the current usage of the remote
+ filesystem, no levels can be defined for the used space and no performance
+ data is output. Please do a check for used space directly on the NFS server.
item:
The mount point.
perfdata:
- This check does not provide performance data. The disk
- usage is assumedly measured on the file server itself.
- Duplicating that data on all clients would unneccessarily
- create redundant RRDs.
+ This check does not provide performance data. The disk usage is assumedly
+ measured on the file server itself. Duplicating that data on all clients
+ would unneccessarily create redundant RRDs.
inventory:
- All NFS mounts are found automatically. This is not
+ All NFS mounts are found automatically. This is done
by scanning {/proc/mounts}. The file {/etc/fstab}
is irrelevant.
-
diff --git a/checks/nfsmounts b/checks/nfsmounts
index 97fd749..ed73e04 100644
--- a/checks/nfsmounts
+++ b/checks/nfsmounts
@@ -41,9 +41,11 @@ def check_nfsmounts(item, params, info):
gb = 1024 * 1024 * 1024.0
size_gb = (size_blocks * blocksize) / gb
- used_gb = (free_blocks * blocksize) / gb
+ free_gb = (free_blocks * blocksize) / gb
+ used_gb = size_gb - free_gb
+ used_perc = 100.0 * used_gb / size_gb
if line[1] == 'ok':
- return (0, "OK - server responding (%.2f GB / %.2f GB used)" % (used_gb, size_gb))
+ return (0, "OK - %.1f%% used (%.1f of %.1f GB)" % (used_perc, used_gb, size_gb))
else:
return (2, "CRITICAL - server not responding")
return (3, "UNKNOWN - not mounted")