check manpage added
Message-ID: <526683fb.tgPlFxB8Xdj4/JeI%gg(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Module: check_mk
Branch: master
Commit: fa48fdbcbac79f31e258ac25ab53d5c4618597b2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa48fdbcbac79f…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Oct 22 15:55:24 2013 +0200
improvements to genuscreen carp check, check manpage added
---
checkman/genua_carp | 29 +++++++++++++++++
checks/genua_carp | 87 ++++++++++++++++++++++-----------------------------
2 files changed, 66 insertions(+), 50 deletions(-)
diff --git a/checkman/genua_carp b/checkman/genua_carp
new file mode 100644
index 0000000..38f418f
--- /dev/null
+++ b/checkman/genua_carp
@@ -0,0 +1,29 @@
+title: State of carp interfaces on carp clusters and nodes of genuscreen devices
+agents: snmp
+catalog: hw/network/genua
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of the carp interfaces of genuscreen devices.
+ It can be used on single hosts as well as clusters. For the latter, the nodes of
+ the carp cluster must be included in a Check_MK cluster, and the check must be configured as
+ clustered service with an approriate rule. Clusters with more then two nodes are
+ supported.
+ The check detects if it is called on a cluster or a node. For a node the
+ interface and carp state of the carp interface items are checked.
+ For a cluster the check determines the number of carp interfaces on the cluster with
+ the state master. If it is either {0} or {>1} the check is critical.
+
+ The check is known to run with genuscreen version 3.0, others may also work.
+
+perfdata:
+ None
+
+inventory:
+ The inventory process checks if the device has a system description OIDs (.1.3.6.1.2.1.1.2.0)
+ and if the name of this OID contains "genuscreen" (case insensitive).
+ If this is true the system is inventorized.
+
+item:
+ The name of the carp interfaces
+
diff --git a/checks/genua_carp b/checks/genua_carp
index 9cc97ae..f84faa4 100644
--- a/checks/genua_carp
+++ b/checks/genua_carp
@@ -40,7 +40,6 @@
def inventory_genua_carp(info):
-
inventory = []
if info[0]:
@@ -88,19 +87,24 @@ def check_genua_carp(item, _no_params, info):
if not info[0]:
return(3, "Invalid Output from Agent")
state = 0
- nodes = 0
+ nodes = len(info)
masters = 0
+ if nodes > 1:
+ prefix = "Cluster test: "
+ else:
+ prefix = "Node test: "
# Loop over all nodes, just one line if not a cluster
for line in info:
- nodes += 1
# Loop over interfaces on node
for ifIndex, ifName, ifType, ifLinkState, ifCarpState in line:
ifTypeStr = genua_iftype(str(ifType))
ifLinkStateStr = genua_linkstate(str(ifLinkState))
ifCarpStateStr = genua_carpstate(str(ifCarpState))
# is inventorized interface in state carp master ?
- output = "IfName: %s IfType: %s " % (ifName, ifTypeStr)
+ if ifName == item:
+ output = "node in carp state %s with IfLinkState %s" \
+ % (ifCarpStateStr,ifLinkStateStr)
if ifName == item and ifCarpState == "2":
# is master
masters += 1
@@ -108,45 +112,30 @@ def check_genua_carp(item, _no_params, info):
# first master
if ifLinkState == "2":
state = 0
- output += "IfLinkState: %s IfCarpState: %s" \
- % (ifLinkStateStr, ifCarpStateStr)
elif ifLinkState == "1":
state = 2
- output += "IfLinkState: %s (!!) IfCarpState: %s " \
- % (ifLinkStateStr, ifCarpStateStr)
elif ifLinkState in [ "0", "3" ]:
state = 1
- output += "IfLinkState: %s (!) IfCarpState: %s " \
- % (ifLinkStateStr, ifCarpStateStr)
else:
state = 3
- output += "IfLinkState: %s IfCarpState: %s (!) " \
- % (ifLinkStateStr, ifCarpStateStr)
- return(state, output)
else:
- output = "%d masters found on cluster IF %s with %d nodes" \
- % (masters,item,nodes)
- return (2, output)
- # carp backup
- elif ifName == item and ifCarpState == "1" and ifLinkState == "1":
- state = 0
- output += "IfLinkState: %s IfCarpState: %s" \
- % (ifLinkStateStr, ifCarpStateStr)
- # carp init
- elif ifName == item and ifCarpState == "0":
- state = 1
- output += "IfLinkState: %s IfCarpState: %s (!) " \
- % (ifLinkStateStr, ifCarpStateStr)
- else:
- state = 1
- output += "IfLinkState: %s (!) IfCarpState: %s (!)" \
- % (ifLinkStateStr, ifCarpStateStr)
+ state = 2
+ output = "%d masters found on cluster with %d nodes" \
+ % (masters,nodes)
+ # look for non-masters, only interesting if no cluster
+ elif ifName == item and nodes == 1:
+ # carp backup
+ if ifCarpState == "1" and ifLinkState == "1":
+ state = 0
+ else:
+ state = 1
- if nodes > 1:
- # Called for cluster, and no master found
+ # no masters found in cluster
+ if nodes > 1 and masters == 0:
state = 2
- output = "No master found on cluster IF %s with %d nodes" % (item, nodes)
+ output = "No master found on cluster with %d nodes" % nodes
+ output = prefix + output
return(state, output)
check_info['genua_carp'] = {
@@ -155,28 +144,26 @@ check_info['genua_carp'] = {
"service_description": "Carp Interface %s",
"has_perfdata" : False,
"snmp_info" : [( ".1.3.6.1.4.1.3717.2.1.2",[
- 1.1, # "ifIndex"
- 1.2, # "ifName"
- 1.3, # "ifType"
- 1.4, # "ifLinkState"
- 1.7, # "ifCarpState"
+ "1.1", # "ifIndex"
+ "1.2", # "ifName"
+ "1.3", # "ifType"
+ "1.4", # "ifLinkState"
+ "1.7", # "ifCarpState"
])],
- "snmp_scan_function" : lambda oid: "genuscreen" in oid(".1.3.6.1.2.1.1.1.0").lower() \
- and oid(".1.3.6.1.4.1.3717.2.1.2.1.7") != None,
+ "snmp_scan_function" : lambda oid: "genuscreen" in oid(".1.3.6.1.2.1.1.1.0").lower()
}
-check_info['genua_carp_bad-eoid'] = {
+check_info['genua_carp_bad_eoid'] = {
"inventory_function" : inventory_genua_carp,
"check_function" : check_genua_carp,
"service_description": "Carp Interface %s",
"has_perfdata" : False,
- "snmp_info" : ( ".1.3.6.1.4.1.3137.2.1.2",[
- 1.1, # "ifIndex"
- 1.2, # "ifName"
- 1.3, # "ifType"
- 1.4, # "ifLinkState"
- 1.7, # "ifCarpState"
- ]),
- "snmp_scan_function" : lambda oid: "genuscreen" in oid(".1.3.6.1.2.1.1.1.0").lower() \
- and oid(".1.3.6.1.4.1.3137.2.1.2.1.7") != None
+ "snmp_info" : [( ".1.3.6.1.4.1.3137.2.1.2",[
+ "1.1", # "ifIndex"
+ "1.2", # "ifName"
+ "1.3", # "ifType"
+ "1.4", # "ifLinkState"
+ "1.7", # "ifCarpState"
+ ])],
+ "snmp_scan_function" : lambda oid: "genuscreen" in oid(".1.3.6.1.2.1.1.1.0").lower()
}
Module: check_mk
Branch: master
Commit: 76c96dba7106fe1bc904e4e52c4021417da9912a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=76c96dba7106fe…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 21 21:04:26 2013 -0400
Updated bug entries #0817, #0900, #0828
---
.bugs/817 | 7 +++++--
.bugs/828 | 2 +-
.bugs/900 | 9 +++++++--
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/.bugs/817 b/.bugs/817
index 293b0b9..d3348df 100644
--- a/.bugs/817
+++ b/.bugs/817
@@ -1,12 +1,15 @@
Title: PING check removed when legacy check added to host
Component: core
-State: open
+Class: nastiness
+State: done
Date: 2012-10-23 10:15:13
Targetversion: 1.2.3
-Class: nastiness
The PING check should remain on the host when the host has the tag
"ping" assigned, event when a legacy check has been added to the host.
Resolution: Create a WATO rule for check_icmp as active check. That
way the user can do all he wants...
+
+2013-10-21 21:00:00: changed state open -> done
+Rule for check_icmp already exists.
diff --git a/.bugs/828 b/.bugs/828
index b652b6c..edae99c 100644
--- a/.bugs/828
+++ b/.bugs/828
@@ -3,7 +3,7 @@ Component: checks
State: open
Date: 2013-08-19 09:38:38
Targetversion: future
-Class: nastiness
+Class: bug
If using Debian 6 with flexible notification system, plain e mail and umlauts in alias,
the mail never receives the mail. Reason is the missing c.utf8 locale. In german debian versions,
diff --git a/.bugs/900 b/.bugs/900
index 3dc9cfe..93b70da 100644
--- a/.bugs/900
+++ b/.bugs/900
@@ -1,9 +1,9 @@
Title: Check_MK does not handle interval_length != 60 correctly
Component: multisite
-State: open
+Class: nastiness
+State: wontfix
Date: 2013-02-15 14:30:58
Targetversion: future
-Class: nastiness
Reveived via feedback@:
@@ -32,3 +32,8 @@ results in display within check_mk GUI:
Service normal/retry check interval600s/180s
It seems to be a bug in the display only, checks are running correctly.
+
+2013-10-21 20:56:06: changed state open -> wontfix
+Setting interval_length != 60 is not only deprecated, but also not
+neccessary any more. Floating point numbers can be used as an
+interval length, e.g. 0.01666 for one second.
Module: check_mk
Branch: master
Commit: 352f786a3a4496a860e59ae633d4c6a9612a5f2b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=352f786a3a4496…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 21 20:54:28 2013 -0400
Multisite: add animated triangle to foldable sections
---
.bugs/1002 | 6 ++++--
ChangeLog | 1 +
web/htdocs/check_mk.css | 3 +++
web/htdocs/htmllib.py | 44 ++------------------------------------------
web/htdocs/js/checkmk.js | 2 ++
5 files changed, 12 insertions(+), 44 deletions(-)
diff --git a/.bugs/1002 b/.bugs/1002
index 48608b1..bba30dd 100644
--- a/.bugs/1002
+++ b/.bugs/1002
@@ -1,11 +1,13 @@
Title: Use triangle as indicator that a view is hidden (or not hidden)
Component: multisite
-State: open
+Class: nastiness
+State: done
Date: 2013-09-11 13:19:55
Targetversion: future
-Class: nastiness
In the WATO as well as the multisite GUI views/topic can be hidden by clicking on the title.
This may confuse a user in some occasions, because it may not be clear if the topic is hidden, or
no item were found under that topic.
Therefore a triangle as indicator if the topic is hidden or not should be very useful.
+
+2013-10-21 20:53:20: changed state open -> done
diff --git a/ChangeLog b/ChangeLog
index 8b5b781..67ab390 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
(needs to be confgured per view via the view editor)
* Wiki Sidebar Snapin: showing navigation and quicksearch. OMD only.
* Sidebar can now be folded. Simply click somewhere at the left 10 pixels.
+ * Foldable sections now have an animated triangle icon that shows the folding state
* FIX: Fixed encoding problem in webservice column output
* FIX: Fix output format python for several numeric columns
* FIX: Fixed searching hosts by aliases/adresses
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 3a760ad..41169e0 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -245,6 +245,9 @@ img.treeangle {
margin-right: 3px;
margin-top: 0px;
}
+img.treeangle.nform {
+ margin-left: -5px;
+}
b.treeangle.title {
font-weight: bold;
color: #ffffff;
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 88226a1..115fef1 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1155,48 +1155,6 @@ class html:
def begin_foldable_container(self, treename, id, isopen, title, indent = True, first = False):
self.folding_indent = indent
# try to get persisted state of tree
- tree_state = weblib.get_tree_states(treename)
-
- if id in tree_state:
- isopen = tree_state[id] == "on"
-
- img_num = isopen and "90" or "00"
- onclick = ' onclick="toggle_foldable_container(\'%s\', \'%s\')"' % (treename, id)
- onclick += ' onmouseover="this.style.cursor=\'pointer\';" '
- onclick += ' onmouseout="this.style.cursor=\'auto\';" '
-
- if indent == "nform":
- self.write('<tr class=heading><td id="nform.%s.%s" %s colspan=2>' % (treename, id, onclick))
- self.write('%s</td></tr>' % title)
- else:
- self.write('<img align=absbottom class="treeangle" id="treeimg.%s.%s" '
- 'src="images/tree_%s.png" %s>' %
- (treename, id, img_num, onclick))
- if title.startswith('<'): # custom HTML code
- self.write(title)
- if indent != "form":
- self.write("<br>")
- else:
- self.write('<b class="treeangle title" class=treeangle %s>%s</b><br>' %
- (onclick, title))
-
- indent_style = "padding-left: %dpx; " % (indent == True and 15 or 0)
- if indent == "form":
- self.write("</td></tr></table>")
- indent_style += "margin: 0; "
- self.write('<ul class="treeangle %s" style="%s" id="tree.%s.%s">' %
- (isopen and "open" or "closed", indent_style, treename, id))
-
- # give caller information about current toggling state (needed for nform)
- return isopen
-
- def end_foldable_container(self):
- if self.folding_indent != "nform":
- self.write("</ul>")
-
- def begin_foldable_container(self, treename, id, isopen, title, indent = True, first = False):
- self.folding_indent = indent
- # try to get persisted state of tree
tree_state = self.get_tree_states(treename)
if id in tree_state:
@@ -1209,6 +1167,8 @@ class html:
if indent == "nform":
self.write('<tr class=heading><td id="nform.%s.%s" %s colspan=2>' % (treename, id, onclick))
+ self.write('<img align=absbottom class="treeangle nform" src="images/tree_%s.png">' % (
+ isopen and "90" or "00"))
self.write('%s</td></tr>' % title)
else:
self.write('<img align=absbottom class="treeangle" id="treeimg.%s.%s" '
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 883b29d..929711f 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1055,6 +1055,8 @@ function toggle_foldable_container(treename, id) {
// Check, if we fold a NG-Norm
var oNform = document.getElementById('nform.' + treename + '.' + id);
if (oNform) {
+ var oImg = oNform.childNodes[0];
+ toggle_folding(oImg, oImg.src[oImg.src.length - 6] == '0');
var oTr = oNform.parentNode.nextSibling;
toggle_tree_state(treename, id, oTr);
}