Module: check_mk
Branch: master
Commit: 86e809f634796852f669f49ca132dbc289f8141d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=86e809f6347968…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 18:42:00 2014 +0100
#1656 FIX cisco_vpn_tunnel: Refactored complete check, fixed threshold bugs
Improved check in different ways:
- When configuring OK as failed tunnel state, this was not handled correctly by the check.
- Clarified the valuespec titles and help texts.
- Check did not process multiple VPN tunnel configurations defined in a single rule.
- Cleaned up check code
Sadly had no data for testing here... Let's hope for the best.
---
.werks/1656 | 16 ++++++++++++++++
ChangeLog | 1 +
checks/cisco_vpn_tunnel | 31 +++++++++++--------------------
web/plugins/wato/check_parameters.py | 24 ++++++++++++++----------
4 files changed, 42 insertions(+), 30 deletions(-)
diff --git a/.werks/1656 b/.werks/1656
new file mode 100644
index 0000000..09422b3
--- /dev/null
+++ b/.werks/1656
@@ -0,0 +1,16 @@
+Title: cisco_vpn_tunnel: Refactored complete check, fixed threshold bugs
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417714529
+Class: fix
+
+Improved check in different ways:
+
+- When configuring OK as failed tunnel state, this was not handled correctly by the check.
+- Clarified the valuespec titles and help texts.
+- Check did not process multiple VPN tunnel configurations defined in a single rule.
+- Cleaned up check code
+
+Sadly had no data for testing here... Let's hope for the best.
diff --git a/ChangeLog b/ChangeLog
index 6f34768..d323b6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -108,6 +108,7 @@
* 1653 FIX: megaraid_pdisks: Resulting states are now hard coded within the check...
* 1654 FIX: statgrab_disk: Fixed scaling of values shown in PNP graphs...
* 1655 FIX: AIX Agent: Fixed broken filesystem checks when having PowerHA installed...
+ * 1656 FIX: cisco_vpn_tunnel: Refactored complete check, fixed threshold bugs...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/cisco_vpn_tunnel b/checks/cisco_vpn_tunnel
index ebc1fed..3b2e573 100644
--- a/checks/cisco_vpn_tunnel
+++ b/checks/cisco_vpn_tunnel
@@ -35,28 +35,20 @@
# remote peer."
def check_cisco_vpn_tunnel(item, params, info):
- if not info:
- return 3, "SNMP Data for VPN Tunnel Missing"
+ tunnel_not_found_state = params.get('state', 2) # default error state
- tunnels = params.get('tunnels',[])
- tunnel_alias = ""
- if not params.get('state'):
- tunnel_worst_state = 2
- else:
- tunnel_worst_state = params.get('state')
- if item in [tunnel[0] for tunnel in tunnels]:
- if tunnel[1]:
- tunnel_alias = " (%s)" % tunnel[1]
- tunnel_worst_state = tunnel[2]
+ # Try to find individual error states by tunnel IP/name
+ tunnel_alias = ""
+ for tunnel in params.get('tunnels', []):
+ if item == tunnel[0]:
+ if tunnel[1]:
+ tunnel_alias = "[%s] " % tunnel[1]
+ tunnel_not_found_state = tunnel[2]
- extra_info = ""
- state = 0
if [item] not in info:
- extra_info = " - Tunnel is missing"
- state = tunnel_worst_state
-
- result = "%s%s%s" % (item, tunnel_alias, extra_info)
- return state, result
+ return tunnel_not_found_state, "%sTunnel is missing" % tunnel_alias
+ else:
+ return state, "%sTunnel is OK" % tunnel_alias
check_info["cisco_vpn_tunnel"] = {
"check_function" : check_cisco_vpn_tunnel,
@@ -67,4 +59,3 @@ check_info["cisco_vpn_tunnel"] = {
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.1.0").lower().startswith("cisco adaptive security"),
"snmp_info" : ( ".1.3.6.1.4.1.9.9.171.1.2.3.1", [ 7 ] ),
}
-
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index c357cb9..860c29a 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1596,25 +1596,29 @@ register_check_parameters(
title = ("VPN Tunnel Endpoints"),
elements = [
IPv4Address(
- title = _("IP-Address of Tunnel Endpoint"),
+ title = _("IP-Address or Name of Tunnel Endpoint"),
+ help = _("The configured value must match a tunnel reported by the monitored "
+ "device."),
allow_empty = False,
- ),
+ ),
TextAscii(
- title = _("Name of Tunnel"),
- ),
+ title = _("Tunnel Alias"),
+ help = _("You can configure an individual alias here for the tunnel matching "
+ "the IP-Address or Name configured in the field above."),
+ ),
MonitoringState(
default_value = 2,
- title = _("State if this tunnel is not found"),
+ title = _("State if tunnel is not found"),
)]),
- add_label = _("Add another Tunnel"),
+ add_label = _("Add tunnel"),
movable = False,
- title = _("VPN Tunnel"),
+ title = _("VPN tunnel specific configuration"),
)),
( "state",
MonitoringState(
- title = _("Default state if inventorized, unregistered tunnel is not found"),
- help = _("Default state if a tunnel, which was inventorized but is not listed in this rule, "
- "is not longer present in the snmp data"),
+ title = _("Default state to report when tunnel can not be found anymore"),
+ help = _("Default state if a tunnel, which is not listed above in this rule, "
+ "can no longer be found."),
),
),
],
Module: check_mk
Branch: master
Commit: 7ee869cc787290296dd8e791e881160a5d84a35d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7ee869cc787290…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 18:01:46 2014 +0100
#1655 FIX AIX Agent: Fixed broken filesystem checks when having PowerHA installed
When installing PowerHA, a new filesystem is /aha is created and reported by
the Check_MK agent. This line seems useless and causes trouble duing checking.
We excluded this line now in the agent.
---
.werks/1655 | 11 +++++++++++
ChangeLog | 1 +
agents/check_mk_agent.hpux | 2 +-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/1655 b/.werks/1655
new file mode 100644
index 0000000..0dd1e13
--- /dev/null
+++ b/.werks/1655
@@ -0,0 +1,11 @@
+Title: AIX Agent: Fixed broken filesystem checks when having PowerHA installed
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417712407
+Class: fix
+
+When installing PowerHA, a new filesystem is /aha is created and reported by
+the Check_MK agent. This line seems useless and causes trouble duing checking.
+We excluded this line now in the agent.
diff --git a/ChangeLog b/ChangeLog
index 7dd3850..6f34768 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -107,6 +107,7 @@
* 1652 FIX: kaspersky_av_quarantine: Fixed exception when a file was found in quarantine
* 1653 FIX: megaraid_pdisks: Resulting states are now hard coded within the check...
* 1654 FIX: statgrab_disk: Fixed scaling of values shown in PNP graphs...
+ * 1655 FIX: AIX Agent: Fixed broken filesystem checks when having PowerHA installed...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/check_mk_agent.hpux b/agents/check_mk_agent.hpux
index b47f23b..a355ff9 100755
--- a/agents/check_mk_agent.hpux
+++ b/agents/check_mk_agent.hpux
@@ -58,7 +58,7 @@ echo AgentDirectory: $MK_CONFDIR
# modern systems with vxfs only here. The filesystem type is currently
# not used by the check anyway.
echo '<<<df>>>'
-df -kP -F vxfs | sed 's/ / - /' | awk '/^(.*-.*)$/ { print $0 } /^([^-]+)$/ { printf $0 }' | grep -v ^/proc | grep -v ^Filesystem | grep -v :
+df -kP -F vxfs | sed 's/ / - /' | awk '/^(.*-.*)$/ { print $0 } /^([^-]+)$/ { printf $0 }' | grep -Ev "^/proc|^Filesystem|^/aha|:"
# Process table: HP-UX does not provide a resident size of processes.
# We send a 0 here for RSZ.
Module: check_mk
Branch: master
Commit: 0cd9cccae40516d008678a3c0bc87b0fe75ea806
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0cd9cccae40516…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 17:56:41 2014 +0100
Renamed inventory to service discovery in some places
---
web/htdocs/wato.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4e72df9..9e2cf6f 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -844,7 +844,7 @@ def mode_folder(phase):
html.context_button(_("New cluster"), make_link([("mode", "newcluster")]), "new_cluster")
html.context_button(_("Bulk Import"), make_link_to([("mode", "bulk_import")], g_folder), "bulk_import")
if config.may("wato.services"):
- html.context_button(_("Bulk Inventory"), make_link([("mode", "bulkinventory"), ("all", "1")]),
+ html.context_button(_("Bulk Discovery"), make_link([("mode", "bulkinventory"), ("all", "1")]),
"inventory")
if not g_folder.get(".lock_hosts") and config.may("wato.parentscan") and auth_write:
html.context_button(_("Parent scan"), make_link([("mode", "parentscan"), ("all", "1")]),
@@ -1353,7 +1353,7 @@ def show_hosts(folder):
html.button("_bulk_edit", _("Edit"))
html.button("_bulk_cleanup", _("Cleanup"))
if config.may("wato.services"):
- html.button("_bulk_inventory", _("Inventory"))
+ html.button("_bulk_inventory", _("Discovery"))
if not g_folder.get(".lock_hosts"):
if config.may("wato.parentscan"):
html.button("_parentscan", _("Parentscan"))
@@ -1442,11 +1442,11 @@ def show_hosts(folder):
html.icon_button(edit_url, _("Edit the properties of this host"), "edit")
html.icon_button(params_url, _("View the rule based parameters of this host"), "rulesets")
if check_host_permissions(hostname, False) == True:
- msg = _("Edit the services of this host, do an inventory")
+ msg = _("Edit the services of this host, do a service discovery")
image = "services"
if host.get("inventory_failed"):
image = "inventory_failed"
- msg += ". " + _("The inventory of this host failed during a previous bulk inventory.")
+ msg += ". " + _("The service discovery of this host failed during a previous bulk service discovery.")
html.icon_button(services_url, msg, image)
if not g_folder.get(".lock_hosts") and config.may("wato.manage_hosts"):
if config.may("wato.clone_hosts"):
@@ -2066,8 +2066,8 @@ def mode_edithost(phase, new, cluster):
return
elif new:
if host.get('tag_agent') != 'ping':
- create_result = 'folder', _('Successfully created the host. Now you should do an '
- '<a href="%s">inventory</a> in order to auto-configure '
+ create_result = 'folder', _('Successfully created the host. Now you should do a '
+ '<a href="%s">service discovery</a> in order to auto-configure '
'all services to be checked on this host.') % \
make_link([("mode", "inventory"), ("host", hostname)])
else:
@@ -2592,7 +2592,7 @@ def mode_object_parameters(phase):
rulespec = g_rulespecs.get("static_checks:" + checkgroup)
if rulespec:
url = make_link([('mode', 'edit_ruleset'), ('varname', "static_checks:" + checkgroup), ('host', hostname)])
- render_rule_reason(_("Parameters"), url, _("Determined by inventory"), None, False,
+ render_rule_reason(_("Parameters"), url, _("Determined by discovery"), None, False,
rulespec["valuespec"]._elements[2].value_to_text(serviceinfo["parameters"]))
else:
render_rule_reason(_("Parameters"), None, "", "", True, _("This check is not configurable via WATO"))
@@ -3683,7 +3683,7 @@ def mode_bulk_import(phase):
def mode_bulk_inventory(phase):
if phase == "title":
- return _("Bulk service detection (inventory)")
+ return _("Bulk Service Discovery")
elif phase == "buttons":
html.context_button(_("Folder"), make_link([("mode", "folder")]), "back")
@@ -3693,8 +3693,8 @@ def mode_bulk_inventory(phase):
if html.var("_item"):
if not html.check_transaction():
html.write(repr([ 'failed', 0, 0, 0, 0, 0, 0, ]) + "\n")
- html.write(_("Error during inventory: Maximum number of retries reached. "
- "You need to restart the bulk inventory"))
+ html.write(_("Error during discovery: Maximum number of retries reached. "
+ "You need to restart the bulk service discovery"))
return ""
how = html.var("how")
@@ -3842,7 +3842,7 @@ def mode_bulk_inventory(phase):
# Start interactive progress
interactive_progress(
items,
- _("Bulk inventory"), # title
+ _("Bulk Service Discovery"), # title
[ (_("Total hosts"), 0),
(_("Failed hosts"), 0),
(_("Services added"), 0),
Module: check_mk
Branch: master
Commit: 9646b269984c0046bb5578f4eeece3c29dde3350
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9646b269984c00…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Dec 4 18:53:04 2014 +0100
#1636 Crash checks now have an icon for viewing and sending a crash dump
If a check crashed because invalid output from agent, invalid check
parameters or a bug in the implementation of the check, then Check_MK
now creates a crash report for the according service in the directory
<tt>var/check_mk/crashed_checks/</tt>HOST<tt>/</tt>SERVICE. In this directory
there is one informational file and the output from the agent (Check_MK agent
or SNMP). This data is then packed into a tarball, base64 encoded and added
as a long plugin output to the check.
Multisite has a new icon for displaying that data and for submitting
a bug report via email.
---
.werks/1636 | 18 ++++++
ChangeLog | 1 +
checks/cpu | 1 +
modules/check_mk.py | 10 ++--
modules/check_mk_base.py | 75 +++++++++++++----------
web/htdocs/crashed_check.py | 90 ++++++++++++++++++++++++++++
web/htdocs/images/icon_crash.png | Bin 0 -> 2803 bytes
web/htdocs/images/icon_crash_glow.png | Bin 0 -> 3395 bytes
web/htdocs/images/icon_email.png | Bin 0 -> 2465 bytes
web/htdocs/pages.css | 11 ++++
web/plugins/icons/builtin.py | 26 ++++++++
web/plugins/pages/shipped.py | 7 ++-
web/plugins/wato/check_mk_configuration.py | 16 -----
13 files changed, 201 insertions(+), 54 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=9646b26998…
Module: check_mk
Branch: master
Commit: 730d4f8d877935f9f627e61abec039fc134fcbc0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=730d4f8d877935…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Dec 4 16:23:41 2014 +0100
#1599 check_mk_agent.aix: Simple run_cached Feature for plugins
Like in the Linux and Solaris Agent, it's no possible to create subfolders in the plugin folder with a number as name, who represents the cache time for
the contained plugins in minutes.
---
.werks/1599 | 11 +++++++++++
ChangeLog | 7 ++++---
agents/check_mk_agent.aix | 47 +++++++++++++++++++++++++++++++++++++++++----
3 files changed, 58 insertions(+), 7 deletions(-)
diff --git a/.werks/1599 b/.werks/1599
new file mode 100644
index 0000000..1b36048
--- /dev/null
+++ b/.werks/1599
@@ -0,0 +1,11 @@
+Title: check_mk_agent.aix: Simple run_cached Feature for plugins
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417706510
+Class: feature
+
+Like in the Linux and Solaris Agent, it's no possible to create subfolders in the plugin folder with a number as name, who represents the cache time for
+the contained plugins in minutes.
+
diff --git a/ChangeLog b/ChangeLog
index dbb37c0..7d13f6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,11 +48,12 @@
* 1616 drbd: Added support for Ahead/Behind cluster states (DRBD >= 8.3.10)
* 1626 Renamed service descriptions of filesystem, process and logwatch checks...
* 1627 megaraid_ldisks: Warn if current cache or write policy differs from logical drive default policy...
- * 1597 bluecat_dhcp, bluecat_dns: Checks can now be used in Check_MK Cluster Mode
* 1629 check_mk_agent.freebsd: several new features and improvements, now only use statgrab...
* 1630 smart: update in plugin that also outputs information about disks attached to a MegaRAID controller...
* 1631 juniper_bgp_state: check now detects and supports more differen device models...
* 1645 Added basic kernel section to FreeBSD agent...
+ * 1597 bluecat_dhcp, bluecat_dns: Checks can now be used in Check_MK Cluster Mode
+ * 1599 check_mk_agent.aix: Simple run_cached Feature for plugins...
* 1478 FIX: kernel.util, statgrab_cpu: fix computation of utilization...
* 1480 FIX: brocade_vdx_status: disable check on some devices that do not support it...
* 1485 FIX: dell_om_disks, dell_om_esmlog, dell_om_mem, dell_om_processors, dell_om_sensors: detect more devices...
@@ -95,12 +96,12 @@
* 1617 FIX: lnx_if: Deal with data provided by cluster host
* 1618 FIX: ad_replication: Output of timeLastSuccess and timeLastFailure was inverted...
* 1623 FIX: hp_proliant_mem: support for some yet unhandled status situations
- * 1598 FIX: bluecat_dhcp: Check is not longer found in inventory if dhcp service is not activated
* 1640 FIX: check_jolokia_metrics_serv_req: Fixed wrong levels shown for upper thresholds
- * 1453 FIX: drbd.stats: tried to send non-numeric write order parameter to rrd...
* 1632 FIX: hr_fs: remove ugly "mounted on:" information appearing on Juniper devices
* 1646 FIX: hyperv_vms: Plugin garbles following plugin output when no VMs exist...
* 1647 FIX: agent_ipmi: Check_MK service gets critical now when ipmi-sensors command fails
+ * 1453 FIX: drbd.stats: tried to send non-numeric write order parameter to rrd...
+ * 1598 FIX: bluecat_dhcp: Check is not longer found in inventory if dhcp service is not activated
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index 7ae1c61..5f92d63 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -27,8 +27,8 @@
export LC_ALL=C
unset LANG
-export MK_LIBDIR="/to/be/changed"
-export MK_CONFDIR="/to/be/changed"
+export MK_LIBDIR="/usr/check_mk/lib"
+export MK_CONFDIR="/usr/check_mk/conf"
# All executables in PLUGINSDIR will simply be executed and their
# ouput appended to the output of the agent. Plugins define their own
@@ -54,7 +54,7 @@ fi
# Shell version of the waitmax utility, that limits the runtime of
# commands. This version does not conserve the original exit code
# of the command. It is successfull if the command terminated
-# in time.
+ # in time.
function waitmax
{
TIMEOUT=${1}0
@@ -81,8 +81,36 @@ function waitmax
return 255
}
+function run_cached {
+ NAME=$1
+ MAXAGE=$2
+ shift 2
+ CMDLINE=$*
+ MAXAGE=$MAXAGE*60
+
+ CACHE_FILE=/tmp/$NAME.cache
+
+ USE_CACHE_FILE=""
+ # Check if file exists and is recent enough
+ if [ -s $CACHE_FILE ]
+ then
+ MTIME=$(/usr/bin/perl -e 'if (! -f $ARGV[0]){die "0000000"};$mtime=(stat($ARGV[0]))[9];print ($^T-$mtime);' $CACHE_FILE )
+ if (( $MTIME < $MAXAGE )) ; then
+ USE_CACHE_FILE=1
+ fi
+ fi
+ if [ -s "$CACHE_FILE" ]
+ then
+ cat $CACHE_FILE
+ fi
+ if [ -z "$USE_CACHE_FILE" -a ! -e "$CACHE_FILE.new" ]
+ then
+ nohup sh -c $CMDLINE > $CACHE_FILE.new 2> /dev/null && mv $CACHE_FILE.new $CACHE_FILE &
+ fi
+}
+
echo '<<<check_mk>>>'
-echo Version: 1.2.5i7
+echo Version: 2014.12.01
echo AgentOS: aix
echo '<<<df>>>'
@@ -189,6 +217,13 @@ then
./$skript
fi
done
+
+ # Call some plugins only every X'th second
+ for skript in [1-9]*/* ; do
+ if [ -x "$skript" ] ; then
+ run_cached plugins_${skript//\//\#} ${skript%/*} "$skript"
+ fi
+ done
fi
@@ -201,6 +236,7 @@ then
./$skript
fi
done
+
fi
# MK's Remote Plugin Executor
@@ -215,3 +251,6 @@ then
echo "(${PLUGIN##*/}) $descr $? $OUTPUT"
done
fi
+
+
+