1 /*****************************************************************************
3 * DOWNTIME.H - Header file for scheduled downtime functions
5 * Copyright (c) 2001-2005 Ethan Galstad (nagios@nagios.org)
6 * Last Modified: 11-25-2005
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *****************************************************************************/
37 /* SCHEDULED_DOWNTIME_ENTRY structure */
38 typedef struct scheduled_downtime_struct
{
41 char *service_description
;
46 unsigned long triggered_by
;
47 unsigned long duration
;
48 unsigned long downtime_id
;
52 unsigned long comment_id
;
54 int start_flex_downtime
;
55 int incremented_pending_downtime
;
57 struct scheduled_downtime_struct
*next
;
63 int initialize_downtime_data(char *); /* initializes scheduled downtime data */
64 int cleanup_downtime_data(char *); /* cleans up scheduled downtime data */
66 int add_new_downtime(int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *);
67 int add_new_host_downtime(char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *);
68 int add_new_service_downtime(char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *);
70 int delete_host_downtime(unsigned long);
71 int delete_service_downtime(unsigned long);
72 int delete_downtime(int,unsigned long);
74 int schedule_downtime(int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long *);
75 int unschedule_downtime(int,unsigned long);
77 int register_downtime(int,unsigned long);
78 int handle_scheduled_downtime(scheduled_downtime
*);
79 int handle_scheduled_downtime_by_id(unsigned long);
81 int check_pending_flex_host_downtime(host
*);
82 int check_pending_flex_service_downtime(service
*);
84 int check_for_expired_downtime(void);
87 int add_host_downtime(char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long);
88 int add_service_downtime(char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long);
89 int add_downtime(int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long);
91 scheduled_downtime
*find_downtime(int,unsigned long);
92 scheduled_downtime
*find_host_downtime(unsigned long);
93 scheduled_downtime
*find_service_downtime(unsigned long);
95 void free_downtime_data(void); /* frees memory allocated to scheduled downtime list */