Module: check_mk
Branch: master
Commit: 44005536a6073c841e5c6557c695ab01e28a2b6f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44005536a6073c…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Feb 10 18:34:47 2014 +0100
cisco_fru_power: minor code cleanup and check man page added
---
checkman/cisco_fru_power | 20 ++++++++++++++++++++
checks/cisco_fru_power | 21 +++++++++++----------
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/checkman/cisco_fru_power b/checkman/cisco_fru_power
new file mode 100644
index 0000000..6218210
--- /dev/null
+++ b/checkman/cisco_fru_power
@@ -0,0 +1,20 @@
+title: Cisco Nexus Switches: State of FRU Power Supplies
+agents: snmp
+catalog: hw/network/cisco
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the administrative and operational status of field
+ replaceable unit (FRU) power supplies of Cisco switches. The check is
+ {OK} when the administrative and operational state is {on}. The check is
+ {CRIT} when the administrative state is {off} or the operational state
+ is {offDenied}, {offEnvPower}, {offEnvTemp}, {offEnvFan}. {failed},
+ {onButInlinePowerFail}. The check is {WARN} otherwise.
+
+item:
+ The index of the power supply from the list of OIDs for the device.
+
+inventory:
+ One check is created for each FRU power supply unit. Units are only included
+ if they are not in the operational state {offEnvOther} and {offEnvPower}
+
diff --git a/checks/cisco_fru_power b/checks/cisco_fru_power
index 37cdc3d..5b66152 100644
--- a/checks/cisco_fru_power
+++ b/checks/cisco_fru_power
@@ -57,12 +57,6 @@
# 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 if saveint(line[2]) not in [ 1, 5 ] ]
@@ -70,9 +64,15 @@ def inventory_cisco_fru_power(info):
def check_cisco_fru_power(item, params, info):
for line in info:
if line[0] == item:
+ power_oper_type = ('', 'offEnvOther', 'on', 'offAdmin', 'offDenied',
+ 'offEnvPower', 'offEnvTemp', 'offEnvFan', 'failed',
+ 'onButFanFail', 'offCooling', 'offConnectorRating',
+ 'onButInlinePowerFail' )
+ power_admin_type = ( '', 'on', 'off', 'inlineAuto', 'inlineOn', 'powercycle')
+
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_state_txt = power_admin_type[admin_state]
+ oper_state_txt = power_oper_type[oper_state]
admin_sym = ""
oper_sym = ""
if admin_state == 1 and oper_state == 2:
@@ -89,8 +89,9 @@ def check_cisco_fru_power(item, params, info):
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))
+ infotext = "Admin-State: %s%s, Oper-State: %s%s" % \
+ (admin_state_txt, admin_sym, oper_state_txt, oper_sym))
+ return (state, infotext)
return (3, "item not found in snmp data")
Module: check_mk
Branch: master
Commit: 0d10f5b0267b5dadb6018b5412a450d2613170da
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d10f5b0267b5d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 10 16:20:48 2014 +0100
FIX statgrab_net.ctr: only inventorize interfaces with actual traffic
Some virtual interfaces with no counter information got inventorized - doesn't made sense.
Now we only inventorize interfaces which also provide traffic information.
---
.werks/281 | 10 ++++++++++
ChangeLog | 1 +
checks/statgrab_net | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/281 b/.werks/281
new file mode 100644
index 0000000..e8a32dd
--- /dev/null
+++ b/.werks/281
@@ -0,0 +1,10 @@
+Title: statgrab_net.ctr: only inventorize interfaces with actual traffic
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392045619
+Class: fix
+
+Some virtual interfaces with no counter information got inventorized - doesn't made sense.
+Now we only inventorize interfaces which also provide traffic information.
+
diff --git a/ChangeLog b/ChangeLog
index e6eb693..91c8aec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -170,6 +170,7 @@
* 0708 FIX: ntp.time, ntp: avoid DNS lookups in NTP queries and avoid timeouts...
* 0277 FIX: solaris agent: ntp now able to work with ntpd and xntpd...
* 0279 FIX: check_mk_agent.solaris: removed proc section from statgrab...
+ * 0281 FIX: statgrab_net.ctr: only inventorize interfaces with actual traffic...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/statgrab_net b/checks/statgrab_net
index f8dfdc9..6268852 100644
--- a/checks/statgrab_net
+++ b/checks/statgrab_net
@@ -97,10 +97,13 @@ def check_statgrab_net_params(item, params, info):
def inventory_statgrab_net_ctr(info):
items = []
+ last_tx_nic = ""
for var, value in info:
- if var.endswith(".up"):
+ if var.endswith(".tx"):
+ last_tx_nic = var.split('.')[0]
+ elif var.endswith(".up"):
nicname = var.split('.')[0]
- if not nicname.startswith("lo"):
+ if nicname == last_tx_nic and not nicname.startswith("lo"):
items.append( (nicname, '', '""') )
return items
Module: check_mk
Branch: master
Commit: 906c9a6e207d25ff75e2ce74890bfaaea6fd308f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=906c9a6e207d25…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 10 16:13:51 2014 +0100
FIX check_mk_agent.solaris: removed proc section from statgrab
Querying the proc section with statgrab could lead to bus errors or segmentation faults.
Since the statgrab_proc section wasn't used anyway it has been removed from the agent.
---
.werks/279 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 4 ++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/279 b/.werks/279
new file mode 100644
index 0000000..2749d54
--- /dev/null
+++ b/.werks/279
@@ -0,0 +1,9 @@
+Title: check_mk_agent.solaris: removed proc section from statgrab
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392045063
+Class: fix
+
+Querying the proc section with statgrab could lead to bus errors or segmentation faults.
+Since the statgrab_proc section wasn't used anyway it has been removed from the agent.
diff --git a/ChangeLog b/ChangeLog
index 0397135..e6eb693 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -169,6 +169,7 @@
* 0693 FIX: hpux_lvm: avoid problem when alternative vgdisplay is installed...
* 0708 FIX: ntp.time, ntp: avoid DNS lookups in NTP queries and avoid timeouts...
* 0277 FIX: solaris agent: ntp now able to work with ntpd and xntpd...
+ * 0279 FIX: check_mk_agent.solaris: removed proc section from statgrab...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index f054e29..89dd922 100644
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -141,8 +141,8 @@ sed -e 1d -e 's/ *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) */(\1,\2,\3,\4) /'
# binary: http://www.opencsw.org/
if type statgrab &>/dev/null
then
- statgrab_vars="const. cpu. disk. general. mem. page. proc. swap. user."
- statgrab_sections="proc cpu disk page"
+ statgrab_vars="const. cpu. disk. general. mem. page. swap. user."
+ statgrab_sections="cpu disk page"
# Only collect net stats in global zone.
if [ "$zonename" == "global" ]
Module: check_mk
Branch: master
Commit: ded1cda2b10134c55b99f0ca3614112ea8f23950
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ded1cda2b10134…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 10 14:30:48 2014 +0100
Updated bug entries #2103
---
.bugs/2103 | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/.bugs/2103 b/.bugs/2103
new file mode 100644
index 0000000..02c5bb8
--- /dev/null
+++ b/.bugs/2103
@@ -0,0 +1,20 @@
+Title: Quicksearch of hosts: incorrect WATO link
+Component: multisite
+State: open
+Date: 2014-02-10 14:24:58
+Targetversion: 1.2.5i1
+Class: bug
+
+For example:
+Doint a quicksearch on "x" returns the hosts esx_host and winxp
+The WATO context button links to
+http://localhost/heute1/check_mk/wato.py?mode=edithost&host=x
+
+Should be changed that it only creates a host link if there is a
+WATO host with this name. If not, just create a link to the wato_folder
+
+Best place for change:
+htdocs/views.py:
+lines following: # WATO: If we have a host context, then show button to WATO, if permissions allow this
+
+Note: checking if a WATO host exist might take some time...
Module: check_mk
Branch: master
Commit: be90aafd909e1a912334a2f73458cccc4cb6aba0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be90aafd909e1a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 10 13:11:33 2014 +0100
FIX solaris agent: ntp now able to work with ntpd and xntpd
The previous version always looked for the xntpd.
If it wasn't present, no <<<ntp>>> section got created.
---
.werks/277 | 9 +++++++++
ChangeLog | 7 ++++---
agents/check_mk_agent.solaris | 2 +-
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/.werks/277 b/.werks/277
new file mode 100644
index 0000000..ba6fb6f
--- /dev/null
+++ b/.werks/277
@@ -0,0 +1,9 @@
+Title: solaris agent: ntp now able to work with ntpd and xntpd
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392034080
+Class: fix
+
+The previous version always looked for the xntpd.
+If it wasn't present, no <<<ntp>>> section got created.
diff --git a/ChangeLog b/ChangeLog
index e5a9ce6..01e95e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,13 +81,13 @@
* 0699 emc_isilon_iops: New check for Disk Operations per Second (IOPS) in EMC Isilon Storage
* 0132 New checks fjdarye101_disks fjdarye101_rluns: Fujitsu Storage Systems with 2013 Firmware
* 0697 check_dns: allow to specify multiple expected answers
+ * 0700 arcserve_backup: new check for status of backups in an Arcserve Backup Server
* 0580 emc_datadomain_fans, emc_datadomain_nvbat, emc_datadomain_power, emc_datadomain_temps: new hardware checks for EMC Datadomain
- * 0581 emc_datadomain_disks emc_datadomain_fs: new checks to monitor disks and filesystems of EMC Datadomain
* 0691 Solaris agent: include lofs in list of monitored filesystem types
* 0694 wut_webtherm: Support new versions of WUT-Thermometer...
- * 0701 emc_isilon_diskstatus: new check for Status of Disks in EMC Isilon Storage Systems
* 0135 apc_inputs: New Check for APC Input Contacts
- * 0700 arcserve_backup: new check for status of backups in an Arcserve Backup Server
+ * 0701 emc_isilon_diskstatus: new check for Status of Disks in EMC Isilon Storage Systems
+ * 0581 emc_datadomain_disks emc_datadomain_fs: new checks to monitor disks and filesystems of EMC Datadomain
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
@@ -168,6 +168,7 @@
* 0692 FIX: fileinfo: Avoid duplicate entries in Solaris agent...
* 0693 FIX: hpux_lvm: avoid problem when alternative vgdisplay is installed...
* 0708 FIX: ntp.time, ntp: avoid DNS lookups in NTP queries and avoid timeouts...
+ * 0277 FIX: solaris agent: ntp now able to work with ntpd and xntpd...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 5ef0e78..f054e29 100644
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -191,7 +191,7 @@ echo $(($ctime - $btime))
# NTP
-ps -o comm $pszone | grep -w xntpd &>/dev/null
+ps -o comm $pszone | grep -w .*ntpd &>/dev/null
if [ $? -eq 0 ]
then
echo '<<<ntp>>>'
Module: check_mk
Branch: master
Commit: 6d70e2488037961f5b1c34ab89067e337a776047
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d70e248803796…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 10 12:39:52 2014 +0100
update documentation for 'process inventory' rule
---
web/plugins/wato/check_parameters.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index d0219a9..05dd01c 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -330,7 +330,8 @@ register_rule(group + '/' + subgroup_inventory,
'<p>Specifying "grab user" makes the created check expect the process to run as the same user as during inventory: the user '
'name will be hardcoded into the check. In that case if you put %u into the service description, that will be replaced '
'by the actual user name during inventory. You need that if your rule might match for more than one user - your would '
- 'create duplicate services with the same description otherwise.</p>'),
+ 'create duplicate services with the same description otherwise.</p><p>Windows users are specified by the namespace followed by '
+ 'the actual user name. For example "\\\\NT AUTHORITY\NETWORK SERVICE" or "\\\\CHKMKTEST\Administrator".</p>'),
)),
('perfdata', Checkbox(
title = _('Performance Data'),
Module: check_mk
Branch: master
Commit: c47924faadca56c80b6bac80a3c905511e98e149
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c47924faadca56…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Feb 10 11:05:08 2014 +0100
Revert "emc_datadomain_disks emc_datadomain_fs: new checks to monitor disks and filesystems of EMC Datadomain"
This change removes files accidentelly included in the commit 37cb73d5fa77da033b9b69b03951e4a7f9607736
---
ChangeLog | 2 +-
agents/check_mk_agent.linux | 43 +++++++++++++++++--------------------------
checkman/stulz_pump | 5 +----
checks/stulz_pump | 20 ++++++--------------
4 files changed, 25 insertions(+), 45 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 85d3654..e5a9ce6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,13 +81,13 @@
* 0699 emc_isilon_iops: New check for Disk Operations per Second (IOPS) in EMC Isilon Storage
* 0132 New checks fjdarye101_disks fjdarye101_rluns: Fujitsu Storage Systems with 2013 Firmware
* 0697 check_dns: allow to specify multiple expected answers
- * 0700 arcserve_backup: new check for status of backups in an Arcserve Backup Server
* 0580 emc_datadomain_fans, emc_datadomain_nvbat, emc_datadomain_power, emc_datadomain_temps: new hardware checks for EMC Datadomain
* 0581 emc_datadomain_disks emc_datadomain_fs: new checks to monitor disks and filesystems of EMC Datadomain
* 0691 Solaris agent: include lofs in list of monitored filesystem types
* 0694 wut_webtherm: Support new versions of WUT-Thermometer...
* 0701 emc_isilon_diskstatus: new check for Status of Disks in EMC Isilon Storage Systems
* 0135 apc_inputs: New Check for APC Input Contacts
+ * 0700 arcserve_backup: new check for status of backups in an Arcserve Backup Server
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 711cf7a..cf22b2e 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -365,32 +365,23 @@ fi
# Status of CUPS printer queues
if type lpstat > /dev/null 2>&1; then
- if pgrep cups > /dev/null 2>&1; then
- echo '<<<cups_queues>>>'
- CPRINTCONF=/etc/cups/printers.conf
- if [ -r "$CPRINTCONF" ] ; then
- LOCAL_PRINTERS=$(grep -E "<(Default)?Printer .*>" $CPRINTCONF | awk '{print $2}' | sed -e 's/>//')
- lpstat -p | while read LINE
- do
- PRINTER=$(echo $LINE | awk '{print $2}')
- if echo "$LOCAL_PRINTERS" | grep -q "$PRINTER"; then
- echo $LINE
- fi
- done
- echo '---'
- lpstat -o | while read LINE
- do
- PRINTER=$(echo $LINE | awk '{print $2}')
- if echo "$LOCAL_PRINTERS" | grep -q "$PRINTER"; then
- echo $LINE
- fi
- done
- else
- lpstat -p
- echo '---'
- lpstat -o | sort
- fi
- fi
+ if pgrep cups > /dev/null 2>&1; then
+ echo '<<<cups_queues>>>'
+ WAITMAX="waitmax 3"
+ CPRINTCONF=/etc/cups/printers.conf
+ PRINTERS=$(waitmax 10 lpstat -a | awk '{print $1}')
+ if [ -r "$CPRINTCONF" ] ; then
+ for PQ in $PRINTERS ; do
+ grep -q -x -E "<(Default)?Printer $PQ>" $CPRINTCONF && $WAITMAX lpstat -p $PQ
+ done
+ echo '---'
+ for PQ in $PRINTERS ; do
+ grep -q -x -E "<(Default)?Printer $PQ>" $CPRINTCONF && $WAITMAX lpstat -o $PQ
+ done
+ else
+ $WAITMAX lpstat -p ; echo '---' ; $WAITMAX lpstat -o | sort
+ fi
+ fi
fi
# Heartbeat monitoring
diff --git a/checkman/stulz_pump b/checkman/stulz_pump
index 0f6ca10..c1435b8 100644
--- a/checkman/stulz_pump
+++ b/checkman/stulz_pump
@@ -4,11 +4,8 @@ catalog: hw/environment
license: GPL
distribution: check_mk
description:
- This plugin checks the status and RPM of pumps of Stulz clima units. It returns
+ This plugin checks the status of pumps of Stulz clima units. Returns
{OK} if the pump is running and {CRIT} if it is not running.
-perfdata:
- The RPM of the pump in percent of the maximum RPM are taken as performance data
-
inventory:
The inventory will create exactly one service per pump.
diff --git a/checks/stulz_pump b/checks/stulz_pump
index 3268d3b..e3e6ec2 100644
--- a/checks/stulz_pump
+++ b/checks/stulz_pump
@@ -26,36 +26,28 @@
def inventory_stulz_pump(info):
inventory = []
- for pump_id, pump_status in info[0]:
+ for pump_id, pump_status in info:
pump_id = pump_id.replace('.1', '')
inventory.append( (pump_id, None) )
return inventory
def check_stulz_pump(item, _no_params, info):
- for pump_id, pump_status in info[0]:
+ for pump_id, pump_status in info:
pump_id = pump_id.replace('.1', '')
if pump_id == item:
- pump_rpm = info[1][int(pump_id)-1][0]
- perfdata = [ ('rpm', pump_rpm+"%", None, None, 0, 100) ]
if pump_status == '1':
- state = 0
- infotext = "Pump is running at %s%%" % pump_rpm
+ return 0, "Pump is running"
elif pump_status == '0':
- state = 2
- infotext = "Pump is not running"
+ return 2, "Pump is not running"
else:
- state = 3
- infotext = "Pump reports unidentified status " + pump_status
- return state, infotext, perfdata
+ return 3, "Pump reports unidentified status " + pump_status
return 3, "Pump %s not found" % item
check_info["stulz_pump"] = {
"check_function" : check_stulz_pump,
"inventory_function" : inventory_stulz_pump,
"service_description" : "Pump %s",
- "has_perfdata" : True,
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0") == ".1.3.6.1.4.1.29462.10",
- "snmp_info" : [( ".1.3.6.1.4.1.29462.10.2.1.1.2.1.4.1.1.5802", [ OID_END, 2] ),
- ( ".1.3.6.1.4.1.29462.10.2.1.1.2.1.4.1.1.5821", [2] ),]
+ "snmp_info" : ( ".1.3.6.1.4.1.29462.10.2.1.1.2.1.4.1.1.5802", [ OID_END, 2] ),
}