00001 /* 00002 * $Id: alarm_checks.h 4764 2008-08-28 14:41:06Z henningw $ 00003 * 00004 * SNMPStats Module 00005 * Copyright (C) 2006 SOMA Networks, INC. 00006 * Written by: Jeffrey Magder (jmagder@somanetworks.com) 00007 * 00008 * This file is part of Kamailio, a free SIP server. 00009 * 00010 * Kamailio is free software; you can redistribute it and/or modify it 00011 * under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version 00014 * 00015 * Kamailio is distributed in the hope that it will be useful, but 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 * USA 00024 * 00025 * History: 00026 * -------- 00027 * 2006-11-23 initial version (jmagder) 00028 * 00029 * This file groups together alarm checking and handling 00030 */ 00031 00032 /*! 00033 *\file 00034 * \brief SNMP statistic module 00035 * \ingroup snmpstats 00036 * - Module: \ref snmpstats 00037 */ 00038 00039 #ifndef _SNMPSTATS_ALARM_AGENT_ 00040 #define _SNMPSTATS_ALARM_AGENT_ 00041 00042 #define ALARM_AGENT_FREQUENCY_IN_SECONDS 5 00043 #define ALARM_AGENT_NAME "snmpstats_alarm_agent" 00044 00045 /*! Returns the number of bytes currently waiting in the msg queue if they exceed 00046 * the threshold, and zero otherwise. If threshold_to_compare_to is < 0, then 00047 * no check will be performed and zero always returned. */ 00048 int check_msg_queue_alarm(int threshold_to_compare_to); 00049 00050 /*! Returns the number of active dialogs if they exceed the threshold, and zero 00051 * otherwise. */ 00052 int check_dialog_alarm(int threshold_to_compare_to); 00053 00054 /*! This function will be called periodically from an OpenSER timer. The first 00055 * time it is called, it will query OPENSER-MIB for configured thresholds. 00056 */ 00057 void run_alarm_check(unsigned int ticks, void * attr); 00058 00059 #endif
1.5.6