Forum Discussion
bmarlow_10657
Nimbostratus
Feb 16, 2009SNMP query in iRule/SNMP monitor variable for iRule?
Okay, so I've been looking all over and there seems to be relatively little information regarding using SNMP or SNMP parameters in iRules. Mind you I am an iRule Rookie.
My question has two parts:
1. Is it possible to do an SNMP query within an iRule, and if so what is the command?
2. Is there a way to call the values of an SNMP monitor in an iRule?
My scenario is this:
We have several web proxies that sit behind an LTM. To make maximum use of our proxies caching mechanism we want to use a spill-over method triggered by CPU thresholds of the proxies.
I imagine that the iRule will look something similar to this (note the IP's have been replaced with *'s), but what would I used for variable?
when HTTP_REQUEST {
if{ [ usage 1sec] <= 75} {
LB::reselect node *.*.*.* 8080
} else {
if{ [ usage 1sec] <= 75} {
LB::reselect node *.*.*.* 8080
} else {
if{ [ usage 1sec] <= 75} {
LB::reselect node *.*.*.* 8080
} else {
if{ [ usage 1sec] <= 75} {
LB::reselect node *.*.*.* 8080
} else {
}
}
Any help would be greatly appreciated!
Thanks!
5 Replies
- hwidjaja_37598
Altostratus
I don't think you can you do snmp query directly from an iRule. CMIIW ...
Another approach, create another cron job to do snmp query and send it to a data group. Your iRule would be able to get the cpu usage information from data group instead of doing snmp query. - bmarlow_10657
Nimbostratus
The plan wasn't to do an SNMP query for each connection, but rather every couple of seconds, and once the CPU utilization hit a certain threshold it would bleed new/non persisted sessions over to the other proxy.
SNMP DCA will look at the stats, but it will only do for a dynamic ratio. It won't mark the node unavailable unless it doesn't respond in a timely manner to the SNMP request. I don't want a dynamic ratio load balance, only new connections to bleed over once the CPU gets to a certain point. - Thuchapon_92030
Nimbostratus
Can you tell me the example command that is send the snmp query data to the data group. please
- Mohamed_Lrhazi
Altocumulus
There is no command for sending SNMP. - Mohamed_Lrhazi
Altocumulus
There is no command for sending SNMP, from an iRule.
You can from the BigIP, from Linux space, using regular net-snmp commands.
Or, from an iRule, you could send commands to some HTTP app, which would then do SNMP for you...
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
