Module: check_mk
Branch: master
Commit: f6bef77bb2389a1f4f058179cf3eeff863f1504e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f6bef77bb2389a…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Nov 7 13:02:09 2013 +0100
Missing git add cause of werk...
---
checkman/apc_ats | 14 +++++++
checks/apc_ats_status | 99 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+)
diff --git a/checkman/apc_ats b/checkman/apc_ats
new file mode 100644
index 0000000..0f640af
--- /dev/null
+++ b/checkman/apc_ats
@@ -0,0 +1,14 @@
+title: APC ATS ( Automatic Transfer Swichtes )
+agents: snmp
+catalog: hw/power
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of APC Automatic Transfer Switch.
+ This means it throws {CRIT} if:
+ The power source has changed since last inventory,
+ the communication status gets lost,
+ the redundancy is lost,
+ the current ouput power exceeded the maximum limit for swiching to the alternate power source
+ or the 5V or 24V supply fails
+
diff --git a/checks/apc_ats_status b/checks/apc_ats_status
new file mode 100644
index 0000000..7681472
--- /dev/null
+++ b/checks/apc_ats_status
@@ -0,0 +1,99 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+def inventory_apc_ats_status(info):
+ if len(info) == 1:
+ return [ (None, saveint(info[0][1]) ) ]
+ return []
+
+def check_apc_ats_status(_no_item, source, info):
+ comstatus, selected_source, redundancy, overcurrent, ps5, ps24 = map(saveint, info[0])
+ state = 0
+ messages = []
+
+ #current source of power
+ sources = { 1 : "A", 2 : "B" }
+ if source != selected_source:
+ state = 2
+ messages.append("Power source Changed from %s to %s(!!)" % \
+ (source[source], sources[selected_source]))
+ else:
+ messages.append("Power source %s selected" % sources[source])
+
+ #current communication status of the Automatic Transfer Switch.
+ if comstatus == 1:
+ state = max(1,state)
+ messages.append("Communication Status: never Discovered(!)")
+ elif comstatus == 3:
+ state = 2
+ messages.append("Communication Status: lost(!!)")
+
+ # current redundancy state of the ATS.
+ # Lost(1) indicates that the ATS is unable to switch over to the alternate power source
+ # if the current source fails. Redundant(2) indicates that the ATS will switch
+ # over to the alternate power source if the current source fails.
+ if redundancy != 2:
+ state = 2
+ messages.append("redundancy lost(!!)")
+ else:
+ messages.append("Device fully redundant")
+
+ # current state of the ATS. atsOverCurrent(1) indicates that the ATS has i
+ # exceeded the output current threshold and will not allow a switch
+ # over to the alternate power source if the current source fails.
+ # atsCurrentOK(2) indicates that the output current is below the output current threshold.
+ if overcurrent == 1:
+ state = 2
+ messages.append("exceedet ouput current threshold(!!)")
+
+ # 5Volt power supply
+ if ps5 != 2:
+ state = 2
+ messages.append("5V power supply failed(!!)")
+
+ # 24Volt power supply
+ if ps24 != 2:
+ state = 2
+ messages.append("24V power suppy failed(!!)")
+
+ return state, ", ".join(messages)
+
+check_info["apc_ats_status"] = {
+ "check_function" : check_apc_ats_status,
+ "inventory_function" : inventory_apc_ats_status,
+ "service_description" : "apc_ats_status",
+ "has_perfdata" : False,
+ "snmp_scan_function" : lambda oid: ".1.3.6.1.4.1.318.1.3.11" in oid(".1.3.6.1.2.1.1.2.0"),
+ "snmp_info" : ( ".1.3.6.1.4.1.318.1.1.8.5.1", [
+ "1.0", # atsStatusCommStatus
+ "2.0", # atsStatusSelectedSource
+ "3.0", # atsStatusRedundancyState
+ "4.0", # atsStatusOverCurrentState
+ "5.0", # atsStatus5VPowerSupply
+ "6.0", # atsStatus24VPowerSupply
+ ] ),
+}
+
Module: check_mk
Branch: master
Commit: 576461a1c9abadc1a2ecfd6eb0fc2c0cedc0ecba
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=576461a1c9abad…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Nov 7 10:46:47 2013 +0100
Updated bug entries #0945
---
.bugs/945 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/945 b/.bugs/945
new file mode 100644
index 0000000..605a6db
--- /dev/null
+++ b/.bugs/945
@@ -0,0 +1,10 @@
+Title: windows_agent: processing of eventlog messages is time consuming
+Component: checks
+State: open
+Date: 2013-11-07 10:42:10
+Targetversion: future
+Class: nastiness
+
+To resolve the text from an eventlog entry the windows agent opens
+the corresponding dll file and reads the text for the given event id.
+It seems that for each line the dll is opened again by LoadLibrary()
Module: check_mk
Branch: master
Commit: b3597d8071061f494e38182d432d10a7457bfabd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3597d8071061f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 7 08:52:52 2013 +0100
Removed fritz.uptime check and moved the value to the connection check
---
checkman/fritz.uptime | 28 ----------------------------
checks/fritz | 33 +++++++++------------------------
2 files changed, 9 insertions(+), 52 deletions(-)
diff --git a/checkman/fritz.uptime b/checkman/fritz.uptime
deleted file mode 100644
index 5b7e0ae..0000000
--- a/checkman/fritz.uptime
+++ /dev/null
@@ -1,28 +0,0 @@
-title: Uptime of Fritz!Box
-agents: fritzbox
-catalog: hw/network/avm
-license: GPL
-distribution: check_mk
-description:
- This check is always OK and simply outputs the uptime of the target
- Fritz!Box device (when the last boot was and how much time has elapsed since).
-
- The check uses data provided by the fritzbox special agent. You need to
- configure this agent to be used for the Fritz!Box you like to monitor. The
- special agent uses uPnP to get the needed information from the device.
-
-perfdata:
- The uptime in seconds.
-
-inventory:
- One check per system is created if the agent has a section {<<<fritz>>>} and
- the key {NewUptime} in this section.
-
-[parameters]
-parameters (dict): A dictionary with the following optional keys:
-
- {"min"}: Pair of integers of warn and crit: the minimum required uptime
- uptime in seconds.
-
- {"max"}: Pair of integers of warn and crit: the maximum allowed uptime
- uptime in seconds.
diff --git a/checks/fritz b/checks/fritz
index 2793506..812d519 100644
--- a/checks/fritz
+++ b/checks/fritz
@@ -60,13 +60,20 @@ def check_fritz_conn(_unused, _no_params, info):
if last_err and last_err != 'ERROR_NONE':
output += ', Last Error: %s' % last_err
- return nag_state, output
+ perfdata = []
+ if data.get('NewUptime'):
+ conn_time = check_uptime_seconds({}, float(data['NewUptime']))
+ output += ', %s' % conn_time[1]
+ perfdata = conn_time[2]
+
+ return nag_state, output, perfdata
check_info['fritz.conn'] = {
"inventory_function" : inventory_fritz_conn,
"check_function" : check_fritz_conn,
"service_description" : "Connection",
- "has_perfdata" : False,
+ "includes" : [ "uptime.include" ],
+ "has_perfdata" : True,
}
@@ -106,28 +113,6 @@ check_info['fritz.config'] = {
}
#
-# Uptime
-#
-
-def inventory_fritz_uptime(info):
- data = fritz_parse_info(info)
- if 'NewUptime' in data:
- return [ (None, {}) ]
-
-def check_fritz_uptime(_no_item, params, info):
- data = fritz_parse_info(info)
- return check_uptime_seconds(params, float(data['NewUptime']))
-
-check_info["fritz.uptime"] = {
- 'check_function': check_fritz_uptime,
- 'inventory_function': inventory_fritz_uptime,
- 'service_description': 'Uptime',
- 'has_perfdata': True,
- 'includes': [ 'uptime.include' ],
- 'group': 'uptime',
-}
-
-#
# WAN Interface Check
#
Module: check_mk
Branch: master
Commit: 5a302fb476ce3b577b1ea3e07bbacd0be0507ded
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5a302fb476ce3b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Nov 6 18:54:37 2013 +0100
Add new collection of checks to monitor Fritz!Box devices
This feature introduces a special agent, which uses the uPnP API of Fritz!Box
routers to retrieve several monitoring information, like the current connection
state, bandwith, update and several other things.
New checks are:
<table>
<tr><td class=tt>fritz.conn</td><td>Connection State / Info</td></tr>
<tr><td class=tt>fritz.config</td><td>Internet Connection related config.</td></tr>
<tr><td class=tt>fritz.uptime</td><td>Device Uptime</td></tr>
<tr><td class=tt>fritz.wan_if</td><td>Traffic of the WAN network interface</td></tr>
<tr><td class=tt>fritz.link</td><td>Network Link State / Info</td></tr>
</table>
---
.werks/47 | 21 +++++++++++----------
ChangeLog | 2 +-
agents/.f12 | 2 ++
agents/special/.f12 | 2 ++
4 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/.werks/47 b/.werks/47
index b3a3073..f41b6cd 100644
--- a/.werks/47
+++ b/.werks/47
@@ -1,19 +1,20 @@
-Title: Add new collection of check to monitor Fritz!Box devices
+Title: Add new collection of checks to monitor Fritz!Box devices
Level: 1
Component: checks
Version: 1.2.3i7
Date: 1383759137
Class: feature
-This feature introduces a special agent, which uses the uPnP API
-of Fritz!Box routers to retrieve several monitoring information,
-like the current connection state, bandwith, update and several
-other things.
+This feature introduces a special agent, which uses the uPnP API of Fritz!Box
+routers to retrieve several monitoring information, like the current connection
+state, bandwith, update and several other things.
New checks are:
-fritz.conn - Connection State / Info
-fritz.config - Internet Connection related config
-fritz.uptime - Device Uptime
-fritz.wan_if - Traffic of the WAN network interface
-fritz.link - Network Link State / Info
+<table>
+<tr><td class=tt>fritz.conn</td><td>Connection State / Info</td></tr>
+<tr><td class=tt>fritz.config</td><td>Internet Connection related config.</td></tr>
+<tr><td class=tt>fritz.uptime</td><td>Device Uptime</td></tr>
+<tr><td class=tt>fritz.wan_if</td><td>Traffic of the WAN network interface</td></tr>
+<tr><td class=tt>fritz.link</td><td>Network Link State / Info</td></tr>
+</table>
diff --git a/ChangeLog b/ChangeLog
index a7515cd..42fffe9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,7 +4,7 @@
* 0061 cisco_cpu: check now recognizes new object cpmCPUTotal5minRev...
* 0063 veeam_client: new check to monitor status of veeam clients with special agent plugin...
* 0064 veeam_jobs: new check to monitor the backup jobs of the veeam backup tool...
- * 0047 Add new collection of check to monitor Fritz!Box devices...
+ * 0047 Add new collection of checks to monitor Fritz!Box devices...
* 0024 FIX: cisco_wlc: removed configuration parameter ap_model...
Multisite:
diff --git a/agents/.f12 b/agents/.f12
index f46aa52..7bac9e0 100644
--- a/agents/.f12
+++ b/agents/.f12
@@ -1,3 +1,5 @@
+#!/bin/bash
+SITE=${SITE:-$(cat ../.site 2>/dev/null || true)}
SITE=${SITE:-$(omd sites --bare | head -n 1)}
sudo cp -r * /omd/sites/$SITE/share/check_mk/agents/
if [ -e /etc/check_mk ]
diff --git a/agents/special/.f12 b/agents/special/.f12
index ef2e2a3..84ed3ba 100644
--- a/agents/special/.f12
+++ b/agents/special/.f12
@@ -1,2 +1,4 @@
+#!/bin/bash
+SITE=${SITE:-$(cat ../../.site 2>/dev/null || true)}
SITE=${SITE:-$(omd sites --bare | head -n 1)}
sudo cp -r * /omd/sites/$SITE/share/check_mk/agents/special