Hi Javier, Thanks for the pointer - I've got it working now.
To do it, I created a new backend based on the Alarm backend, called multi_alarm. Instead of taking just one Event ID as the initial parameter, it allows you to specify multiple events for the alarms, separated by "|" - e.g. "critical_alarm=12|major_alarm=13|minor_alarm=14". Depending on the alarm state passed to the backend, it will then raise the specified Event. I hit on a bit of a problem when it came to clearing the alarm again, as the standard Alarm plugin will only raise an event for an "Up" type alarm if the initial "Down" alarm was created by the same event. As I am now using different events, it failed to clear. I got around this by checking any existing alarm's event type against the possible values passed to the backend (i.e. any of the events which it can raise itself). If it finds a match, the Up event is raised as the same event type as the Down. This allows the event to be created, and picked up by the consolidator to clear the alarm. However, to achieve this, I had to modify the have_other_alarm() function in lib/api.events.inc.php to allow it to take a 0 value as an event ID to search for, and take this as a "don't care" value. I also had to include the alarms.type field in the SELECT clause, and array of returned data. The other minor problem I found was with the parameters field in the pollers_backend table. With having to pass the possible alarms and events, the CHAR(60) field wasn't enough and the data was being truncated. I have therefore modified the table to change the parameters field to a VARCHAR(255). The new backend, modified "have_other_alarm()" function and SQL modification are in the attached files. I hope they might might find their way into 0.8.3. Cheers, Craig ----- Original Message ----- From: "Javier Szyszlican" <[EMAIL PROTECTED]> Cc: <jffnms-users@lists.sourceforge.net> Sent: Saturday, May 28, 2005 4:19 PM Subject: Re: [jffnms-users] Alarm / Event severity help > Hi Craig, > > The Event color is only tied to the event, not to the alarm state. > > So if you want another event color, use another "alarm" poller backend that uses > a new event as its parameter. > > Javier > > Craig Burton wrote: > > Hello, > > > > I am polling an interface with JFFNMS which is able to report multiple > > levels of alarm (rather than just up/down). > > > > I have defined poller group firstly containing a pollerwhich takes the > > interface state (between 1 and 5), translates this into the Alarm States > > (1=aic_critical|2=aic_major) etc, and feeds into a buffer. > > I then have another poller which takes the description of the alarm from > > the interface, and again feeds into a buffer. > > The last poller item is the buffer poller, which takes the two values, > > and outputs them into the Alarm backend, which raises an event against > > the interface. > > > > This all appears to be working OK, as the Alam State is being correctly > > reported by the event in the <state> field, and the description in the > > <info> field. > > > > However, the alarm severity against the interface is displayed as the > > default severity of the Event, rather than the severity of the defined > > Alarm. Is this correct? How do I get it to display with the correct > > colour etc to represent the alarm level? > > > > Is this possible through a single Event, or do I somehow have to define > > multiple events, and discriminate between the different alarm states in > > the Poller items to determine which event to raise? > > > > I'm sure I've just missed something very simple here - I'd appreciate it > > if you could point me in the right direction. > > > > Thanks, > > Craig > > -- > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > Javier Szyszlican, Project Leader, JFFNMS > [EMAIL PROTECTED] > > I hope JFFNMS or I were helpful to you, if you > can, please donate at http://jffnms.org/donate > > >
expand_backend_parameters.sql
Description: Binary data
function_have_other_alarm.php
Description: Binary data
multi_alarm.php
Description: Binary data