Module: check_mk
Branch: master
Commit: 655ef40e34d0874bb29a5ba1ac1a350fcec82d61
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=655ef40e34d087…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 27 13:21:56 2015 +0100
Etliche Texte repariert
---
mkeventd/web/plugins/wato/mkeventd.py | 12 ++++++------
web/plugins/wato/check_parameters.py | 8 ++++----
web/plugins/webapi/webapi.py | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/mkeventd/web/plugins/wato/mkeventd.py b/mkeventd/web/plugins/wato/mkeventd.py
index 1f3cff3..235e330 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -2137,13 +2137,13 @@ register_rule(
FixedValue(
True,
title = _("Less Verbose Output"),
- help = _("If enabled the check reports less information in its output.<br>"
- "You will see no information regarding the worst state or unacknowledged events.<br>"
- " For example a default output without this option <br>"
- "<tt>WARN - 1 events (1 unacknowledged), worst state is WARN (Last line: Incomplete Content)</tt><br>"
- "Output with less verbosity<br>"
+ help = _("If enabled the check reports less information in its output. "
+ "You will see no information regarding the worst state or unacknowledged events. "
+ " For example a default output without this option is "
+ "<tt>WARN - 1 events (1 unacknowledged), worst state is WARN (Last line: Incomplete Content)</tt>."
+ "Output with less verbosity: "
"<tt>WARN - 1 events (Worst line: Incomplete Content)</tt><br>"
- ),
+ ),
)
),
( "remote",
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index d3e87f0..e43fd27 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1562,7 +1562,7 @@ register_check_parameters(
),
]
),
- TextAscii(title = _("ID of the Channel (usually ranging from 1)")),
+ TextAscii(title = _("ID of the channel (usually ranging from 1)")),
"dict"
)
@@ -1574,7 +1574,7 @@ register_check_parameters(
elements = [
( "error_states", ListChoice(
title = _("Modem States that lead to a critical state"),
- help = _("If one of the selected state occur, the check will repsond with a Critical state "),
+ help = _("If one of the selected states occurs the check will repsond with a critical state "),
choices = [
( 1, "other" ),
( 2, "notReady" ),
@@ -4888,7 +4888,7 @@ register_rule(
label = _("use alias"),
help = _("If a multipath device has an alias then you can use it for specifying "
"the device instead of the UUID. The alias will then be part of the service "
- "description. The UUID will be output in the pluging outpout."))
+ "description. The UUID will be displayed in the pluging output."))
),
],
help = _("This rule controls if the UUID or alias is used in the service description during "
@@ -5104,7 +5104,7 @@ register_check_parameters(
( "cifs", _("CIFS") ),
( "san", _("SAN") ),
( "fcp", _("FCP") ),
- ( "iscsi", _("ISCSI") ),
+ ( "iscsi", _("iSCSI") ),
],
)),
( "magic",
diff --git a/web/plugins/webapi/webapi.py b/web/plugins/webapi/webapi.py
index 8ae630b..ce38c60 100644
--- a/web/plugins/webapi/webapi.py
+++ b/web/plugins/webapi/webapi.py
@@ -48,7 +48,7 @@ api_actions["add_host"] = {
"handler" : action_add_host,
"title" : _("Add a host to WATO"),
"description" : _("This webservice allows you to add a new host."),
- "example_request" : ([("create_folders=1", _("If set to 1(default) create non-existing folders1)"))],
+ "example_request" : ([("create_folders=1", _("If set to 1 (default) create non-existing folders"))],
{ "attributes": {
"tag_criticality": "prod",
"tag_agent": "cmk-agent",
Module: check_mk
Branch: master
Commit: c881346177dca64c5dee76cb9dcaa814c522cc43
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c881346177dca6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 27 11:48:12 2015 +0100
#1880 FIX inventory_processes rules can now be configured without setting levels
Since werk #1563 the levels configured in the rule {inventory_processes} are not
interpreted anymore. If you used this rule to configure process discovery, you
can now leave the last four elements (thresholds) of.
Note: If you use WATO for configuring process discovery, this change does not affect you.
To configure the thresholds, you need to use the {check_parameters} option like
shown in the example below:
F+:etc/check_mk/main.mk
# Old configuration style
inventory_processes += [
( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s", "~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER, 1, 1, 1, 1 ),
]
# new style configuration:
inventory_processes += [
( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s", "~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER),
check_parameters += [
( {'levels' : (1, 1, 1, 1)}, ALL_HOSTS, ['proc_SAP_ora_pmon_.*'] ),
]
F-:
---
.werks/1880 | 33 +++++++++++++++++++++++++++++++++
ChangeLog | 1 +
checks/ps.include | 5 +++--
3 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/.werks/1880 b/.werks/1880
new file mode 100644
index 0000000..184a01a
--- /dev/null
+++ b/.werks/1880
@@ -0,0 +1,33 @@
+Title: inventory_processes rules can now be configured without setting levels
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1422355345
+
+Since werk #1563 the levels configured in the rule {inventory_processes} are not
+interpreted anymore. If you used this rule to configure process discovery, you
+can now leave the last four elements (thresholds) of.
+
+Note: If you use WATO for configuring process discovery, this change does not affect you.
+
+To configure the thresholds, you need to use the {check_parameters} option like
+shown in the example below:
+
+F+:etc/check_mk/main.mk
+# Old configuration style
+inventory_processes += [
+ ( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s", "~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER, 1, 1, 1, 1 ),
+]
+
+# new style configuration:
+
+inventory_processes += [
+ ( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s", "~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER),
+
+check_parameters += [
+ ( {'levels' : (1, 1, 1, 1)}, ALL_HOSTS, ['proc_SAP_ora_pmon_.*'] ),
+]
+F-:
diff --git a/ChangeLog b/ChangeLog
index a5bf6ae..9fe032a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* 1842 FIX: Rewrote implementation of service discovery (formerly inventory)...
* 1869 FIX: Deleting outdated persisted agent sections now
* 1919 FIX: cmk --snmpwalk: continue if one of the OIDs to walk fails
+ * 1880 FIX: inventory_processes rules can now be configured without setting levels...
Checks & Agents:
* 1665 agent_netapp: New special agent for NetApp monitoring via Web-API...
diff --git a/checks/ps.include b/checks/ps.include
index 450e60d..732f12f 100644
--- a/checks/ps.include
+++ b/checks/ps.include
@@ -37,12 +37,13 @@ def inventory_ps_common(invdata, invrules, info):
for inv_entry in invdata:
# New in 1.1.7i1: inventory_processes may be prefixed with list of
# host names or tags + ALL_HOSTS
+ # New in 1.2.6b7: inventory_processes might have no levels specified
tags = None
- if len(inv_entry) == 8:
+ if len(inv_entry) in (4, 8):
tags = []
hostlist = inv_entry[0]
inv_entry = inv_entry[1:]
- elif len(inv_entry) == 9:
+ elif len(inv_entry) in (5, 9):
tags = inv_entry[0]
hostlist = inv_entry[1]
inv_entry = inv_entry[2:]
Module: check_mk
Branch: master
Commit: 6b1492609de040a3a21d8013e28f281d954f7701
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b1492609de040…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 27 09:26:04 2015 +0100
if.include, interface groups: removed needless mingle of data
---
checks/if.include | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/checks/if.include b/checks/if.include
index 882c86d..e460b0f 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -351,11 +351,10 @@ def check_if_common(item, params, info, has_nodeinfo = False):
"", # ifPhysAddress
]
- info.append(group_entry)
# If applicable, signal the check_if_common_single if the counter of the
# given interface has wrapped. Actually a wrap of the if group itself is unlikely,
# however any counter wrap of one of its members causes the accumulation being invalid
- return check_if_common_single(item, params, info, wrapped, has_nodeinfo=has_nodeinfo)
+ return check_if_common_single(item, params, [group_entry], wrapped, has_nodeinfo=has_nodeinfo)
return check_if_common_single(item, params, info, has_nodeinfo=has_nodeinfo)
Module: check_mk
Branch: master
Commit: ed044ce089d3ee7fedd90d5852192f36cd6bac2d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ed044ce089d3ee…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 27 09:17:40 2015 +0100
#1879 FIX Not showing "only show permitted hosts/services" option for users not having "see all" permissions
This option is only meant to reduce the amount of seen hosts/services of a user having the
"see all hosts/services" permission to the hosts/services which the user is really assigned
to. To configure this option makes only sense for users having the "see all" permissions. Now
WATO only shows the checkboxes for these users.
---
.werks/1879 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/config.py | 4 ++--
web/htdocs/wato.py | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/1879 b/.werks/1879
new file mode 100644
index 0000000..1e83f73
--- /dev/null
+++ b/.werks/1879
@@ -0,0 +1,13 @@
+Title: Not showing "only show permitted hosts/services" option for users not having "see all" permissions
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1422346516
+
+This option is only meant to reduce the amount of seen hosts/services of a user having the
+"see all hosts/services" permission to the hosts/services which the user is really assigned
+to. To configure this option makes only sense for users having the "see all" permissions. Now
+WATO only shows the checkboxes for these users.
diff --git a/ChangeLog b/ChangeLog
index 2a10f6c..a5bf6ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -153,6 +153,7 @@
* 1211 FIX: Fixed g_git_messages error on activate changes...
* 1212 FIX: Fixed default value in wato parameter page for timeperiods...
* 1816 FIX: Fixed garbled output on "rename host" result page
+ * 1879 FIX: Not showing "only show permitted hosts/services" option for users not having "see all" permissions...
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host notications
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index feda21c..a07f4bb 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -353,8 +353,8 @@ def may(pname):
user_permissions[pname] = he_may
return he_may
-def user_may(u, pname):
- return may_with_roles(roles_of_user(u), pname)
+def user_may(user_id, pname):
+ return may_with_roles(roles_of_user(user_id), pname)
def need_permission(pname):
if not may(pname):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ffe8f34..9f0d82d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11883,7 +11883,7 @@ def mode_edit_user(phase):
if topic is not None and topic != attr['topic']:
continue # skip attrs of other topics
- if not attr.get("permission") or config.may(attr["permission"]):
+ if not userid or not attr.get("permission") or config.user_may(userid, attr["permission"]):
vs = attr['valuespec']
forms.section(_u(vs.title()))
if attr['user_editable'] and not is_locked(name):
Module: check_mk
Branch: master
Commit: 315b38ecd2e479c1750802eb883f432ac7797de1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=315b38ecd2e479…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 27 08:48:45 2015 +0100
#1878 SEC Fixed possible shell injection when filtering the EC archive
To optimize searches in the Event Console archive files, the event console
uses "grep" to make a fast preselection of history entries. The grep command
is used for different filters, like the "ID of rule". This allows normal logged
in users with only GUI privileges to execute shell commands on the monitoring
host with privileges of the user the Event Console is running with. Normally
this is the sites user in OMD sites or the user nagios.
All currently maintained versions are affected. If you are using an affected
version which we offer no more releases for, you can use the patch of
this Werk to fix the issue for your version.
This issue has been discovered and reported by Christian Thiemann. Thanks!
---
.werks/1878 | 21 +++++++++++++++++++++
ChangeLog | 1 +
mkeventd/bin/mkeventd | 8 ++++----
3 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/.werks/1878 b/.werks/1878
new file mode 100644
index 0000000..cd1826f
--- /dev/null
+++ b/.werks/1878
@@ -0,0 +1,21 @@
+Title: Fixed possible shell injection when filtering the EC archive
+Level: 2
+Component: ec
+Class: security
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1422344183
+
+To optimize searches in the Event Console archive files, the event console
+uses "grep" to make a fast preselection of history entries. The grep command
+is used for different filters, like the "ID of rule". This allows normal logged
+in users with only GUI privileges to execute shell commands on the monitoring
+host with privileges of the user the Event Console is running with. Normally
+this is the sites user in OMD sites or the user nagios.
+
+All currently maintained versions are affected. If you are using an affected
+version which we offer no more releases for, you can use the patch of
+this Werk to fix the issue for your version.
+
+This issue has been discovered and reported by Christian Thiemann. Thanks!
diff --git a/ChangeLog b/ChangeLog
index de4d9a5..2a10f6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -169,6 +169,7 @@
* 1845 Keep record of original source IP address of a syslog message or SNMP trap...
* 1873 SEC: Escaping event text of event console messages correctly in views...
* 1672 Now able to reclassify logwatch messages before forwarding them to the event console...
+ * 1878 SEC: Fixed possible shell injection when filtering the EC archive...
* 1839 FIX: Fix exception when notifying EC alert into monitoring for traps (because PID is missing)
* 1813 FIX: Fixed bug in event console rule editor when no contact groups configured
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index ea452d7..4fb1755 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -847,7 +847,7 @@ def parse_history_file(path, headers, filters, greptexts, limit):
# Revert lines from the log file to have the newer lines processed first
cmd = 'tac "%s"' % path
if greptexts:
- cmd += ' | grep -i -e %s' % ".*".join(greptexts)
+ cmd += " | grep -i -e %s" % quote_shell_string(".*".join(greptexts))
grep = subprocess.Popen(cmd, shell=True, close_fds=True, stdout=subprocess.PIPE)
for line in grep.stdout:
@@ -3215,11 +3215,11 @@ def substitute_event_tags(text, event):
text = text.replace('$%s$' % key.upper(), value)
return text
-def shell_escape(s):
- return s.replace("'", "'\"'\"")
+def quote_shell_string(s):
+ return "'" + s.replace("'", "'\"'\"'") + "'"
def send_email(to, subject, body):
- os.popen("mail -s '%s' '%s'" % (shell_escape(subject), shell_escape(to)), "w").write(body)
+ os.popen("mail -s %s %s" % (quote_shell_string(subject), quote_shell_string(to)), "w").write(body)
def execute_script(body):
p = subprocess.Popen(
Module: check_mk
Branch: master
Commit: 30bcc57fce9c6fec48ece4cc0fc8e5526c532f3e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=30bcc57fce9c6f…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jan 26 16:56:57 2015 +0100
#1675 esx_vsphere_hostsystem.cpu_util_cluster: Averaged CPU utilization of all cluster nodes
This new check allows you to monitor the average CPU utilization over all cluster nodes.
Each node has informations about the total available MHz and the actually used MHz for computing.
The actual usage of a cluster is calculated by the formula <i>(total_used_mhz / total_avail_mhz) * 100</i>
Via WATO you can configure a set of WARN and CRIT levels for specific node counts.
---
.werks/1675 | 13 ++++
ChangeLog | 1 +
checkman/esx_vsphere_hostsystem.cpu_util_cluster | 32 +++++++++
checkman/esx_vsphere_hostsystem.mem_usage_cluster | 5 --
checks/esx_vsphere_hostsystem | 76 +++++++++++++++++++++
web/plugins/wato/check_parameters.py | 29 ++++++++
6 files changed, 151 insertions(+), 5 deletions(-)
diff --git a/.werks/1675 b/.werks/1675
new file mode 100644
index 0000000..07c644a
--- /dev/null
+++ b/.werks/1675
@@ -0,0 +1,13 @@
+Title: esx_vsphere_hostsystem.cpu_util_cluster: Averaged CPU utilization of all cluster nodes
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1422287199
+Class: feature
+
+This new check allows you to monitor the average CPU utilization over all cluster nodes.
+Each node has informations about the total available MHz and the actually used MHz for computing.
+The actual usage of a cluster is calculated by the formula <i>(total_used_mhz / total_avail_mhz) * 100</i>
+
+Via WATO you can configure a set of WARN and CRIT levels for specific node counts.
diff --git a/ChangeLog b/ChangeLog
index ed3e6d1..de4d9a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,7 @@
* 1857 ibm_svc_portsas: new check and extended special agent for IBM SVC / Storwize V3700 / V7000 devices
* 1918 ps: new option for checking the age of a process (on Linux)...
* 1920 df: Linux filesystem check now supports displaying data reserved for root...
+ * 1675 esx_vsphere_hostsystem.cpu_util_cluster: Averaged CPU utilization of all cluster nodes...
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/esx_vsphere_hostsystem.cpu_util_cluster b/checkman/esx_vsphere_hostsystem.cpu_util_cluster
new file mode 100644
index 0000000..2d34c32
--- /dev/null
+++ b/checkman/esx_vsphere_hostsystem.cpu_util_cluster
@@ -0,0 +1,32 @@
+title: VMWare ESX host systems: CPU utilization of clusters
+agents: vsphere
+catalog: os/kernel
+license: GPL
+distribution: check_mk
+description:
+ This check measures the averaged CPU utilization for a cluster of ESX Host systems.
+ You can configure multiple WARN/CRIT levels depending on the number of nodes in this cluster.
+ This check is only applicable for clusters and cannot be inventorized.
+ You need to create a manual check for it in WATO and assign it to a cluster host.
+
+examples:
+ static_checks['cpu_utilization_cluster'] = [
+ ( ('esx_vsphere_hostsystem.cpu_util_cluster', None,
+ [(2, (60.0, 70.0)),
+ (5, (70.0, 80.0)),
+ (7, (85.0, 90.0))
+ ]), [], ['esx_cluster'] ),
+ ] + static_checks['cpu_utilization_cluster']
+
+perfdata:
+ One value: The current usage in percent - ranging from 0 to 100.
+ The "maximum" value is not 100, but the number of CPU threads. This
+ case be used for scaling the graph in terms of the number of used CPU threads.
+
+[parameters]
+parameters (list): A list of tuples where you can define the number of
+ minimum required nodes and the corresponding levels.
+
+ One Element: ( number_of_nodes(int), ( WARN(float), CRIT(float) ) )
+
+ Please refer example.
diff --git a/checkman/esx_vsphere_hostsystem.mem_usage_cluster b/checkman/esx_vsphere_hostsystem.mem_usage_cluster
index 1d019b3..4ab8bd0 100644
--- a/checkman/esx_vsphere_hostsystem.mem_usage_cluster
+++ b/checkman/esx_vsphere_hostsystem.mem_usage_cluster
@@ -17,11 +17,6 @@ examples:
]), [], ['esx_cluster'] ),
] + static_checks['mem_cluster']
-
-
-inventory:
- Not applicable
-
perfdata:
One value: the current total usage in bytes.
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index 7b9a57d..be09a49 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -148,7 +148,83 @@ check_info['esx_vsphere_hostsystem.mem_usage_cluster'] = {
}
+#.
+# .--CPU-Cluster---------------------------------------------------------.
+# | ____ ____ _ _ ____ _ _ |
+# | / ___| _ \| | | | / ___| |_ _ ___| |_ ___ _ __ |
+# | | | | |_) | | | |_____| | | | | | / __| __/ _ \ '__| |
+# | | |___| __/| |_| |_____| |___| | |_| \__ \ || __/ | |
+# | \____|_| \___/ \____|_|\__,_|___/\__\___|_| |
+# | |
+# +----------------------------------------------------------------------+
+
+
+def check_esx_vsphere_hostsystem_cpu_util_cluster(item, params, info):
+ current_node = {}
+ def get_node_usage(node):
+ num_sockets = int(node['hardware.cpuInfo.numCpuPackages'])
+ num_cores = int(node['hardware.cpuInfo.numCpuCores'])
+ num_threads = int(node['hardware.cpuInfo.numCpuThreads'])
+ used_mhz = float(node['summary.quickStats.overallCpuUsage'])
+ mhz_per_core = float(node['hardware.cpuInfo.hz']) / 1024.0 / 1024.0
+ total_mhz = mhz_per_core * num_cores
+ return used_mhz, total_mhz, num_threads
+
+ overall_used = []
+ overall_total = []
+ overall_threads = []
+ for line in info:
+ if line[0] in [ "hardware.cpuInfo.numCpuPackages",
+ "hardware.cpuInfo.numCpuCores",
+ "hardware.cpuInfo.numCpuThreads",
+ "summary.quickStats.overallCpuUsage",
+ "hardware.cpuInfo.hz" ]:
+ current_node[line[0]] = line[1]
+ if len(current_node) == 5: # 5 keys -> node complete
+ node_used, node_total, node_threads = get_node_usage(current_node)
+ overall_used.append(node_used)
+ overall_total.append(node_total)
+ overall_threads.append(node_threads)
+ current_node = {}
+
+
+ sum_used = sum(overall_used)
+ sum_total = sum(overall_total)
+ sum_threads = sum(overall_threads)
+ usage = sum_used / sum_total * 100
+ node_count = len(overall_used)
+
+ # Convert legacy parameters
+ this_time = time.time()
+
+
+ sorted_params = sorted(params, reverse = True)
+ for count, levels in sorted_params:
+ if node_count >= count:
+ state, infotext, perfdata = check_cpu_util(usage, levels)
+ break
+ else:
+ state, infotext, perfdata = check_cpu_util(usage, None)
+ yield 0, "%d Nodes" % node_count
+ yield 0, "%.2fGHz/%.2fGHz" % (sum_used / 1024.0, sum_total / 1024.0)
+ yield 0, "%d threads" % sum_threads
+
+ # put number of threads as MAX value for first perf-data. This
+ # is needed by the PNP template.
+ perfdata_cpu = list(perfdata[0])
+ perfdata_cpu[-1] = sum_threads
+ perfdata = [ tuple(perfdata_cpu) ] + perfdata[1:]
+ yield state, infotext, perfdata
+
+
+check_info['esx_vsphere_hostsystem.cpu_util_cluster'] = {
+ "check_function" : check_esx_vsphere_hostsystem_cpu_util_cluster,
+ "service_description" : "CPU utilization",
+ "group" : "cpu_utilization_cluster",
+ "has_perfdata" : True,
+ "includes" : [ "cpu_util.include" ],
+}
# .--Memory--------------------------------------------------------------.
# | __ __ |
# | | \/ | ___ _ __ ___ ___ _ __ _ _ |
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 7455602..d3e87f0 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2998,6 +2998,35 @@ register_check_parameters(
)
register_check_parameters(
+ subgroup_networking,
+ "cpu_utilization_cluster",
+ _("CPU Utilization of Clusters"),
+ ListOf(
+ Tuple(
+ elements = [
+ Integer(title = _("Equal or more than"), unit = _("nodes")),
+ Tuple(
+ elements = [
+ Percentage(title = _("Warning at a utilization of"), default_value = 90.0),
+ Percentage(title = _("Critical at a utilization of"), default_value = 95.0)
+ ],
+ title = _("Alert on too high CPU utilization"),
+ )
+ ]
+ ),
+ help = _("Configure levels for averaged CPU utilization depending on number of cluster nodes. "
+ "The CPU utilization sums up the percentages of CPU time that is used "
+ "for user processes and kernel routines over all available cores within "
+ "the last check interval. The possible range is from 0% to 100%"),
+ title = _("Memory Usage"),
+ add_label = _("Add limits")
+ ),
+ None,
+ "first",
+ False
+)
+
+register_check_parameters(
subgroup_os,
"esx_host_memory",
_("Main memory usage of ESX host system"),