Module: check_mk
Branch: master
Commit: 0eb634360333fb53df7a5d13ceffc62e886851d0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0eb634360333fb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Feb 17 12:25:41 2013 +0100
new special agent agent_random for creating random monitoring data
---
ChangeLog | 16 ++++++---
.../ds_random => agents/special/agent_random | 0
checks/agent_random | 37 ++++++++++++++++++++
checks/agent_vsphere | 2 +-
modules/check_mk.py | 2 +-
web/plugins/wato/datasource_programs.py | 12 ++++++
6 files changed, 62 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 78c2152..30e30e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,20 @@
1.2.3i1:
Core:
- * New feature: agents can send data for other hosts
- "piggyback".
+ * Agents can send data for other hosts "piggyback". This is being
+ used by the vSphere and SAP plugins
Event Console:
- * New rule feature: automatically delete after action
+ * New rule feature: automatically delete event after actions
Checks & Agents:
- * Add: Memory and Swap for Solaris Agent
- * Add: Monitoring of ESX (VMware) Hosts
+ * solaris_mem: New check for memory and swap for Solaris agent
+ * New special agent agent_vsphere for monitoring ESX (VMware) Hosts
+ via vSphere interface
+ * new special agent agent_random for creating random monitoring data
+
+ WATO:
+ * Configuration of datasource programs via dedicated rules
+
1.2.2b3
Checks & Agents:
diff --git a/doc/treasures/ds_random b/agents/special/agent_random
similarity index 100%
rename from doc/treasures/ds_random
rename to agents/special/agent_random
diff --git a/checks/agent_random b/checks/agent_random
new file mode 100644
index 0000000..6f4d0a2
--- /dev/null
+++ b/checks/agent_random
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+# {
+# 'tcp_port': 4711,
+# 'secret': 'wef',
+# 'infos': ['hostsystem', 'virtualmachine'],
+# 'user': 'wefwef'
+# }
+
+def agent_random_arguments(params, hostname, ipaddress):
+ return hostname
+
+special_agent_info['random'] = agent_random_arguments
diff --git a/checks/agent_vsphere b/checks/agent_vsphere
index 5c29668..ac403cc 100644
--- a/checks/agent_vsphere
+++ b/checks/agent_vsphere
@@ -31,7 +31,7 @@
# 'user': 'wefwef'
# }
-def agent_vsphere_arguments(params, ipaddress):
+def agent_vsphere_arguments(params, hostname, ipaddress):
args = ''
if "tcp_port" in params:
args += " -p %d" % params["tcp_port"]
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 7a1ff6c..9c95f10 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1002,7 +1002,7 @@ def get_datasource_program(hostname, ipaddress):
params = host_extra_conf(hostname, ruleset)
if params: # rule match!
# Create command line using the special_agent_info
- cmd_arguments = special_agent_info[agentname](params[0], ipaddress)
+ cmd_arguments = special_agent_info[agentname](params[0], hostname,
ipaddress)
return '%s/agent_%s %s' % ( special_agent_dir, agentname,
cmd_arguments)
programs = host_extra_conf(hostname, datasource_programs)
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index 621d5e5..ed0b4d1 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -82,3 +82,15 @@ register_rule(group,
match = 'first')
+register_rule(group,
+ "special_agents:random",
+ FixedValue(
+ {},
+ title = _("Create random monitoring data"),
+ help = _("By configuring this rule for a host - instead of the normal
"
+ "Check_MK agent random monitoring data will be created."),
+ totext = _("No configuration neccessary."),
+ ),
+ match = 'first')
+
+