![]() |
Icinga-core 1.4.0
next gen monitoring
|
submits commands to Icinga command pipe More...
#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/comments.h"
#include "../include/downtime.h"
#include "../include/cgiutils.h"
#include "../include/cgiauth.h"
#include "../include/getcgi.h"
Go to the source code of this file.
Data Structures | |
struct | hostlist |
host/service list structure More... | |
struct | errorlist |
error list structure More... | |
Defines | |
LIMITS | |
#define | MAX_AUTHOR_LENGTH 64 |
#define | MAX_COMMENT_LENGTH 1024 |
#define | NUMBER_OF_STRUCTS 500 |
ELEMET TEMPLATE TYPES | |
#define | PRINT_COMMON_HEADER 1 |
#define | PRINT_AUTHOR 2 |
#define | PRINT_STICKY_ACK 3 |
#define | PRINT_PERSISTENT 4 |
#define | PRINT_SEND_NOTFICATION 5 |
#define | PRINT_COMMENT_BOX 6 |
#define | PRINT_NOTIFICATION_DELAY 7 |
#define | PRINT_START_TIME 8 |
#define | PRINT_END_TIME 9 |
#define | PRINT_CHECK_TIME 10 |
#define | PRINT_FORCE_CHECK 11 |
#define | PRINT_CHECK_OUTPUT_BOX 12 |
#define | PRINT_PERFORMANCE_DATA_BOX 13 |
#define | PRINT_FIXED_FLEXIBLE_TYPE 14 |
#define | PRINT_BROADCAST_NOTIFICATION 15 |
#define | PRINT_FORCE_NOTIFICATION 16 |
OBJECT LIST TYPES | |
#define | PRINT_HOST_LIST 17 |
#define | PRINT_SERVICE_LIST 18 |
#define | PRINT_COMMENT_LIST 19 |
#define | PRINT_DOWNTIME_LIST 20 |
Functions | |
void | request_command_data (int) |
Print form for all details to submit command. | |
void | commit_command_data (int) |
submits the command data and checks for sanity | |
int | commit_command (int) |
checks the authorization and passes the data to cmd_submitf | |
int | write_command_to_file (char *) |
write the command to Icinga command pipe | |
void | clean_comment_data (char *) |
strips out semicolons and newlines from comment data | |
void | print_form_element (int, int) |
strips out semicolons and newlines from comment data | |
void | print_object_list (int) |
print the list of affected objects | |
void | print_help_box (char *) |
print the mouseover box with help text | |
void | check_comment_sanity (int *) |
checks start and end time and if start_time is before end_time | |
void | check_time_sanity (int *) |
checks if comment and author are not empty strings | |
int | process_cgivars (void) |
Parses the requested GET/POST variables. | |
int | main (void) |
Yes we need a main function. | |
__attribute__ ((format(printf, 2, 3))) | |
doe's some checks before passing data to write_command_to_file | |
Variables | |
Vars which are imported for cgiutils | |
| |
int | show_all_hosts = TRUE |
int | show_all_hostgroups = TRUE |
int | show_all_servicegroups = TRUE |
int | display_type = DISPLAY_HOSTS |
Internal vars | |
char * | host_name = "" |
char * | hostgroup_name = "" |
char * | servicegroup_name = "" |
char * | service_desc = "" |
char * | comment_author = "" |
char * | comment_data = "" |
char * | start_time_string = "" |
char * | end_time_string = "" |
char | help_text [MAX_INPUT_BUFFER] = "" |
char | plugin_output [MAX_INPUT_BUFFER] = "" |
char | performance_data [MAX_INPUT_BUFFER] = "" |
int | notification_delay = 0 |
int | schedule_delay = 0 |
int | persistent_comment = FALSE |
int | sticky_ack = FALSE |
int | send_notification = FALSE |
int | force_check = FALSE |
int | plugin_state = STATE_OK |
int | affect_host_and_services = FALSE |
int | propagate_to_children = FALSE |
int | fixed = FALSE |
unsigned long | duration = 0L |
unsigned long | triggered_by = 0L |
int | child_options = 0 |
int | force_notification = 0 |
int | broadcast_notification = 0 |
int | command_type = CMD_NONE |
int | command_mode = CMDMODE_REQUEST |
time_t | start_time = 0L |
time_t | end_time = 0L |
int | CGI_ID = CMD_CGI_ID |
authdata | current_authdata |
struct hostlist | commands [NUMBER_OF_STRUCTS] |
struct errorlist | error [NUMBER_OF_STRUCTS] |
unsigned long | multi_ids [NUMBER_OF_STRUCTS] |
short | is_authorized [NUMBER_OF_STRUCTS] |
short | submit_result [NUMBER_OF_STRUCTS] |
External vars | |
char | main_config_file [MAX_FILENAME_LENGTH] |
char | url_html_path [MAX_FILENAME_LENGTH] |
char | url_images_path [MAX_FILENAME_LENGTH] |
char | command_file [MAX_FILENAME_LENGTH] |
char | comment_file [MAX_FILENAME_LENGTH] |
int | check_external_commands |
int | use_authentication |
int | lock_author_names |
int | persistent_ack_comments |
int | log_external_commands_user |
int | content_type |
int | display_header |
int | daemon_check |
int | enforce_comments_on_actions |
int | date_format |
scheduled_downtime * | scheduled_downtime_list |
comment * | comment_list |
const char * | extcmd_get_name (int id) |
submits commands to Icinga command pipe
Definition in file cmd.c.
#define NUMBER_OF_STRUCTS 500 |
__attribute__ | ( | (format(printf, 2, 3)) | ) |
void check_comment_sanity | ( | int * | e | ) |
void check_time_sanity | ( | int * | e | ) |
void clean_comment_data | ( | char * | buffer | ) |
int commit_command | ( | int | cmd | ) |
void commit_command_data | ( | int | cmd | ) |
submits the command data and checks for sanity
[in] | cmd | ID of requested command |
This function checks the submitted data (request_command_data) for sanity. If everything is alright it passes the data to commit_command.
const char* extcmd_get_name | ( | int | id | ) |
Definition at line 219 of file extcmd_list.c.
void print_form_element | ( | int | element, |
int | cmd | ||
) |
void print_help_box | ( | char * | content | ) |
void print_object_list | ( | int | list_type | ) |
int process_cgivars | ( | void | ) |
Parses the requested GET/POST variables.
TRUE | |
FALSE |
This function parses the request and set's the necessary variables
void request_command_data | ( | int | cmd | ) |
int write_command_to_file | ( | char * | cmd | ) |
int affect_host_and_services = FALSE |
int broadcast_notification = 0 |
int CGI_ID = CMD_CGI_ID |
ID to identify the cgi for functions in cgiutils.c
int child_options = 0 |
char command_file[MAX_FILENAME_LENGTH] |
int command_mode = CMDMODE_REQUEST |
int command_type = CMD_NONE |
char* comment_author = "" |
char* comment_data = "" |
char comment_file[MAX_FILENAME_LENGTH] |
Definition at line 47 of file comments.c.
int content_type |
Definition at line 165 of file cgiutils.c.
int daemon_check |
Definition at line 169 of file cgiutils.c.
int date_format |
int display_header |
Definition at line 167 of file cgiutils.c.
int display_type = DISPLAY_HOSTS |
char* end_time_string = "" |
Definition at line 140 of file cgiutils.c.
int force_check = FALSE |
int force_notification = 0 |
char* hostgroup_name = "" |
short is_authorized[NUMBER_OF_STRUCTS] |
Definition at line 74 of file cgiutils.c.
char main_config_file[MAX_FILENAME_LENGTH] |
Definition at line 50 of file icingastats.c.
unsigned long multi_ids[NUMBER_OF_STRUCTS] |
int notification_delay = 0 |
char performance_data[MAX_INPUT_BUFFER] = "" |
Definition at line 121 of file cgiutils.c.
int persistent_comment = FALSE |
char plugin_output[MAX_INPUT_BUFFER] = "" |
int plugin_state = STATE_OK |
int propagate_to_children = FALSE |
int schedule_delay = 0 |
Definition at line 49 of file downtime.c.
int send_notification = FALSE |
char* service_desc = "" |
char* servicegroup_name = "" |
int show_all_hostgroups = TRUE |
int show_all_hosts = TRUE |
int show_all_servicegroups = TRUE |
time_t start_time = 0L |
char* start_time_string = "" |
int sticky_ack = FALSE |
short submit_result[NUMBER_OF_STRUCTS] |
unsigned long triggered_by = 0L |
char url_html_path[MAX_FILENAME_LENGTH] |
Definition at line 38 of file cgiutils.c.
char url_images_path[MAX_FILENAME_LENGTH] |
Definition at line 41 of file cgiutils.c.
Definition at line 104 of file cgiutils.c.