[icinga-checkins] icinga.org: icinga-core/rbartels/cgi: classic-ui: fixed Trigger Time in Scheduled Downtime displaying 01-01-1970 01:00: 00 when not triggered #3980

git at icinga.org git at icinga.org
Sat Apr 20 23:30:30 CEST 2013


Module: icinga-core
Branch: rbartels/cgi
Commit: 72fa5b45a19efc42d3aa841db0f33fbd183c0cf3
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=72fa5b45a19efc42d3aa841db0f33fbd183c0cf3

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Sat Apr 20 23:26:00 2013 +0200

classic-ui: fixed Trigger Time in Scheduled Downtime displaying 01-01-1970 01:00:00 when not triggered #3980

refs: #3980

it now displays "N/A"

---

 Changelog     |    1 +
 cgi/extinfo.c |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 2cafeaf..dff9eec 100644
--- a/Changelog
+++ b/Changelog
@@ -69,6 +69,7 @@ FIXES
 * classic ui: fixed possible NULL dereference-bug in summary.c #3740 - RB
 * classic ui: fixed Command expansion problem with percentage signs #3929 - RB
 * classic ui: cleaned up the jquery-ui includes to allow debian pkg dependencies #3808 - RB
+* classic ui: fixed Trigger Time in Scheduled Downtime displaying 01-01-1970 01:00:00 when not triggered #3980 - RB
 
 * docs: add missing cmd_mod description in cgi params #3438 - MF
 * docs: search_string as cgi GET param works also for status.cgi #3451 - MF
diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index cb509d9..24a8805 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -3334,11 +3334,14 @@ void show_downtime(int type) {
 
 		get_time_string(&temp_downtime->trigger_time, date_time, (int)sizeof(date_time), SHORT_DATE_TIME);
 		if (content_type == JSON_CONTENT) {
-			printf("\"trigger_time\": \"%s\", ", date_time);
+			if (temp_downtime->trigger_time != 0)
+				printf("\"trigger_time\": \"%s\", ", date_time);
+			else
+				printf("\"trigger_time\": null, ");
 		} else if (content_type == CSV_CONTENT) {
-			printf("%s%s%s%s", csv_data_enclosure, date_time, csv_data_enclosure, csv_delimiter);
+			printf("%s%s%s%s", csv_data_enclosure, (temp_downtime->trigger_time != 0) ? date_time : "N/A", csv_data_enclosure, csv_delimiter);
 		} else {
-			printf("<td CLASS='%s'>%s</td>", bg_class, date_time);
+			printf("<td CLASS='%s'>%s</td>", bg_class, (temp_downtime->trigger_time != 0) ? date_time : "N/A");
 		}
 
 		get_time_breakdown(temp_downtime->duration, &days, &hours, &minutes, &seconds);





More information about the icinga-checkins mailing list