Ok, Here is the r2 of the action script, I added a check to detect is the host that is in maintenance mode have alarmed interfaces, if yes, it will delete them in the DB (not on the events table for the moment). The goal of this is to prevent the host,interfaces,... screen on the GUI to change the color for the host (it the host is in maintenance mode it is not necessary to see alarmed interface during the maintenance period).
David LIMA Professional Services http://www.scc.com/ On Tue, 2006-11-21 at 14:41 -0300, Javier Szyszlican wrote: > I'll try to figure out a way to integrate this easily in the DB. > > Javier > > LIMA David wrote: > > I’ve just finished adding a basic maintenance mode inside JFFNMS based > > on action script that disable a host for polling and enable it at a > > given time (duration can be specified using time spec for AT command) > > > > > > > > Don’t know how to integer it better inside jffnms (filed inside the DB?, > > poller and consolidate process that check the field ?) but it works good > > for now. > > > > > > > > STEPS > > > > 1- create a new event type called maintenance: > > > > 2- add syslog matching rules (for windows, linux etc …) > > > > 3- add a new action script (place the file maintenance.inc.php > > inside $jffnms_tree/engine/actions) > > > > 4- create a new trigger that call maintenance if the event > > maintenance is raised > > > > 5- assign the trigger to a user > > > > > > > > > > > > To send the syslog message to jffnms host you can use various way, here > > are some one, the only thing that you must do is to send a syslog > > message that is matched by the syslog message rules. > > > > > > > > ------------------ > > > > * using eventcreate builtin exe on Win2k3 + ntsyslog > > > > > > > > EVENTCREATE /T WARNING /ID 100 /L APPLICATION /SO maintenance /D "host: > > host1 duration: now + 5 minutes" > > > > EVENTCREATE /T WARNING /ID 100 /L APPLICATION /SO maintenance /D "host: > > sauv2 duration: 25122006" > > > > > > > > * Winall using syslog client binary (from kiwi) that sends directly > > to JFFNMS HOSTS > > > > > > > > klog -h 10.96.0.122 -p warning -F local1 -r "maintenance:" -m "host: > > ntsncsauv2 duration: tomorrow + 15:30 minutes" > > > > > > > > * Linux/Unix (syslog warnings must be configured to be sent to the > > jffnms host). > > > > logger -p local1.warn -t maintenance "host: nt3 duration: now + 30 minutes" > > > > > > > > > > > > ---------------------------------- > > > > Files and steps are attached. > > > > > > > > Cheers > > > > > > > > > > > > _______________ > > > > David LIMA > > > > *Professional Services* > > > > *www.scc.com <http://www.scc.com>* > > > > > > > > > > > > > > > > > > ______________________________________________________________________ > > Ce message contient des informations dont le contenu est susceptible > > d'etre confidentiel. > > Il est destine au(x) destinataire(s) indique(s) exclusivement. > > > > A moins que vous ne fassiez partie de la liste des destinataires, ou que > > vous soyez habilite a recevoir le mail a leur place, il vous est > > interdit de le copier, de l'utiliser ou de devoiler son contenu a un tiers. > > > > Si vous avez recu cet email par erreur, merci de prendre contact avec > > l'emetteur. > > > > Les opinions exprimees dans cet e-mail sont celles de l'emetteur et ne > > refletent pas necessairement celles de l'entreprise. > > > > Ce e-mail peut contenir des pieces jointes dont certaines pourraient > > contenir des virus qui pourraient endommager votre systeme informatique. > > > > La compagnie a pris toutes dispositions afin de minimiser ce risque et > > decline toute responsabilite pour toute perte ou dommage resultant > > directement ou indirectement de l'utilisation de cet email ou de son > > contenu. > > > > Il vous appartient d'effectuer vos propres controles anti-virus avant > > d'ouvrir la ou les pieces jointes. > > ______________________________________________________________________ > > > > > > ------------------------------------------------------------------------ > > > > TYPES > > +-------+-------------------+----------------+-------------------------------------------------------------------------+-----------------------+---------------------------+------------------------------+----------------+------------------+ > > | ID | Description | Severity | Event Text > > | Show in Event Viewer? | Event > > Generates an Alarm? | Different Alarm for Up Event | Alarm Duration | Show > > Host Field? | > > +-------+-------------------+----------------+-------------------------------------------------------------------------+-----------------------+---------------------------+------------------------------+----------------+------------------+ > > | 10005 | Maintenance | Administrative | Polling for host <interface> > > is disabled (when will be enabled: <info>) | Always | O > > | Unknown | Default | O > > | > > > > > > > > > > SYSLOG > > +-------+------------------------------------------------------------------------------------------+-----------------+----------------+-------------+------------------+-------------------+----------+ > > | ID | Text Match > > | Interface Field | Username Field | State Field | > > Extra Info Field | Event Type | Position | > > +-------+------------------------------------------------------------------------------------------+-----------------+----------------+-------------+------------------+-------------------+----------+ > > | 10005 | maintenance\[warning\].*\shost:\s(\w+)\sduration:\s(.*)$ > > | 1 | | | 2 > > | Maintenance | 1 | > > | 10004 | maintenance: host:\s(\w+)\sduration:(.*)$ > > | 1 | | | 2 > > | Maintenance | 1 | > > > > > > ACTIONS > > > > +-------+--------------------------+-------------+-------------------------------------------------+-------------------------------------------+ > > | ID | Description | Command | Internal Parameters > > | User Parameters | > > +-------+--------------------------+-------------+-------------------------------------------------+-------------------------------------------+ > > | 10002 | Disable polling for host | maintenance | > > | | > > | 10001 | Sms via GSM | sms | > > smsname:<profile-smsalias> | > > | > > > > > > TRIGGERS > > +----+-------------------------+--------------+ > > | ID | Description | Type | > > +----+-------------------------+--------------+ > > | 2 | Interface Status Change | Match Alarms | > > | 3 | SMS Trigger | Match Alarms | > > | 4 | Maintenance Mode | Match Events | > > +----+-------------------------+--------------+ > > > > inside the trigger add a statement like, if type is equal to maitenance > > then action maitenance stop this trigger > > > > > > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > jffnms-users mailing list > > jffnms-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/jffnms-users > ______________________________________________________________________ Ce message contient des informations dont le contenu est susceptible d'etre confidentiel. Il est destine au(x) destinataire(s) indique(s) exclusivement. A moins que vous ne fassiez partie de la liste des destinataires, ou que vous soyez habilite a recevoir le mail a leur place, il vous est interdit de le copier, de l'utiliser ou de devoiler son contenu a un tiers. Si vous avez recu cet email par erreur, merci de prendre contact avec l'emetteur. Les opinions exprimees dans cet e-mail sont celles de l'emetteur et ne refletent pas necessairement celles de l'entreprise. Ce e-mail peut contenir des pieces jointes dont certaines pourraient contenir des virus qui pourraient endommager votre systeme informatique. La compagnie a pris toutes dispositions afin de minimiser ce risque et decline toute responsabilite pour toute perte ou dommage resultant directement ou indirectement de l'utilisation de cet email ou de son contenu. Il vous appartient d'effectuer vos propres controles anti-virus avant d'ouvrir la ou les pieces jointes. ______________________________________________________________________
maintenance.inc.php
Description: application/php
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ jffnms-users mailing list jffnms-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jffnms-users