Module: check_mk
Branch: master
Commit: 28a8a979bf5dc53e89425c49740b0283012e7338
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=28a8a979bf5dc5…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Fri Feb 21 12:49:57 2014 +0100
FIX agent_vsphere: special agent now handles non-standard https port correctly
The special agent vsphere to monitor ESX-Servers and vcenters can be configured to use a
non-standard port for the vsphere https connection. This might be useful for firewall
traversals etc.
The configuration was possible before this fix in WATO, but it was never used, so that the
default https port 443 was always used.
With this fix the port which is actually configured in WATO will be used for https.
If a vcenter is queried including the check_mk_agent, the check_mk_agent will still be queried
on the standard check_mk_agent port 6556, whereas the https connection port will be the one
configured in WATO.
---
.werks/584 | 19 +++++++++++++++++++
ChangeLog | 1 +
agents/special/agent_vsphere | 16 ++++++++++------
agents/special/agent_vsphere.pysphere | 18 ++++++++++++------
checks/agent_vsphere | 4 ++--
web/plugins/wato/datasource_programs.py | 4 ++--
6 files changed, 46 insertions(+), 16 deletions(-)
diff --git a/.werks/584 b/.werks/584
new file mode 100644
index 0000000..f825ce5
--- /dev/null
+++ b/.werks/584
@@ -0,0 +1,19 @@
+Title: agent_vsphere: special agent now handles non-standard https port correctly
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1392982760
+Class: fix
+
+The special agent vsphere to monitor ESX-Servers and vcenters can be configured to use a
+non-standard port for the vsphere https connection. This might be useful for firewall
+traversals etc.
+
+The configuration was possible before this fix in WATO, but it was never used, so that the
+default https port 443 was always used.
+
+With this fix the port which is actually configured in WATO will be used for https.
+
+If a vcenter is queried including the check_mk_agent, the check_mk_agent will still be queried
+on the standard check_mk_agent port 6556, whereas the https connection port will be the one
+configured in WATO.
diff --git a/ChangeLog b/ChangeLog
index cec9e42..fd5d37b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -182,6 +182,7 @@
* 0557 FIX: check_mk_agent.solaris: removed section statgrab mem...
* 0673 FIX: zfsget: Fixed broken check - was not compatible to current agent output of "df"
* 0719 FIX: postfix_mailq: fix Linux agent in case of ssmtp being installed
+ * 0584 FIX: agent_vsphere: special agent now handles non-standard https port correctly...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index b1ddcea..69f72ae 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -130,9 +130,10 @@ OPTIONS:
-D, --direct Assume a directly queried host system (no vCenter). In
This we expect data about only one HostSystem to be
found and do not create piggy host data for that host.
- -p Skip placeholder virtualmachines. These backup vms are created
+ -P Skip placeholder virtualmachines. These backup vms are created
by the Site Recovery Manager (SRM) and are identified by not
having any assigned virtual disks.
+ -p, --port port Alternative port number (default is 443 for the https connection)
--pysphere Fallback to old pysphere based special agent. It supports
ESX 4.1 but is very slow.
-H, --hostname Specify a hostname. This is neccessary if this is
@@ -159,10 +160,10 @@ OPTIONS:
""")
-short_options = 'hi:u:s:Dat:H:cp'
+short_options = 'hi:u:s:Dat:H:cPp:'
long_options = [
'help', 'user=', 'secret=', 'direct', 'agent', 'debug', 'modules=', 'timeout=', 'hostname=',
- 'dump-counters', 'tracefile=', "pysphere",
+ 'dump-counters', 'tracefile=', "pysphere", "port=",
]
opt_debug = False
@@ -170,6 +171,7 @@ opt_direct = False
opt_agent = False
opt_dump_counters = False
opt_timeout = 60
+opt_port = 443
opt_hostname = None
opt_skip_placeholder_vm = False
opt_pysphere = False
@@ -199,8 +201,10 @@ for o,a in opts:
opt_direct = True
elif o in [ '-a', '--agent' ]:
opt_agent = True
- elif o == '-p':
+ elif o == '-P':
opt_skip_placeholder_vm = True
+ elif o in [ '-p', '--port' ]:
+ opt_port = a
elif o == '--pysphere':
opt_pysphere = True
elif o in [ '-u', '--user' ]:
@@ -303,7 +307,7 @@ if tracefile:
try:
my_cookie = None
- netloc = host_address
+ netloc = host_address + ":" + str(opt_port)
request_uri = "/sdk"
transport = httplib.HTTPSConnection
transdict = {'timeout': opt_timeout}
@@ -311,7 +315,7 @@ try:
handle.connect()
if opt_debug:
- sys.stderr.write("Connecting to %s..." % host_address)
+ sys.stderr.write("Connecting to %s..." % netloc)
sys.stderr.flush()
def query_server(soapdata):
diff --git a/agents/special/agent_vsphere.pysphere b/agents/special/agent_vsphere.pysphere
index ece7318..e2a4039 100755
--- a/agents/special/agent_vsphere.pysphere
+++ b/agents/special/agent_vsphere.pysphere
@@ -53,9 +53,10 @@ OPTIONS:
-D, --direct Assume a directly queried host system (no vCenter). In
This we expect data about only one HostSystem to be
Found and do not create piggy host data for that host.
- -p Skip placeholder virtualmachines. These backup vms are created
+ -P Skip placeholder virtualmachines. These backup vms are created
by the Site Recovery Manager (SRM) and are identified by not
having any assigned virtual disks.
+ -p, --port port Alternative port number (default is 443 for the https connection)
--pysphere Does nothing. For compatibility with new agent.
-H, --hostname Specify a hostname. This is neccessary if this is
different from HOST. It is being used in --direct
@@ -87,10 +88,10 @@ OPTIONS:
""")
-short_options = 'hi:u:s:Dat:H:cpS:'
+short_options = 'hi:u:s:Dat:H:cPp:S:'
long_options = [
'help', 'user=', 'secret=', 'direct', 'agent', 'debug', 'modules=', 'timeout=', 'hostname=',
- 'dump-counters', 'profile', 'pysphere', 'spaces='
+ 'dump-counters', 'profile', 'pysphere', 'spaces=', 'port='
]
try:
@@ -104,6 +105,7 @@ opt_direct = False
opt_agent = False
opt_dump_counters = False
opt_timeout = 60
+opt_port = 443
opt_hostname = None
opt_skip_placeholder_vm = False
opt_spaces = "cut"
@@ -127,8 +129,10 @@ for o,a in opts:
opt_direct = True
elif o in [ '-a', '--agent' ]:
opt_agent = True
- elif o in [ '-p' ]:
+ elif o in [ '-P' ]:
opt_skip_placeholder_vm = True
+ elif o in [ '-p', '--port' ]:
+ opt_port = a
elif o in [ '-u', '--user' ]:
user = a
elif o in [ '-s', '--secret' ]:
@@ -159,6 +163,8 @@ else:
sys.stderr.write("ERROR: Please specify exactly one host.\n")
sys.exit(1)
+port = ":" + str(opt_port)
+
socket.setdefaulttimeout(opt_timeout)
def get_agent_info_tcp(hostname):
@@ -215,9 +221,9 @@ try:
# server. Details can be found here:
# http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim…)
if opt_debug:
- sys.stderr.write("Connecting to %s..." % host_address)
+ sys.stderr.write("Connecting to %s%s..." % (host_address, port))
sys.stderr.flush()
- host.connect(host_address, user, secret, sock_timeout=opt_timeout)
+ host.connect(host_address+port, user, secret, sock_timeout=opt_timeout)
if opt_debug:
sys.stderr.write("Connected.\n")
except socket.timeout:
diff --git a/checks/agent_vsphere b/checks/agent_vsphere
index e83c251..c917b39 100644
--- a/checks/agent_vsphere
+++ b/checks/agent_vsphere
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
# {
-# 'tcp_port': 4711,
+# 'tcp_port': 443,
# 'secret': 'wef',
# 'infos': ['hostsystem', 'virtualmachine'],
# 'user': 'wefwef'
@@ -48,7 +48,7 @@ def agent_vsphere_arguments(params, hostname, ipaddress):
args += ' --direct --hostname ' + quote_shell_string(hostname)
if params.get("skip_placeholder_vms", True):
- args += " -p"
+ args += " -P"
if "timeout" in params:
args += ' --timeout %d' % params["timeout"]
diff --git a/web/plugins/wato/datasource_programs.py b/web/plugins/wato/datasource_programs.py
index 9989cbc..7b40e19 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -64,8 +64,8 @@ register_rule(group,
( "tcp_port",
Integer(
title = _("TCP Port number"),
- help = _("Port number for connecting to vSphere"),
- default_value = 4711,
+ help = _("Port number for https connection to vSphere"),
+ default_value = 443,
minvalue = 1,
maxvalue = 65535,
)
Module: check_mk
Branch: master
Commit: c719ad1122cfd5812beeb7d6ed960d383b2813cd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c719ad1122cfd5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Feb 20 12:08:10 2014 +0100
check_mk_agent.solaris: report statgrab_mem section if solaris_mem section is missing
Some older solaris machines do not have /usr/bin/top, which is required by <tt><<<solaris_mem>>></tt>.
In this case we report the deprecated (but still supported section) <tt><<<statgrab_mem>>></tt>.
---
.werks/560 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 10 +++++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/560 b/.werks/560
new file mode 100644
index 0000000..8e04f47
--- /dev/null
+++ b/.werks/560
@@ -0,0 +1,9 @@
+Title: check_mk_agent.solaris: report statgrab_mem section if solaris_mem section is missing
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392894310
+Class: feature
+
+Some older solaris machines do not have /usr/bin/top, which is required by <tt><<<solaris_mem>>></tt>.
+In this case we report the deprecated (but still supported section) <tt><<<statgrab_mem>>></tt>.
diff --git a/ChangeLog b/ChangeLog
index 1647f07..4938048 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,7 @@
* 0718 logwatch.ec: Optionally monitor the list of forwarded logfiles...
* 0556 esx_vsphere_counters.diskio: now also shows disk latency
* 0583 stulz_pump: now monitors the pumps rpm in precent of maximum and gathers performance data
+ * 0560 check_mk_agent.solaris: report statgrab_mem section if solaris_mem section is missing...
* 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.solaris b/agents/check_mk_agent.solaris
index 20a2c51..a1a328e 100644
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -158,9 +158,13 @@ then
grep "^$s\." /tmp/statgrab.$$ | cut -d. -f2-99 | sed 's/ *= */ /'
done
-# this info is already provided by solaris_mem
-# echo '<<<statgrab_mem>>>'
-# egrep "^(swap|mem)\." /tmp/statgrab.$$ | sed 's/ *= */ /'
+ # the <<<statgrab_mem>>> info is already provided by <<<solaris_mem>>>
+ # However, we make an exception if /usr/bin/top is missing (required by solaris_mem)
+ if [ ! -x /usr/bin/top ]
+ then
+ echo '<<<statgrab_mem>>>'
+ egrep "^(swap|mem)\." /tmp/statgrab.$$ | sed 's/ *= */ /'
+ fi
[ -f /tmp/statgrab.$$ ] && rm -f /tmp/statgrab.$$
fi
Module: check_mk
Branch: master
Commit: f9cfe41b77a58960073ad933b1565ef02b32acf6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f9cfe41b77a589…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Feb 20 11:35:47 2014 +0100
FIX WATO snapshots: improved validation of (uploaded) snapshots
Some new validation features have been added<br>
<ul>
<li>Only tar and tar.gz files can be uploaded</li>
<li>It is checked if the file size if reasonable</li>
<li>It is checked if the content of the tarfile 'looks' OK (real check is done later)</li>
</ul>
Upon restoring the snapshot, an additional integrity check is done for
each of the subtar files. If this check fails, e.g. some tar.gz is corrupted,
the snapshot won't get applied and an error message is raised.
Conflicts:
ChangeLog
web/htdocs/wato.py
---
.werks/559 | 19 ++++++
ChangeLog | 1 +
web/htdocs/multitar.py | 33 ++++++---
web/htdocs/wato.py | 173 +++++++++++++++++++++++++++++++-----------------
4 files changed, 153 insertions(+), 73 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=f9cfe41b77…
Module: check_mk
Branch: master
Commit: b6b9714679adf6b5a361fc85e470fe7949cbedf4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6b9714679adf6…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Feb 20 11:09:46 2014 +0100
stulz_pump: now monitors the pumps rpm in precent of maximum and gathers performance data
---
.werks/583 | 8 ++++++++
ChangeLog | 1 +
checkman/stulz_pump | 5 ++++-
checks/stulz_pump | 20 ++++++++++++++------
4 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/.werks/583 b/.werks/583
new file mode 100644
index 0000000..679143a
--- /dev/null
+++ b/.werks/583
@@ -0,0 +1,8 @@
+Title: stulz_pump: now monitors the pumps rpm in precent of maximum and gathers performance data
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392890913
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index b6a9640..cec9e42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,6 +91,7 @@
* 0581 emc_datadomain_disks emc_datadomain_fs: new checks to monitor disks and filesystems of EMC Datadomain
* 0718 logwatch.ec: Optionally monitor the list of forwarded logfiles...
* 0556 esx_vsphere_counters.diskio: now also shows disk latency
+ * 0583 stulz_pump: now monitors the pumps rpm in precent of maximum and gathers performance data
* 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/checkman/stulz_pump b/checkman/stulz_pump
index 857c851..2ebe48e 100644
--- a/checkman/stulz_pump
+++ b/checkman/stulz_pump
@@ -4,8 +4,11 @@ catalog: hw/environment/stulz
license: GPL
distribution: check_mk
description:
- This plugin checks the status of pumps of Stulz clima units. Returns
+ This plugin checks the status and RPM of pumps of Stulz clima units. It 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 e3e6ec2..3268d3b 100644
--- a/checks/stulz_pump
+++ b/checks/stulz_pump
@@ -26,28 +26,36 @@
def inventory_stulz_pump(info):
inventory = []
- for pump_id, pump_status in info:
+ for pump_id, pump_status in info[0]:
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:
+ for pump_id, pump_status in info[0]:
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':
- return 0, "Pump is running"
+ state = 0
+ infotext = "Pump is running at %s%%" % pump_rpm
elif pump_status == '0':
- return 2, "Pump is not running"
+ state = 2
+ infotext = "Pump is not running"
else:
- return 3, "Pump reports unidentified status " + pump_status
+ state = 3
+ infotext = "Pump reports unidentified status " + pump_status
+ return state, infotext, perfdata
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] ),
+ "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] ),]
}