Module: check_mk
Branch: master
Commit: 3d3956714b4c77cfb74539d77ef7c91c264b118d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d3956714b4c77…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 25 11:25:38 2011 +0100
check conventions: Added some other thoughts
---
README.writing_checks | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.writing_checks b/README.writing_checks
index 2705f88..0d09944 100644
--- a/README.writing_checks
+++ b/README.writing_checks
@@ -1,10 +1,11 @@
This file will help you to write *good* checks for Check_MK.
Check Naming:
-*
+* In case of SNMP checks you might use the name of the MIB you fetch data from as
+ part of check name
Header notes:
-* Add lincense notes
+* Add licence notes
* Add author notes. At least a contact mail address.
Module: check_mk
Branch: master
Commit: 764c37a03240dd699ae171f570f499352d30579b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=764c37a03240dd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 25 11:10:20 2011 +0100
check conventions: Added some other thoughts
---
README.writing_checks | 18 +++++++++++++++++-
doc/helpers/validate_checks | 17 +++++++++++++++++
2 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/README.writing_checks b/README.writing_checks
index 3490073..2705f88 100644
--- a/README.writing_checks
+++ b/README.writing_checks
@@ -3,10 +3,24 @@ This file will help you to write *good* checks for Check_MK.
Check Naming:
*
-Code styling:
+Header notes:
+* Add lincense notes
+
+* Add author notes. At least a contact mail address.
+
+Coding styling:
+* Avoid long lines. In an optimal case your lines don't exceed 80 chars.
+ 100 chars.
+
* Use four spaces for intending your code. Just don't use tab chars.
And if you relly can't life without tabs set the tab width to 8 spaces.
+* Variable naming. Use lower case variable names where the keywords are splitted by _ signs.
+
+* Creating nagios state strings: There is a dictionary named 'nagios_state_names'.
+ You can use it to get nagios state string from nagios return codes. e.g.:
+ nagios_state_names[0] gives you 'OK'.
+
Manpages:
*
@@ -31,3 +45,5 @@ Agent based checks:
by your check. -> That makes the code more easy to understand
and help not to break something if someone changes something
in the check's parser.
+ In an optimal case you include several code examples of different
+ states.
diff --git a/doc/helpers/validate_checks b/doc/helpers/validate_checks
index 7f9ade4..8f6590a 100755
--- a/doc/helpers/validate_checks
+++ b/doc/helpers/validate_checks
@@ -90,6 +90,14 @@ def get_manpage(check):
manpage[check] = ""
return manpage[check]
+def get_checkfile(check):
+ if not check in checkfiles:
+ try:
+ checkfiles[check] = open('checks/%s' % check.split('.')[0]).read()
+ except IOError, e:
+ checkfiles[check] = ""
+ return checkfiles[check]
+
def grep_manpage(check, match, section = None):
manpage = get_manpage(check)
if section is None:
@@ -206,6 +214,15 @@ def verify_reindent(check):
f.close()
return not r.run()
+# Toooo long lines:
+# - Are there too long lines in the check?
+
+def is_valid_linelength(check):
+ return True
+
+def verify_linelength(check):
+
+
# Manpage:
# - Does the check have a manpage?
Module: check_mk
Branch: master
Commit: 679135ef57fc0900ce618fa2edd3bdcd595c6ccc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=679135ef57fc09…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 25 10:52:54 2011 +0100
Removed shebang in the middle of file
---
README.writing_checks | 6 ++++++
doc/helpers/df_magic_number.py | 2 --
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/README.writing_checks b/README.writing_checks
index feaffd1..3490073 100644
--- a/README.writing_checks
+++ b/README.writing_checks
@@ -1,5 +1,8 @@
This file will help you to write *good* checks for Check_MK.
+Check Naming:
+*
+
Code styling:
* Use four spaces for intending your code. Just don't use tab chars.
And if you relly can't life without tabs set the tab width to 8 spaces.
@@ -8,6 +11,9 @@ Manpages:
*
Performance data:
+* Only set perfdata flag when the check really produces performance data
+ output.
+
* All performance data checks need to provide a pnp template
* pnp rra configuration
diff --git a/doc/helpers/df_magic_number.py b/doc/helpers/df_magic_number.py
index 8efe220..13b3ec9 100755
--- a/doc/helpers/df_magic_number.py
+++ b/doc/helpers/df_magic_number.py
@@ -24,8 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-#!/usr/bin/python
-
normsize = 20.0
import sys
Module: check_mk
Branch: master
Commit: 1628efc2c36dbce1e03af6bce3f5b287705f0800
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1628efc2c36dbc…
Author: Florian Heigl <floh(a)Klappstuhl.(none)>
Date: Fri Feb 25 09:51:30 2011 +0100
updated manual
---
checkman/h3c_lanswitch_cpu | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/checkman/h3c_lanswitch_cpu b/checkman/h3c_lanswitch_cpu
index b7256a4..3c742c0 100644
--- a/checkman/h3c_lanswitch_cpu
+++ b/checkman/h3c_lanswitch_cpu
@@ -1,11 +1,19 @@
-title: Check 3Com SuperStack 4 CPU Utilization
+title: Check CPU Utilization of 3COM and H3C switches.
agents: snmp
author: Florian Heigl <fh(a)mathias-kettner.de>
license: GPL
distribution: check_mk
description:
- This Check queries the CPU utilization for SuperStack 4 switches, either standalone or that of the CPUs of all units in the stack. Note these switches don't handle snmp well and you should lower the frequence of SNMP based checks with them.
- The CPU usage ratio returned by the check is the average load of the last 60 seconds.
+This Check queries the CPU utilization for various LAN switches that are supporting the MIB for H3C lan switches.
+These are:
+Newer 3Com switches (Superstack 4 and later), H3C branded switches and now for example the HP "A-Series" Networking gear. The same switches from the original maker Huawei are not supporting the MIB. These also only support cpu stats, whereas the H3C Mib also gives Memory stats and Fabric status etc.
+The check should correctly label the CPU in your switch / stack / core switch module slots.
+
+Note some of these switches don't handle snmp well and might generate up to 90% cpu load while queried.
+To accomodate for this you should lower the frequency of SNMP based checks with them.
+The CPU usage ratio returned by the check is the average load of the last 5 minutes.
+
+
inventory:
@@ -18,13 +26,14 @@ critical (int): the percentage of 1-minute average load at which the switch is c
[configuration]
-superstack4_cpu_default_levels (int, int): the warn and critical levels for the checkl.
+h3c_lanswitch_cpu_default_levels (int, int): the warn and critical levels for the check.
They are set to default to 50% for "WARN" and 75% for "CRIT".
+ If you expect heavy load (i.e. running full BGP tables) then you might want to adjust these.
item:
- The CPU found by inventory (it's OID is a multiple of 65536 and will be divided to come to a sane value)
+ The CPU found by inventory (it's OID is a multiple of 65536 for stackable switches, or the slot Id it resides at for multicontroller switches and will be divided to come to a sane value). Later multicore CPU switches should be supported already.
perfdata:
- It does not generate any performance data yet.
+ It does generate performance data (the 5min average CPU load)