Alarms Management¶
The management of alarms is delegated to one PHP object that is able to handle both SAM and NAGIOS alarms:
alarmsList
The type of wanted alarm (SAM/NAGIOS) for the given web instance could be specified at the object construction stage.
If no type is passed, the object retrieves the default configuration type in the settings.yml
file with the alarm_type
"constant" (recommended use).
alarmList constructor
:
# trunk/apps/frontend/lib/alarmList.php function __construct($siteName, $alarmType = NULL) { $this->sitename = $siteName; if($alarmType) $this->ALARMS_TYPE = $alarmType; else $this->ALARMS_TYPE = sfConfig::get('sf_alarm_type'); $this->build(); }
settings.yml
:
# trunk/apps/frontend/config/settings.yml alarm_type: site_nagios masking_enabled: on
N.B.: You can enable/disable the alarm masking in this file!
In each function of the class alarmList
, when it is relevant, we differentiate processes by the ALARMS_TYPE
member (initialised in constructor).
And you will find something like that:
# trunk/apps/frontend/lib/alarmsList.php switch($this->ALARMS_TYPE) { case(self::LAVOISIER_FUNCTION_NAGIOS): ** NAGIOS Processes here ** break; case(self::LAVOISIER_FUNCTION_SAM): ** SAM Processes here ** break; }
This is common to SAM and NAGIOS concepts and processes.