Forum Discussion
log connection each minute
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 connection
although 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 Total
crontab 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.txt
you could do the >> in the script and not in the crontab, perhaps some linux gurus have opinions on this.
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