Forum Discussion
how to pass the value from the F5 GUI external monitor variable to the external monitor script?
i get the error when adding the /usr/bin/monitors/ldapmonitor-1030237100-dsaID-variable to the f5 external monitor, it gives error: 01020066:3: The requested monitor parameter (ldapmonitor-1030237100-dsaID-variable 1 dsaIDvalue=) already exists in partition Common. I enter /usr/bin/monitors/ldapmonitor-1030237100-dsaID-variable to the external program field. In the variable name field, i added dsaIDvalue=1, and 2, the moment i click finish i get the above error. I made sure chmod 777 ldapmonitor-1030237100-dsaID-variable, still i get the error. how do i pass the value 1, 2, ....100 to the dsaID variable? am i doing this wrong? thanks for your help.
[root@LNXSPS-F5-FES01:Active] monitors more ldapmonitor-1030237100-dsaID-variable
!/bin/shDATE=
date '+%Y%m%d.%H%M'
FEIP=10.30.237.100
PORT=389
dsaID=1
Note: Do not modify the STRING
STRING=SPS-9132311963
USER=pom PASSWD=password result=
ldapsearch -LLL -x -h $FEIP -p $PORT -D cn=$USER -w $PASSWD -s base -b d
saID=dsaIDvalue,o=sprintpcs.com masteredBy
rc0=
echo $result | grep -i "masteredBy:"
rc1=echo $rc0 | awk '{print $4}'
mark node UP if expected response was received (if it is not UP, then pool mem
ber will be disabled) if [ "$rc1" == "dsaIDvalue" ]; then echo "UP" fi
4 Replies
- Kevin_Stewart
Employee
I believe the issue is that you can't have two variables with the same name. Are you trying to pass a range of values? How does that apply to the LDAPSEARCH command?
- LARRY_55303
Nimbostratus
yes, i was trying to pass a range of values. dsaID= 1, 2, 3 .... Since the F5 external monitor variable field not seem to take range of variable, i just implement that in a for loop within the external program.
Now i run into issue with F5's CPU% jump by 20%. prior to implementing this for loop, the cpu is steady at below 20%. after implementing the for loop, CPU jump steady to 40%. why would (16) simple for loops caused a spike in the CPU by 20%? reason for the 16 for loops is that we monitor 16 nodes. for each node, the for loop search 36 times starting with dsaID=1 to dsaID=36. i thought that would put a small load to the ldap database, but i don't know why the F5's CPU jump by 20%?
- LARRY_55303
Nimbostratus
MaxDsa=36 for (( i=1; i <=$MaxDsa; i++ )) do ..... ********* !/bin/sh ; borne shell ********* i even try to put the sleep 0.1 or up to 1 second within the for loop, but i don't see the CPU utilization going down at all. "TOP" is only showing those monitors using like 1 to 4% of the CPU, not sure why that 20% jump in CPU activity and TOP show most of CPU utilization are by the "TMM". - Kevin_Stewart
Employee
Are you certain it's the for loop and not the ldap calls? Have you commented out the ldap calls in the script to see if CPU usage goes down?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
