1 /* 2 * Copyright (C) Tildeslash Ltd. All rights reserved. 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU Affero General Public License version 3. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU Affero General Public License 13 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * 15 * In addition, as a special exception, the copyright holders give 16 * permission to link the code of portions of this program with the 17 * OpenSSL library under certain conditions as described in each 18 * individual source file, and distribute linked combinations 19 * including the two. 20 * 21 * You must obey the GNU Affero General Public License in all respects 22 * for all of the code used other than OpenSSL. 23 */ 24 25 26 #ifndef MONIT_ALERT_H 27 #define MONIT_ALERT_H 28 29 #include "event.h" 30 31 32 /** Default mail from string */ 33 #define ALERT_FROM "monit@$HOST" 34 35 /** Default mail subject */ 36 #define ALERT_SUBJECT "monit alert -- $EVENT $SERVICE" 37 38 /** Default mail message */ 39 #define ALERT_MESSAGE "$EVENT Service $SERVICE \r\n"\ 40 "\r\n"\ 41 "\tDate: $DATE\r\n"\ 42 "\tAction: $ACTION\r\n"\ 43 "\tHost: $HOST\r\n"\ 44 "\tDescription: $DESCRIPTION\r\n"\ 45 "\r\n"\ 46 "Your faithful employee,\r\n"\ 47 "Monit\r\n" 48 49 50 /** 51 * This module is used for event notifications. Users may register 52 * interest for certain events in the monit control file. When an 53 * event occurs this module is called from the event processing 54 * machinery to notify users who have asked to be alerted for 55 * particular events. 56 * 57 * @file 58 */ 59 60 61 /** 62 * Notify registered users about the event 63 * @param E An Event object 64 * @return If failed, return Handler_Alert flag or Handler_Succeeded flag if succeeded 65 */ 66 Handler_Type handle_alert(Event_T E); 67 68 69 #endif 70