Counter-Totals.txt

Damien Duponchelle, 11/24/2009 10:43 PM

Download (5.4 KB)

 
1
### Eclipse Workspace Patch 1.0
2
#P Centreon-Trunk
3
Index: www/menu/templates/BlockHeader.ihtml
4
===================================================================
5
--- www/menu/templates/BlockHeader.ihtml	(revision 9417)
6
+++ www/menu/templates/BlockHeader.ihtml	(working copy)
7
@@ -34,7 +34,7 @@
8
 			<td>
9
 				<table class='Resume_light_table'>
10
 					<tr class='Resume_light_header' style="white-space:nowrap;">
11
-						<td>{$Hosts_States}</td>
12
+						<td><strong>{$Hosts}</strong></td>
13
 						<td>{$Up}</td>
14
 						<td>{$Down}</td>
15
 						<td>{$Unreachable}</td>
16
@@ -53,7 +53,7 @@
17
 			<td>
18
 				<table class='Resume_light_table'>
19
 					<tr class='Resume_light_header' style="white-space:nowrap;">
20
-						<td>{$Services_States}</td>
21
+						<td><strong>{$Services}</strong></td>
22
 						<td>{$Ok}</td>
23
 						<td>{$Warning}</td>
24
 						<td>{$Critical}</td>
25
Index: www/include/monitoring/status/TopCounter/statusCounter.php
26
===================================================================
27
--- www/include/monitoring/status/TopCounter/statusCounter.php	(revision 9417)
28
+++ www/include/monitoring/status/TopCounter/statusCounter.php	(working copy)
29
@@ -207,17 +207,23 @@
30
 		/*
31
 		 * Create Buffer
32
 		 */
33
+		 
34
+        $total_service = $svc_stat["0"]+$svc_stat["1"]+$svc_stat["2"]+$svc_stat["3"]+$svc_stat["4"];
35
+        $total_host = $host_stat["0"]+$host_stat["1"]+$host_stat["2"]+$host_stat["3"];
36
+		 
37
 		$buffer = new CentreonXML();
38
 		$buffer->startElement("reponse");
39
 		$buffer->startElement("infos");
40
 		$buffer->writeElement("filetime", time());
41
 		$buffer->endElement();
42
 		$buffer->startElement("s");
43
+        $buffer->writeElement("ts", $total_service);
44
 		$buffer->writeElement("o", $svc_stat["0"]);
45
 		$buffer->writeElement("w", $svc_stat["1"]);
46
 		$buffer->writeElement("c", $svc_stat["2"]);
47
 		$buffer->writeElement("un1", $svc_stat["3"]);
48
 		$buffer->writeElement("p1", $svc_stat["4"]);
49
+        $buffer->writeElement("th", $total_host);
50
 		$buffer->writeElement("up", $host_stat["0"]);
51
 		$buffer->writeElement("d", $host_stat["1"]);
52
 		$buffer->writeElement("un2", $host_stat["2"]);
53
Index: www/include/common/javascript/topCounterStatus/ajaxStatusCounter.js
54
===================================================================
55
--- www/include/common/javascript/topCounterStatus/ajaxStatusCounter.js	(revision 9417)
56
+++ www/include/common/javascript/topCounterStatus/ajaxStatusCounter.js	(working copy)
57
@@ -52,11 +52,13 @@
58
 			var stats = reponseC.getElementsByTagName("s");
59
 			for (var i = 0 ; i < stats.length ; i++) {
60
 				var stat = stats[i];
61
+				var _statistic_total_service = stat.getElementsByTagName("ts")[0].firstChild.nodeValue;
62
 				var _statistic_service_ok = stat.getElementsByTagName("o")[0].firstChild.nodeValue;
63
 				var _statistic_service_warning = stat.getElementsByTagName("w")[0].firstChild.nodeValue;
64
 				var _statistic_service_critical = stat.getElementsByTagName("c")[0].firstChild.nodeValue;
65
 				var _statistic_service_unknown = stat.getElementsByTagName("un1")[0].firstChild.nodeValue;
66
 				var _statistic_service_pending = stat.getElementsByTagName("p1")[0].firstChild.nodeValue;
67
+				var _statistic_total_host = stat.getElementsByTagName("th")[0].firstChild.nodeValue;
68
 				var _statistic_host_up = stat.getElementsByTagName("up")[0].firstChild.nodeValue;
69
 				var _statistic_host_down = stat.getElementsByTagName("d")[0].firstChild.nodeValue;
70
 				var _statistic_host_unreachable = stat.getElementsByTagName("un2")[0].firstChild.nodeValue;
71
@@ -65,6 +67,13 @@
72
 				/*
73
 				 * host
74
 				 */
75
+				document.getElementById('total_host').innerHTML = '';//_statistic_total_host;
76
+                var _text_total_host = document.createTextNode(_statistic_total_host);
77
+                var _link_total_host = document.createElement("a");
78
+                _link_total_host.href = 'main.php?p=20102&o=h';
79
+                _link_total_host.appendChild(_text_total_host);
80
+                document.getElementById('total_host').appendChild(_link_total_host);				 
81
+				 
82
 				document.getElementById('host_up').innerHTML = '';//_statistic_host_up;
83
 				var _text_host_up = document.createTextNode(_statistic_host_up);
84
 				var _linkHostup = document.createElement("a");
85
@@ -96,7 +105,12 @@
86
 				/* 
87
 				 * svc
88
 				 */
89
-				
90
+				document.getElementById('total_service').innerHTML = '';
91
+                var _text_total_service = document.createTextNode(_statistic_total_service);
92
+                var _link_total_service = document.createElement("a");
93
+                _link_total_service.href = 'main.php?p=20201&o=svc';
94
+                _link_total_service.appendChild(_text_total_service);
95
+                document.getElementById('total_service').appendChild(_link_total_service);				
96
 				// Ok service Stats
97
 				document.getElementById('service_ok').innerHTML = '';
98
 				var _text_service_ok = document.createTextNode(_statistic_service_ok);
99
Index: www/menu/Menu.php
100
===================================================================
101
--- www/menu/Menu.php	(revision 9417)
102
+++ www/menu/Menu.php	(working copy)
103
@@ -96,8 +96,8 @@
104
 	$tpl->assign("Up", _("Up"));
105
 	$tpl->assign("Down", _("Down"));
106
 	$tpl->assign("Unreachable", _("Unreachable"));
107
-	$tpl->assign("Hosts_States", _("Host States"));
108
-	$tpl->assign("Services_States", _("Service States"));
109
+    $tpl->assign("Hosts", _("Hosts"));
110
+    $tpl->assign("Services", _("Services"));
111
 	$tpl->assign("Logout", _("Logout"));
112
 	$tpl->assign("Help", _("Help"));
113
 	$tpl->assign("Documentation", _("Documentation"));