Forum Discussion
Send an SNMP Trap within an IRULE
I have a simple Irule that looks like this
when CLIENT_ACCEPTED {
if { ([class match [IP::client_addr] equals DO_Specific_IPs]) && ([active_members DO-Pool] > 10 && [active_members DNS-Pool] > 0) } {
pool DO-Pool
persist source_addr 1800
}
} else {
pool X_Default_GW_INT
if { [active_members DNS-Pool] < 1 } { log local0. "DNS Pool Members Down - Bypassing DO Pool"}
if { [active_members DO-Pool] < 1 } { log local0. "DO Pool Members Down - Bypassing"}
}
So in the case that the DO-Pool is up but the DNS-Pool is down the IRULE will send traffic to the Pool pool X_Default_GW_INT.
This is great! and also a Trap will have been sent to the OSS team automatically by F5 to say the DNS Pool is down, which is also Great!
But I need a new Trap to be sent to the OSS platform that provides Support them with further info about what it really means when the IRULE switches sending traffic to the X_Default_GW Pool
So I want to do something like
when CLIENT_ACCEPTED {
if { ([class match [IP::client_addr] equals DO_Specific_IPs]) && ([active_members DO-Pool] > 10 && [active_members DNS-Pool] > 0) } {
pool DO-Pool
persist source_addr $static::persist_timeout
}
} else {
pool X_Default_GW_INT
if { [active_members DNS-Pool] < 1 } {
log local0. "DNS Pool Members Down - Bypassing DO Pool"
TRAP (LIVE TRAFFIC IN BYPASS DUE TO DNS POOL OFFLINE - NOTIFY Little Johnny!)
}
if { [active_members DO-Pool] < 1 } {
log local0. "DO Pool Members Down - Bypassing"
TRAP (LIVE TRAFFIC IN BYPASS DUE TO DNS POOL OFFLINE - NOTIFY Big Jonny!)}
}
Any ideas?
Is this possible?
Thanks
Chris
- nitassEmployeeyes, it is possible. what we have to do is to write message to log file (log command in irule), configure alertd to monitor the message and send out trap.
- Christopher_AchNimbostratusright ok, great. Thanks for the reply, much appreciated
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com