Forum Discussion

NetCohort_66543's avatar
NetCohort_66543
Icon for Nimbostratus rankNimbostratus
Apr 20, 2012

Custom monitor in monitoring / Script forwarding

Dear all,

 

 

I have question concerning follwoing:

 

 

 

We used monitors and sending SNMP traps to our Monitoring.

 

In case of a few custom alerts we want to forward the alert to a script (sh/perl/php/python) with exec command="/tmp/script.sh".

 

Example:

 

alert test_UP "Service detected UP for (.*?) monitor (.*?)" {

 

snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.300";

 

}

 

 

The monitor is assigned to a pool.

 

 

How can we read additional information from the alert to the script? In detail we want to forward information like, which pool the monitor is assigend?

 

 

Thank you and kind regards
  • is this helpful?

     

     

    Generic command in user_alert.conf

     

    https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/44/aft/55956/showtab/groupforums/Default.aspx
  • Hi NetCohort,

     

     

    One of the posts linked from Nitass's link is this one:

     

    https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/44/aft/1178752/showtab/groupforums/Default.aspx

     

     

    There's a request for enhancement tracking the request to pass in the full alert text to a user_alert.conf script:

     

     

    BZ350418 - log type and messages passed to external commands from alertd

     

     

    If you're using user_alert.conf scripts, please open a case with F5 Support and ask them to attach your case to the RFE.

     

     

    Thanks, Aaron
  • I forgot to mention, as an ugly workaround, you could create one user_alert.conf entry per pool and then have a custom script per pool if you need to do something per pool. And yes, this is *ugly*. Thus the request for enhancement.

     

     

    Aaron
  • Thank you for the reply.

     

    I will check it, but I opened a case with F5 Support, too.