Module: check_mk
Branch: master
Commit: 83798aebd849eca8a0401151f532cea390178218
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=83798aebd849ec…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 28 11:26:29 2015 +0200
#2498 FIX livestatus_status: Records the number of hosts/services now
---
.werks/2498 | 9 +++++++++
ChangeLog | 1 +
checks/livestatus_status | 3 +++
web/plugins/metrics/check_mk.py | 24 ++++++++++++++++++++++--
4 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/.werks/2498 b/.werks/2498
new file mode 100644
index 0000000..a2aab30
--- /dev/null
+++ b/.werks/2498
@@ -0,0 +1,9 @@
+Title: livestatus_status: Records the number of hosts/services now
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1438075560
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 86607c8..8f84b04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,7 @@
* 2495 FIX: printer_supply: Fixed exception when unit type is not available via SNMP
* 2496 FIX: Fixed CPU load checks when monitoring raspbian/babanian systems
* 2497 FIX: veeam_client: Fixed exception when client is missing in agent output
+ * 2498 FIX: livestatus_status: Records the number of hosts/services now
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/livestatus_status b/checks/livestatus_status
index 43f2693..c3a53f5 100644
--- a/checks/livestatus_status
+++ b/checks/livestatus_status
@@ -96,6 +96,9 @@ def check_livestatus_status(item, params, parsed):
rate = get_rate("livestatus_status.%s.%s" % (item, counter), this_time,
int(status[counter]))
yield 0, ("%.1f %s/s" % (rate, title)), [(counter, rate)]
+ yield 0, "%d Hosts" % int(status["num_hosts"]),
[("monitored_hosts", int(status["num_hosts"]))]
+ yield 0, "%d Services" % int(status["num_services"]),
[("monitored_services", int(status["num_services"]))]
+
# Output some general information
yield 0, "Core version: %s" % status["program_version"]
yield 0, "Livestatus version: %s" % status["livestatus_version"]
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 03e3a72..d936c76 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -1732,7 +1732,13 @@ metric_info["fw_connections_passthrough"] = {
metric_info["host_check_rate"] = {
"title" : _("Host check rate"),
"unit" : "1/s",
- "color" : "#884422",
+ "color" : "52/a",
+}
+
+metric_info["monitored_hosts"] = {
+ "title" : _("Monitored hosts"),
+ "unit" : "1/s",
+ "color" : "52/a",
}
metric_info["hosts_active"] = {
@@ -1768,7 +1774,13 @@ metric_info["hosts_other"] = {
metric_info["service_check_rate"] = {
"title" : _("Service check rate"),
"unit" : "1/s",
- "color" : "#ffbb66",
+ "color" : "21/a",
+}
+
+metric_info["monitored_services"] = {
+ "title" : _("Monitored services"),
+ "unit" : "1/s",
+ "color" : "21/a",
}
metric_info["livestatus_connect_rate"] = {
@@ -4951,6 +4963,14 @@ graph_info.append({
})
graph_info.append({
+ "title" : _("Number of Monitored Hosts and Services"),
+ "metrics" : [
+ ( "monitored_hosts", "stack" ),
+ ( "monitored_services", "stack" ),
+ ],
+})
+
+graph_info.append({
"title" : _("Livestatus Connects and Requests"),
"metrics" : [
( "livestatus_request_rate", "area" ),