F5 clear stats
Jump to navigation
Jump to search
for i in $(tmsh -q -c "list auth partition" | grep auth | awk '{print $3}'); do echo $i; tmsh -q -c "cd /$i; reset-stats ltm rule; reset-stats ltm virtual; reset-stats ltm node; reset-stats ltm pool; reset-stats ltm snatpool; reset-stats ltm virtual-address"; done
Clear all partitions via ssh script
#!/bin/bash set -eu F5_USER="foo" F5_PASS="bar" hosts=( "myf5.example.com" ) for host in "${hosts[@]}"; do echo $host; echo sleep 3; sleep 3 sshpass -p "$F5_PASS" ssh -T $F5_USER@$host << EOF bash -c "for i in \$(tmsh -q -c \"list auth partition\" | grep auth | awk '{print \$3}'); do echo \$i; tmsh -q -c \"cd /\$i; reset-stats ltm rule; reset-stats ltm virtual; reset-stats ltm node; reset-stats ltm pool; reset-stats ltm snatpool; reset-stats ltm virtual-address\"; done" EOF done