[icinga-checkins] icinga.org: icinga-core/master: Classic UI: Fixed icinga2 Host state notification entries in compat log to interpret states properly #12007

git at icinga.org git at icinga.org
Fri Jun 24 00:17:04 CEST 2016


Module: icinga-core
Branch: master
Commit: 4964b5ab3fdcf7f58f55f34f776926b1333db35e
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=4964b5ab3fdcf7f58f55f34f776926b1333db35e

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Fri Jun 24 00:15:19 2016 +0200

Classic UI: Fixed icinga2 Host state notification entries in compat log to interpret states properly #12007

Refs: #12007
Whatthecommit: I am Root. We are Root.

---

 cgi/notifications.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cgi/notifications.c b/cgi/notifications.c
index 2060721..adb4660 100644
--- a/cgi/notifications.c
+++ b/cgi/notifications.c
@@ -791,15 +791,15 @@ void display_notifications(void) {
 				}
 			} else {
 
-				if (!strcmp(alert_level, "DOWN")) {
+				if (strstr(alert_level, "DOWN")) {
 					strncpy(alert_level, "HOST DOWN", sizeof(alert_level));
 					strcpy(alert_level_class, "HOSTDOWN");
 					notification_detail_type = NOTIFICATION_HOST_DOWN;
-				} else if (!strcmp(alert_level, "UNREACHABLE")) {
+				} else if (strstr(alert_level, "UNREACHABLE")) {
 					strncpy(alert_level, "HOST UNREACHABLE", sizeof(alert_level));
 					strcpy(alert_level_class, "HOSTUNREACHABLE");
 					notification_detail_type = NOTIFICATION_HOST_UNREACHABLE;
-				} else if (!strcmp(alert_level, "RECOVERY") || !strcmp(alert_level, "UP")) {
+				} else if (strstr(alert_level, "RECOVERY") || strstr(alert_level, "UP")) {
 					strncpy(alert_level, "HOST UP", sizeof(alert_level));
 					strcpy(alert_level_class, "HOSTUP");
 					notification_detail_type = NOTIFICATION_HOST_RECOVERY;



More information about the icinga-checkins mailing list