Allow problems command to take a host name as well
This commit is contained in:
Родитель
f972eb9589
Коммит
6acb2f11d1
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче