[icinga-checkins] icinga.org: icinga-web/mhein/default: * added display of host- and service-status strings to status map and info boxes

git at icinga.org git at icinga.org
Thu Oct 8 13:45:23 CEST 2009


Module: icinga-web
Branch: mhein/default
Commit: 21b9cb4cedfc47801f7e547f5b7fdbc0d2bd33de
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=21b9cb4cedfc47801f7e547f5b7fdbc0d2bd33de

Author: Christian Doebler <christian.doebler at netways.de>
Date:   Wed Oct  7 10:59:52 2009 +0200

* added display of host- and service-status strings to status map and info boxes

---

 .../Cronks/models/System/StatusMapModel.class.php  |    3 +++
 ...cingaApiSimpleDataProviderSuccessView.class.php |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/app/modules/Cronks/models/System/StatusMapModel.class.php b/app/modules/Cronks/models/System/StatusMapModel.class.php
index f843ef1..feabf97 100644
--- a/app/modules/Cronks/models/System/StatusMapModel.class.php
+++ b/app/modules/Cronks/models/System/StatusMapModel.class.php
@@ -121,6 +121,9 @@ class Cronks_System_StatusMapModel extends ICINGACronksBaseModel
 			if ($key == 'host_object_id') {
 				continue;
 			}
+			if ($key == 'host_current_state') {
+				$value = IcingaHostStateInfo::Create($value)->getCurrentStateAsText();
+			}
 			$hostTable .= sprintf('<tr><td>%s</td><td>%s</td></tr>', $this->tm->_($key), $value);
 		}
 		$hostTable = '<table>' . $hostTable . '</table>';
diff --git a/app/modules/Web/views/IcingaApiSimpleDataProviderSuccessView.class.php b/app/modules/Web/views/IcingaApiSimpleDataProviderSuccessView.class.php
index 2c09f22..f22eabe 100644
--- a/app/modules/Web/views/IcingaApiSimpleDataProviderSuccessView.class.php
+++ b/app/modules/Web/views/IcingaApiSimpleDataProviderSuccessView.class.php
@@ -31,6 +31,11 @@ class Web_IcingaApiSimpleDataProviderSuccessView extends ICINGAWebBaseView
 
 		foreach ($result as $row) {
 			foreach ($result->getRow() as $key => $value) {
+				if ($key == 'host_current_state') {
+					$value = IcingaHostStateInfo::Create($value)->getCurrentStateAsText();
+				} elseif ($key == 'service_current_state') {
+					$value = IcingaServiceStateInfo::Create($value)->getCurrentStateAsText();
+				}
 				$dataTmp = array (
 					'key'	=> $tm->_($key),
 					'value'	=> $value,





More information about the icinga-checkins mailing list