Forum Discussion
log connection each minute
hello.
I need log each minute connections concurrents in my virtual server. pool and node. I saw with irules are can do but if there a script for do this.
thank and regards
4 Replies
- IanB
Employee
Using iRules, you can generate a log entry every time a connection to the associated virtual server is created.
You can also query the ltm to display all current connections (tmsh show sys connection), but be very careful with that command, as it can result in a heartbeat failure due to taking too long to complete, when there are a very large number of connections in the table. The command also accepts filters to limit the output to specific source/dest addresses, age, or connection type.
- tatmotiv
Cirrostratus
do you need connection details such as source and destination or only a connection count?
have you tried the commands by themselves yourself? when i run tmsh show sys connection i get
Really display all connections? (y/n)which will break your script at this stage
a solution seems to be
tmsh -q show sys connectionalthough doing a grep doesnt do anything for me here, as the last line is: Total records returned: 119, so it would have to be a grep Total i believe
then the second line, why the -c ?
tmsh show ltm node | grep 'Current Connections'works for me fine
then again as above for the final command
script becomes (i have thrown in a date / time stamp, feel free to remove)
!/bin/sh script para ejecutar comando cada minuto echo "$(date)" tmsh -q show sys connection | grep Total tmsh show ltm node node_135.208.45.223 | grep 'Current Connections' tmsh -q show sys connection | grep Totalcrontab looks almost fine although you seem to miss a first
and the path with root in home is kinda weird, but if these exisits all ok. also make sure your script is executable, test by first running the line/root/home/root/Mi_script.sh >> /home/root/conexiones.txtyou could do the >> in the script and not in the crontab, perhaps some linux gurus have opinions on this.
- IainThomson85_1
Cumulonimbus
Would you not be better monitoring various aspects using an SNMP tool ?
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