Module: check_mk
Branch: master
Commit: 077b659c53e9a8c438282ed7aa1abf83f7bb576c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=077b659c53e9a8…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Nov 25 19:59:26 2013 +0100
preliminary versions of two new cisco checks
---
checks/cisco_fru_power | 102 ++++++++++++++++++++++++++++++++++++++++++++++++
checks/cisco_sys_mem | 62 +++++++++++++++++++++++++++++
2 files changed, 164 insertions(+)
diff --git a/checks/cisco_fru_power b/checks/cisco_fru_power
new file mode 100644
index 0000000..33b9ba6
--- /dev/null
+++ b/checks/cisco_fru_power
@@ -0,0 +1,102 @@
+#!/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.
+
+# .1.3.6.1.4.1.9.9.13.1.5.1.2.1 "removed"
+# .1.3.6.1.4.1.9.9.13.1.5.1.2.2 "AC Power Supply"
+# .1.3.6.1.4.1.9.9.13.1.5.1.3.1 5
+# .1.3.6.1.4.1.9.9.13.1.5.1.3.2 1
+# .1.3.6.1.4.1.9.9.13.1.5.1.4.1 1
+# .1.3.6.1.4.1.9.9.13.1.5.1.4.2 2
+
+# OID 1.3.6.1.4.1.9.9.117.1.1.2.1.2
+# Type PowerOperType
+# 1:offEnvOther
+# 2:on
+# 3:offAdmin
+# 4:offDenied
+# 5:offEnvPower
+# 6:offEnvTemp
+# 7:offEnvFan
+# 8:failed
+# 9:onButFanFail
+# 10:offCooling
+# 11:offConnectorRating
+# 12:onButInlinePowerFail
+#
+# OID 1.3.6.1.4.1.9.9.117.1.1.2.1.1
+# Type PowerAdminType
+# 1:on
+# 2:off
+# 3:inlineAuto
+# 4:inlineOn
+# 5:powerCycle
+#
+
+power_oper_type = ('', 'offEnvOther', 'on', 'offAdmin', 'offDenied',
+ 'offEnvPower', 'offEnvTemp', 'offEnvFan', 'failed',
+ 'onButFanFail', 'offCooling', 'offConnectorRating',
+ 'onButInlinePowerFail' )
+
+power_admin_type = ( '', 'on', 'off', 'inlineAuto', 'inlineOn', 'powercycle')
+
+def inventory_cisco_fru_power(info):
+ return [ (line[0], None ) for line in info ]
+
+def check_cisco_fru_power(item, params, info):
+ for line in info:
+ if line[0] == item:
+ admin_state, oper_state = map(saveint, line[1:3])
+ output = 'Admin-State: %s, Oper-State: %s' % (power_admin_type[admin_state],
+ power_oper_type[oper_state])
+ admin_sym = ""
+ oper_sym = ""
+ if admin_state == 1 and oper_state == 2:
+ state = 0
+ elif admin_state == 2 or oper_state in ( 4,5,6,7,8,12):
+ state = 2
+ if admin_state == 2:
+ admin_sym = "(!!)"
+ if oper_state in ( 4,5,6,7,8,12):
+ oper_sym = "(!!)"
+ else:
+ state = 1
+ if admin_state not in (1,2):
+ admin_sym = "(!)"
+ if oper_state not in (2,4,5,6,7,8,12):
+ oper_sym = "(!)"
+ return (state, "Admin-State: %s%s, Oper-State: %s%s" % \
+ (power_admin_type[admin_state],admin_sym,power_oper_type[oper_state],oper_sym))
+
+ return (3, "item not found in snmp data")
+
+check_info["cisco_fru_power"] = {
+ 'check_function': check_cisco_fru_power,
+ 'inventory_function': inventory_cisco_fru_power,
+ 'service_description': 'FRU Power %s',
+ 'snmp_info': ('.1.3.6.1.4.1.9.9.117.1.1.2.1', [ OID_END, '1', '2'] ),
+ 'snmp_scan_function': \
+ lambda oid: "cisco" in oid(".1.3.6.1.2.1.1.1.0").lower(),
+}
diff --git a/checks/cisco_sys_mem b/checks/cisco_sys_mem
new file mode 100644
index 0000000..e202981
--- /dev/null
+++ b/checks/cisco_sys_mem
@@ -0,0 +1,62 @@
+#!/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.
+
+# cseSysMemoryUtilization .1.3.6.1.4.1.9.9.305.1.1.2.0
+#
+
+cisco_mem_default_levels = (80.0, 90.0)
+
+def inventory_cisco_sys_mem(info):
+ if info:
+ return [ (None, "cisco_mem_default_levels") ]
+ else:
+ return (3, "no snmp data found")
+
+def check_cisco_sys_mem(item, params, info):
+ warn, crit = params
+ if info[0][0]:
+ mem_used = float(info[0][0])
+ perfdata = [("mem_used", mem_used, warn, crit, 0, 100)]
+ infotext = "%2.1f%% of supervisor memory used" % mem_used
+ if type(warn) == int or type(crit) == int:
+ return (3, infotext + "no limits applied, must be given in precent", perfdata)
+ if mem_used >= crit:
+ return (2, infotext + " (critical at %2.1f%% MB)" % crit, perfdata)
+ elif mem_used >= warn:
+ return (1, infotext + " (warning at %2.1f%% MB)" % warn, perfdata)
+ else:
+ return (0, infotext, perfdata)
+
+
+check_info["cisco_sys_mem"] = {
+ "check_function" : check_cisco_sys_mem,
+ "inventory_function" : inventory_cisco_sys_mem,
+ "service_description" : "Supervisor Mem Used",
+ "has_perfdata" : True,
+ "group" : "cisco_sys_mem",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.9.9.305.1.1.2.0"),
+ "snmp_info" : ( ".1.3.6.1.4.1.9.9.305.1.1.2", "0" ),
+}
Module: check_mk
Branch: master
Commit: d4152fea96673809962d7888c566c5339bcc8d6d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d4152fea966738…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 25 10:37:21 2013 +0100
Updated bug entries #1085
---
.bugs/1085 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/1085 b/.bugs/1085
new file mode 100644
index 0000000..0890761
--- /dev/null
+++ b/.bugs/1085
@@ -0,0 +1,9 @@
+Title: Personal settings: name of language de missing
+Component: multisite
+State: open
+Date: 2013-11-25 10:36:27
+Targetversion: future
+Class: nastiness
+
+In the personal setting when you want to select a language,
+instead of "German" there is just a "de".
Module: check_mk
Branch: master
Commit: 08f8e95eb51be04bd91e3ebcf61301f501546e2d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08f8e95eb51be0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 25 09:26:43 2013 +0100
FIX Fixed bookmarking of absolute URLs or PNP/NagVis URLs in sidebar snapin
In previous versions, the URLs not pointing to multisite pages, bookmarked with
the sidebar snapin, could not be used, as they pointed to non existing URLs. This
was caused by th URL shortening algorithm used within the bookmark snapin.
---
.werks/285 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/sidebar.py | 41 ++++++++++++++++++++++++++++++++---------
3 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/.werks/285 b/.werks/285
new file mode 100644
index 0000000..b854415
--- /dev/null
+++ b/.werks/285
@@ -0,0 +1,10 @@
+Title: Fixed bookmarking of absolute URLs or PNP/NagVis URLs in sidebar snapin
+Level: 1
+Component: multisite
+Version: 1.2.3i7
+Date: 1385367764
+Class: fix
+
+In previous versions, the URLs not pointing to multisite pages, bookmarked with
+the sidebar snapin, could not be used, as they pointed to non existing URLs. This
+was caused by th URL shortening algorithm used within the bookmark snapin.
diff --git a/ChangeLog b/ChangeLog
index 8a77f1c..2a31f2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@
* 0035 FIX: http[s] links are display again in the plugin output...
* 0006 FIX: Checkboxes for hosts/services were missing on modified views...
* 0284 FIX: Context help toggled on/off randomly...
+ * 0285 FIX: Fixed bookmarking of absolute URLs or PNP/NagVis URLs in sidebar snapin...
WATO:
* 0053 New rule for configuring the display_name of a service...
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 151bb9e..3283123 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
import config, defaults, livestatus, views, pprint, os, copy, userdb
-import notify
+import notify, urlparse
from lib import *
# Constants to be used in snapins
@@ -562,16 +562,39 @@ def ajax_add_bookmark():
href = html.var("href")
if title and href:
bookmarks = load_bookmarks()
- # We try to remove http://hostname/some/path/check_mk from the
- # URI. That keeps the configuration files (bookmarks) portable.
- # Problem here: We have not access to our own URL, only to the
- # path part. The trick: we use the Referrer-field from our
- # request. That points to the sidebar.
referer = html.req.headers_in.get("Referer")
+
if referer:
- while '/' in referer and referer.split('/')[0] == href.split('/')[0]:
- referer = referer.split('/', 1)[1]
- href = href.split('/', 1)[1]
+ ref_p = urlparse.urlsplit(referer)
+ url_p = urlparse.urlsplit(href)
+
+ # If http/https or user, pw, host, port differ, don't try to shorten
+ # the URL to be linked. Simply use the full URI
+ if ref_p.scheme == url_p.scheme and ref_p.netloc == url_p.netloc:
+ # We try to remove http://hostname/some/path/check_mk from the
+ # URI. That keeps the configuration files (bookmarks) portable.
+ # Problem here: We have not access to our own URL, only to the
+ # path part. The trick: we use the Referrer-field from our
+ # request. That points to the sidebar.
+ referer = ref_p.path
+ href = url_p.path
+ if url_p.query:
+ href += '?' + url_p.query
+ removed = 0
+ while '/' in referer and referer.split('/')[0] == href.split('/')[0]:
+ referer = referer.split('/', 1)[1]
+ href = href.split('/', 1)[1]
+ removed += 1
+
+ if removed == 1:
+ # removed only the first "/". This should be an absolute path.
+ href = '/' + href
+ elif '/' in referer:
+ # there is at least one other directory layer in the path, make
+ # the link relative to the sidebar.py's topdir. e.g. for pnp
+ # links in OMD setups
+ href = '../' + href
+
bookmarks.append((title, href))
save_bookmarks(bookmarks)
render_bookmarks()
Module: check_mk
Branch: master
Commit: 843dd71342d39e0ca521de2e743820d2ed063356
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=843dd71342d39e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 22 10:00:21 2013 +0100
FIX Fixed missing entries in log file and availability view
This problem occurred for example when you first visited the
global logfile and afterwards used the availability reporting.
This problem was due a bug in livestatus that affected the tables <tt>log</tt>
and <tt>statehist</tt>. Two consecutive logfile queries, each with different
logclasses, could lead to invalid/missing logfile entries.
---
.werks/233 | 2 +-
ChangeLog | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.werks/233 b/.werks/233
index 8180fc9..7de204b 100644
--- a/.werks/233
+++ b/.werks/233
@@ -1,4 +1,4 @@
-Title: Fixed missing entries in log file or availability view
+Title: Fixed missing entries in log file and availability view
Level: 2
Component: livestatus
Version: 1.2.3i7
diff --git a/ChangeLog b/ChangeLog
index 511b9a3..0ed7a20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,7 +83,7 @@
* 0067 livedump: new option to mark the mode at the beginning of the dump and documentation fixes...
* 0023 FIX: table statehist: code cleanup / minor performance improvements
* 0034 FIX: table statehist: no more missing entries if only one logfile exists
- * 0233 FIX: Fixed missing entries in log file or availability view...
+ * 0233 FIX: Fixed missing entries in log file and availability view...
1.2.3i6:
Module: check_mk
Branch: master
Commit: db2b645c8c080de0fb7213e8550095cba7760079
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db2b645c8c080d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 22 11:16:54 2013 +0100
fritz.conn fritz.config fritz.uptime fritz.wan_if fritz.link: New checks for monitoring 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 | 2 +-
ChangeLog | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.werks/47 b/.werks/47
index f41b6cd..5384c74 100644
--- a/.werks/47
+++ b/.werks/47
@@ -1,4 +1,4 @@
-Title: Add new collection of checks to monitor Fritz!Box devices
+Title: fritz.conn fritz.config fritz.uptime fritz.wan_if fritz.link: New checks for monitoring Fritz!Box devices
Level: 1
Component: checks
Version: 1.2.3i7
diff --git a/ChangeLog b/ChangeLog
index 1b77bf6..2b53347 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,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 checks to monitor Fritz!Box devices...
+ * 0047 fritz.conn fritz.config fritz.uptime fritz.wan_if fritz.link: New checks for monitoring Fritz!Box devices...
* 0027 esx_vsphere_sensors: it is now possible override the state of sensors
* 0090 apc_ats_status: New Check for monitoring APC Automatic Transfer Switches
* 0080 Added new checks for Brocade NetIron MLX switching / routing devices...