Forum Discussion

sharon_lam_1113's avatar
sharon_lam_1113
Icon for Nimbostratus rankNimbostratus
Aug 17, 2006

Can irule send email to let the administrator?

I am new to irule. May I know can irule send email to the administrator to let he knows when the specific event is triggered?

 

 

My case is when there a HTTP request to a specific domain site, my administrator can receive alert message.

 

 

Can Irule do that? What can do that?

 

 

Your help is appreciated!!!

5 Replies

  • Hello,

    You can use the 'log' statement in a rule to log an event. There are a few other processes to configure to parse that log info and generate an email.

    The general flow is from the rule to syslog-ng to alertd to postfix. You also need to configure a custom SNMP trap--but SNMP isn't actually used to send the alert.

    The log statement in a rule can be used like this (where local0.info is the syslog facility.syslog severity) and the quoted string is the message that is generated:

    
    log local0.info "My log statement"

    To configure a custom SNMP trap see SOL3727:

    Click here

    To configure the triggering of an email based on an SNMP trap, see SOL3667:

    Click here

    To configure Postfix to actually send the email, see SOL3664:

    Click here

    So there are a few steps to go through, but each of them is fairly well documented.

    All but the actual iRule log statement is outside the scope of DevCentral, so if you have questions or configuration issues, please contact support.

    Thanks,

    Aaron
  • Dear Aaron,

     

     

    thanks for your prompt reply!!!

     

     

    I will try to see if i can do that.. because i am really new to not only irule but also the BigIP..

     

     

    I want to make something clear..

     

     

    what is the difference between

     

    log LOCAL0. "log statement" nad log LOCAL0.info "log statemnet" ??

     

     

    besides, when the log LOCAL0.info "my log statement" is executed, is it the same that it write to the syslog-ng??

     

     

    I am sorry if i made any stupid question.
  • hoolio (or anyone else who sees fit to answer) ~

     

     

    I realize this forum was intended only for iRule discussion, but since there is no general LTM forum and the subject came up in this thread, I'll ask here...

     

     

    I had been putting off the investigation of SMTP alerts until finishing some iRule testing, but reading this thread inspired me to focus on SMTP for a while. I followed the instructions in all three of those docs, verified that outbound email works just fine, but neither the custom alert I created now the default alert I modified to include an SMTP alert is generating email. To test whether my custom alert was at least matching for SNMP, I pointed it to a test SNMP server here and found that no traps were being sent either.

     

     

    Is there anything that must be done in order to activate the alerts configured in /config/user_alert.conf (or, perhaps more importantly, the dynamic file /var/tmpfs/run/alert.conf)?
  • I failed to mention that SNMP was communicating just fine... whenever I would make a system change that would otherwise warrant a trap, such as rebooting the BIG-IP, traps were sent, they just weren't sent based on information that comes up in the local logs.