Module: check_mk
Branch: master
Commit: 427e5b3d67802a5534cf26f2a521d1468df12c9b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=427e5b3d67802a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 6 12:37:15 2011 +0200
Dashboard: make numbers match "Tactical Overview" snapin
---
ChangeLog | 1 +
web/htdocs/check_mk.css | 6 ++++++
web/htdocs/dashboard.py | 41 +++++++++++++++++++++++++----------------
3 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1975652..dc39a5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
* Tactical Overview: make link clickable even if count is zero
* Minor cleanup in default dashboard
* Dashboard: new dashlet attribute title_url lets you make a title into a link
+ * Dashboard: make numbers match "Tactical Overview" snapin
Livestatus:
* Write messages after initialization into an own livestatus.log
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 3daf5ce..379b197 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -1760,6 +1760,11 @@ div.dashlet table.hoststats {
border-collapse: collapse;
border-spacing: 0px;
}
+div.dashlet table.hoststats.narrow {
+ margin-top: 4px;
+}
+
+
div.dashlet table.hoststats td {
text-align: right;
padding-right: 6px;
@@ -1767,6 +1772,7 @@ div.dashlet table.hoststats td {
background-image: url("images/form_background.png");
background-repeat: repeat;
}
+
div.dashlet table.hoststats th {
text-align: left;
background-color: transparent;
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 9c41ee5..358b981 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -404,22 +404,22 @@ def dashlet_mk_logo():
def dashlet_hoststats():
table = [
- ( _("Up"), "#0b3",
+ ( _("up"), "#0b3",
"Stats: state = 0\n" \
"Stats: scheduled_downtime_depth = 0\n" \
"StatsAnd: 2\n"),
- ( _("Down"), "#f00",
+ ( _("down"), "#f00",
"Stats: state = 1\n" \
"Stats: scheduled_downtime_depth = 0\n" \
"StatsAnd: 2\n"),
- ( _("Unreachable"), "#f80",
+ ( _("unreachable"), "#f80",
"Stats: state = 2\n" \
"Stats: scheduled_downtime_depth = 0\n" \
"StatsAnd: 2\n"),
- ( _("In downtime"), "#0af",
+ ( _("in downtime"), "#0af",
"Stats: scheduled_downtime_depth > 0\n" \
)
]
@@ -429,35 +429,44 @@ def dashlet_hoststats():
def dashlet_servicestats():
table = [
- ( _("Ok"), "#0b3",
+ ( _("OK"), "#0b3",
"Stats: state = 0\n" \
"Stats: scheduled_downtime_depth = 0\n" \
"Stats: host_scheduled_downtime_depth = 0\n" \
- "StatsAnd: 3\n"),
+ "Stats: host_state = 0\n" \
+ "StatsAnd: 4\n"),
- ( _("Warning"), "#ff0",
+ ( _("warning"), "#ff0",
"Stats: state = 1\n" \
"Stats: scheduled_downtime_depth = 0\n" \
"Stats: host_scheduled_downtime_depth = 0\n" \
- "StatsAnd: 3\n"),
+ "Stats: host_state = 0\n" \
+ "StatsAnd: 4\n"),
- ( _("Unknown"), "#f80",
+ ( _("unknown"), "#f80",
"Stats: state = 3\n" \
"Stats: scheduled_downtime_depth = 0\n" \
"Stats: host_scheduled_downtime_depth = 0\n" \
- "StatsAnd: 3\n"),
+ "Stats: host_state = 0\n" \
+ "StatsAnd: 4\n"),
- ( _("Critical"), "#f00",
+ ( _("critical"), "#f00",
"Stats: state = 2\n" \
"Stats: scheduled_downtime_depth = 0\n" \
"Stats: host_scheduled_downtime_depth = 0\n" \
- "StatsAnd: 3\n"),
+ "Stats: host_state = 0\n" \
+ "StatsAnd: 4\n"),
- ( _("In downtime"), "#0af",
+ ( _("in downtime"), "#0af",
"Stats: scheduled_downtime_depth > 0\n" \
"Stats: host_scheduled_downtime_depth > 0\n" \
- "StatsOr: 2\n" \
- )
+ "StatsOr: 2\n"),
+
+ ( _("on down host"), "#048",
+ "Stats: scheduled_downtime_depth = 0\n" \
+ "Stats: host_scheduled_downtime_depth = 0\n" \
+ "Stats: host_state != 0\n" \
+ "StatsAnd: 3\n"),
]
filter = "Filter: host_custom_variable_names < _REALNAME\n"
@@ -484,7 +493,7 @@ def render_statistics(what, table, filter):
html.write('<canvas class=pie width=%d height=%d id=%s_stats
style="float: left"></canvas>' %
(pie_diameter, pie_diameter, what))
- html.write('<table class=hoststats style="float:left">')
+ html.write('<table class="hoststats narrow"
style="float:left">')
for (name, color, query), count in pies + [ ((_("Total"), "",
""), total) ]:
html.write('<tr><th>%s</th><td class=color
style="background-color: %s">'
'</td><td>%d</td></tr>' % (name,
color, count))