Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
Add 'is_reachable' support for Classic UI (Icinga 2)
Browse files Browse the repository at this point in the history
Fixes #6186
  • Loading branch information
Michael Friedrich authored and Michael Friedrich committed May 10, 2014
1 parent 8d3e499 commit 57d581f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
7 changes: 7 additions & 0 deletions Changelog
Expand Up @@ -20,6 +20,13 @@ NEWS

* Mailinglists have been migrated to icinga.org. Please check https://www.icinga.org/support for details!

1.11.3 - 10/05/2014

ENHANCEMENTS

* classic ui: add 'is_reachable' attribute to extinfo details (Icinga 2 only) #6186 - MF

FIXES

1.11.2 - 24/04/2014

Expand Down
11 changes: 7 additions & 4 deletions cgi/extinfo.c
Expand Up @@ -1563,11 +1563,12 @@ void show_host_info(void) {
printf("<tr><td class='dataVar'>Check Type:</td><td class='dataVal'>DISABLED</td></tr>\n");

/* Icinga 2 */
printf("<tr><td class='dataVar' nowrap>Check Source:</td><td class='dataVal'>");
printf("<tr><td class='dataVar' nowrap>Check Source / Reachability:</td><td class='dataVal'>");
if (temp_hoststatus->check_source != NULL)
printf("%s", temp_hoststatus->check_source);
printf("%s / %s", temp_hoststatus->check_source, (temp_hoststatus->is_reachable == TRUE) ? "true" : "false"));
else
printf("N/A");

printf("</td></tr>\n");

printf("<tr><td class='dataVar' nowrap>Check Latency / Duration:</td><td class='dataVal'>");
Expand Down Expand Up @@ -2043,11 +2044,13 @@ void show_service_info(void) {
else
printf("<tr><td class='dataVar'>Check Type:</td><td class='dataVal'>DISABLED</td></tr>\n");

printf("<tr><td class='dataVar' nowrap>Check Source:</td><td class='dataVal'>");
/* Icinga 2 */
printf("<tr><td class='dataVar' nowrap>Check Source / Reachability:</td><td class='dataVal'>");
if (temp_svcstatus->check_source != NULL)
printf("%s", temp_svcstatus->check_source);
printf("%s / %s", temp_svcstatus->check_source, (temp_svcstatus->is_reachable == TRUE) ? "true" : "false"));
else
printf("N/A");

printf("</td></tr>\n");

printf("<tr><td class='dataVar' nowrap>Check Latency / Duration:</td><td class='dataVal'>");
Expand Down
2 changes: 2 additions & 0 deletions include/statusdata.h
Expand Up @@ -109,6 +109,7 @@ typedef struct hoststatus_struct{
char *check_source;
int current_down_notification_number;
int current_unreachable_notification_number;
int is_reachable;
}hoststatus;


Expand Down Expand Up @@ -170,6 +171,7 @@ typedef struct servicestatus_struct{
int current_warning_notification_number;
int current_critical_notification_number;
int current_unknown_notification_number;
int is_reachable;
}servicestatus;


Expand Down
4 changes: 4 additions & 0 deletions xdata/xsddefault.c
Expand Up @@ -1096,6 +1096,8 @@ int xsddefault_read_status_data(char *config_file, int options) {
temp_hoststatus->scheduled_downtime_depth = atoi(val);
else if (!strcmp(var, "modified_attributes"))
temp_hoststatus->modified_attributes = strtoul(val, NULL, 10);
else if (!strcmp(var, "is_reachable"))
temp_hoststatus->is_reachable = (atoi(val) > 0) ? TRUE : FALSE;
/*
else if(!strcmp(var,"state_history")){
temp_ptr=val;
Expand Down Expand Up @@ -1210,6 +1212,8 @@ int xsddefault_read_status_data(char *config_file, int options) {
temp_servicestatus->scheduled_downtime_depth = atoi(val);
else if (!strcmp(var, "modified_attributes"))
temp_servicestatus->modified_attributes = strtoul(val, NULL, 10);
else if (!strcmp(var, "is_reachable"))
temp_servicestatus->is_reachable = (atoi(val) > 0) ? TRUE : FALSE;
/*
else if(!strcmp(var,"state_history")){
temp_ptr=val;
Expand Down

0 comments on commit 57d581f

Please sign in to comment.