Allow problems command to take a host name as well

This commit is contained in:
Will Farrington 2013-11-15 18:26:03 -08:00
Родитель f972eb9589
Коммит 6acb2f11d1
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -18,7 +18,7 @@ display_help(int sd)
"\n"
" downtime <host|service> [<minutes> <comment>] Schedule downtime for a host/service (opt. num minutes, comment)\n"
"\n"
" problems [<svcgroup|hstgroup> <state>] Display all services in a non-OK state\n"
" problems [<svcgroup|hstgroup|host> <state>] Display all services in a non-OK state\n"
);
return 200;
}

Просмотреть файл

@ -82,6 +82,13 @@ display_service_problems(int sd, char* str, char* state)
}
}
for (host* hst = host_list; hst; hst = hst->next) {
if (nez_string_equals(str, hst->name)) {
filter_servicesmember_by_state(sd, state_filter, h->services);
return 200;
}
}
nsock_printf_nul(sd, "COULD NOT FIND SERVICEGROUP OR HOSTGROUP %s\n", str);
return 404;
}