Support both fixed and flexible downtime

"downtime" command will now generate a fixed downtime window, "flexdowntime"
will generate a flexible downtime window.
This commit is contained in:
Tim Sharpe 2014-07-29 16:38:50 +10:00
Родитель 7584f02ebb
Коммит ad9671aa7b
3 изменённых файлов: 17 добавлений и 3 удалений

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

@ -43,7 +43,8 @@ commands[] = {
{ "check", nez_cmd_check },
{ "enable_notifications", nez_cmd_enable_notifications },
{ "disable_notifications", nez_cmd_disable_notifications },
{ "downtime", nez_cmd_schedule_downtime },
{ "downtime", nez_cmd_schedule_fixed_downtime },
{ "flexdowntime", nez_cmd_schedule_flex_downtime },
{ "acknowledge", nez_cmd_acknowledge },
{ "unacknowledge", nez_cmd_unacknowledge },
{ "problems", nez_cmd_problems },

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

@ -50,7 +50,7 @@ schedule_downtime_for_obj(int sd, host* hst, service* svc, unsigned long minutes
}
int
nez_cmd_schedule_downtime(int sd, char* object, char* rest)
cmd_schedule_downtime(int sd, char* object, char* rest, int fixed)
{
unsigned long minutes;
char* comment_data;
@ -88,3 +88,15 @@ nez_cmd_schedule_downtime(int sd, char* object, char* rest)
nsock_printf_nul(sd, "NO HOST OR SERVICE FOUND FOR: %s", object);
return 404;
}
int
nez_cmd_schedule_flex_downtime(int sd, char* object, char *rest)
{
cmd_schedule_downtime(sd, object, rest, 0);
}
int
nez_cmd_schedule_fixed_downtime(int sd, char* object, char *rest)
{
cmd_schedule_downtime(sd, object, rest, 1);
}

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

@ -1,6 +1,7 @@
#ifndef NEZ_COMMANDS_DOWNTIME_H
#define NEZ_COMMANDS_DOWNTIME_H
int nez_cmd_schedule_downtime(int sd, char* object, char* rest);
int nez_cmd_schedule_fixed_downtime(int sd, char* object, char* rest);
int nez_cmd_schedule_flex_downtime(int sd, char* object, char* rest);
#endif