Module: check_mk
Branch: master
Commit: deaaaafd768e24d73757a8c12410c08a032a9a16
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=deaaaafd768e24…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 25 10:25:45 2011 +0100
Updated bug entries
---
.bugs/104 | 4 ++++
.bugs/107 | 9 +++++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/.bugs/104 b/.bugs/104
index d2283c0..5fada4f 100644
--- a/.bugs/104
+++ b/.bugs/104
@@ -8,3 +8,7 @@ Class: bug
The search field (text entry) is not centered in Firefox.
Also tactical overview seems unprecise.
+
+This has been introduced since 1.1.8. In OMD 0.44 everything is
+still fine. Might have todo with the fixing of the bullet indentation.
+
diff --git a/.bugs/107 b/.bugs/107
new file mode 100644
index 0000000..6c90e63
--- /dev/null
+++ b/.bugs/107
@@ -0,0 +1,9 @@
+Title: Snapin Serverperformance: number should be bold
+Component: multisite
+Benefit: 1
+State: open
+Cost: 1
+Date: 2011-01-25 10:03:20
+Class: cleanup
+
+The numbers had been bold once. This looked better. Make them bold again.
Module: check_mk
Branch: master
Commit: 42ac4fe4e39d1677763f826177db2bc667bc21c4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42ac4fe4e39d16…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 25 14:42:37 2011 +0100
New HP-UX Agent and check for CPU load
---
ChangeLog | 2 +
agents/check_mk_agent.hpux | 136 +++++++++++++++++++++++++++++++++
checkman/hpux_cpu | 39 ++++++++++
checks/hpux_cpu | 53 +++++++++++++
pnp-rraconf/check_mk-hpux_cpu.rra.cfg | 1 +
pnp-templates/check_mk-hpux_cpu.php | 1 +
6 files changed, 232 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dc5c53a..66ad7a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
* megaraid_ldisks: remove debug output
* fc_brocade_port: hide on SNMP scan, prefer fc_brocade_port_detailed
* fc_brocade_port_detailed: improve scan function, find more devices
+ * New agent for HP-UX
+ * New check hpux_cpu: CPU load average on HP-UX
1.1.9i5:
diff --git a/agents/check_mk_agent.hpux b/agents/check_mk_agent.hpux
new file mode 100755
index 0000000..c7ef27b
--- /dev/null
+++ b/agents/check_mk_agent.hpux
@@ -0,0 +1,136 @@
+#!/usr/bin/ksh
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 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.
+
+export PATH=$PATH:/usr/sbin:/usr/bin:/usr/contrib/bin
+
+export MK_LIBDIR="/omd/versions/0.45.20110123/lib/check_mk_agent"
+export MK_CONFDIR="/etc/check_mk"
+
+# All executables in PLUGINSDIR will simply be executed and their
+# ouput appended to the output of the agent. Plugins define their own
+# sections and must output headers with '<<<' and '>>>'
+PLUGINSDIR=$MK_LIBDIR/plugins
+
+# All executables in LOCALDIR will by executabled and their
+# output inserted into the section <<<local>>>. Please
+# refer to online documentation for details about local checks.
+LOCALDIR=$MK_LIBDIR/local
+
+exec <&- 2>/dev/null
+
+echo '<<<check_mk>>>'
+echo Version: 1.1.9i5
+echo AgentOS: hpux
+echo PluginsDirectory: $PLUGINSDIR
+echo LocalDirectory: $LOCALDIR
+echo AgentDirectory: $MK_CONFDIR
+
+# Filesystems. HP-UX does not provide a filesystem type. We assume
+# modern systems with vxfs only here. The filesystem type is currently
+# not used by the check anyway.
+echo '<<<df>>>'
+df -Pkl | sed -e 's/ / vxfs /' -e 1d
+
+# Process table: HP-UX does not provide a resident size of processes.
+# We send a 0 here for RSZ.
+echo '<<<ps>>>'
+UNIX95=yes ps -ef -o user,vsz,pcpu,args | sed -e 1d -e 's/ *\([^ ]*\) *\([^ ]*\) *\([^ ]*\) */(\1,\2,0,\3) /'
+
+
+echo '<<<hpux_cpu>>>'
+uptime
+machinfo | grep 'logical proc'
+
+# Several machine performance counters
+echo '<<<hpux_vmstat>>>'
+vmstat -s
+
+# Memory information
+echo '<<<hpux_mem>>>'
+machinfo | grep ^Memory
+vmstat | sed -n 3p
+
+# TCP connection states
+echo '<<<tcp_conn_stats>>>'
+netstat -f inet -n | awk ' /^tcp/ { c[$6]++; } END { for (x in c) { print x, c[x]; } }'
+
+# Network interfaces
+echo '<<<hpux_nics>>>'
+netstat -niw | sed 1d
+for nic in `nwmgr -g | sed -n '/^lan/s/\(^[^ ]* \).*/\1/p'`
+do
+ nwmgr -A speed,link_state -c $nic --script
+done
+
+# Logical Volume Manager
+echo '<<<hpux_lvm:sep(58)>>>'
+vgdisplay -v -F
+
+# Multipathing
+scsimgr lun_map | egrep '^[[:space:]]*(LUN PATH|State)'
+
+echo '<<<ntp>>>'
+# remove heading, make first column space separated
+ntpq -p | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
+
+
+# Einbinden von lokalen Plugins, die eine eigene Sektion ausgeben
+if cd $PLUGINSDIR
+then
+ for skript in $(ls)
+ do
+ if [ -x "$skript" ] ; then
+ ./$skript
+ fi
+ done
+fi
+
+
+# Lokale Einzelchecks
+echo '<<<local>>>'
+if cd $LOCALDIR
+then
+ for skript in $(ls)
+ do
+ if [ -x "$skript" ] ; then
+ ./$skript
+ fi
+ done
+fi
+
+
+# MK's Remote Plugin Executor
+if [ -e "$MK_CONFDIR/mrpe.cfg" ]
+then
+ echo '<<<mrpe>>>'
+ grep -Ev '^[[:space:]]*($|#)' "$MK_CONFDIR/mrpe.cfg" | \
+ while read descr cmdline
+ do
+ PLUGIN=${cmdline%% *}
+ OUTPUT=$(eval "$cmdline")
+ echo -n "(${PLUGIN##*/}) $descr $? $OUTPUT" | tr \\n \\1
+ echo
+ done
+fi
diff --git a/checkman/hpux_cpu b/checkman/hpux_cpu
new file mode 100644
index 0000000..7812bf2
--- /dev/null
+++ b/checkman/hpux_cpu
@@ -0,0 +1,39 @@
+title: Check CPU load on HP-UX
+agents: hpux
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check measures and checks the averaged CPU load. The values
+ for 1, 5 and 15 minute average are sent, although the PNP template
+ shipped with check_mk only displays the 1 and 15 min average load.
+
+ This check is compatible with the check {cpu.loads} of the linux
+ agent.
+
+examples:
+ # Set default levels to a load of 4 and 8 per CPU
+ cpuload_default_levels = (4.0, 8.0).
+
+ checks = [
+ # Use levels 4 per CPU (warning) and 8 per CPU (critical)
+ # on all hosts with the tag "linux"
+ (["hp"], ALL_HOSTS, "hpux_cpu", None, (4, 8)),
+ ]
+perfdata:
+ Three values: The load average for 1, 5 and 15 minutes.
+
+inventory:
+ One service is created if the agent outputs valid data.
+
+[parameters]
+warning (int): 15 minute average load {per processor} at which a
+ warning is triggered. If you set this value to 2 on a 16 CPU
+ machine, then a warning will be reached at a load of 32.
+critical (int): 15 minute average load per processor at which
+ a critical state is triggered.
+
+[configuration]
+cpuload_default_levels (int, int): A pair of floats or integers: The default
+ levels. These levels are used for inventorized checks. This variable
+ is preset to {(5, 10)}
diff --git a/checks/hpux_cpu b/checks/hpux_cpu
new file mode 100644
index 0000000..6aadd32
--- /dev/null
+++ b/checks/hpux_cpu
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 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.
+
+# <<<hpux_cpu>>>
+# 2:23pm up 196 days, 4:47, 5 users, load average: 0.05, 0.04, 0.04
+# 8 logical processors (2 per socket)
+
+cpuload_default_levels = (5, 10)
+
+def inventory_hpux_cpu_load(checkname, info):
+ if len(info) == 2 and 'load' in info[0]:
+ return [(None, "cpuload_default_levels")]
+
+def check_hpux_cpu_load(item, params, info):
+ load = [ float(l.strip(',')) for l in info[0][-3:] ]
+ num_cpus = int(info[1][0])
+
+ warn, crit = params # apply on 15min average, relative to number of CPUs
+ warn = warn * num_cpus
+ crit = crit * num_cpus
+ perfdata = [ ('load' + str(z), l, warn, crit, 0 ) for (z, l) in [ (1, load[0]), (5, load[1]), (15, load[2]) ] ]
+
+ if load[2] >= crit:
+ return (2, "CRIT - 15min Load %.2f at %s CPUs (critical at %.2f)" % (load[2], num_cpus, crit), perfdata)
+ elif load[2] >= warn:
+ return (1, "WARN - 15min Load %.2f at %s CPUs (warning at %.2f)" % (load[2], num_cpus, warn), perfdata)
+ else:
+ return (0, "OK - 15min Load %.2f at %s CPUs" % (load[2], num_cpus), perfdata)
+
+check_info['hpux_cpu'] = (check_hpux_cpu_load, "CPU load", 1, inventory_hpux_cpu_load )
diff --git a/pnp-rraconf/check_mk-hpux_cpu.rra.cfg b/pnp-rraconf/check_mk-hpux_cpu.rra.cfg
new file mode 120000
index 0000000..19dbf77
--- /dev/null
+++ b/pnp-rraconf/check_mk-hpux_cpu.rra.cfg
@@ -0,0 +1 @@
+max.rra.cfg
\ No newline at end of file
diff --git a/pnp-templates/check_mk-hpux_cpu.php b/pnp-templates/check_mk-hpux_cpu.php
new file mode 120000
index 0000000..ade8b37
--- /dev/null
+++ b/pnp-templates/check_mk-hpux_cpu.php
@@ -0,0 +1 @@
+check_mk-cpu.loads.php
\ No newline at end of file