initial commit; version 22.5.12042
This commit is contained in:
25
scripts/agent-local/lvs_stats
Executable file
25
scripts/agent-local/lvs_stats
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.monitoring_lvs.html | 33.3. Monitoring: LVS director throughput statistics from the /proc system (originally /proc/net/ip_vs_stats)
|
||||
# Check your connections per second if you have a loadbalancer with keepalived.
|
||||
|
||||
if [ -f /proc/net/ip_vs_stats ];
|
||||
then
|
||||
#total
|
||||
connections=$(sed -n 3p /proc/net/ip_vs_stats | awk '{print $1}')
|
||||
packets=$(sed -n 3p /proc/net/ip_vs_stats | awk '{print $2}')
|
||||
bytes=$(sed -n 3p /proc/net/ip_vs_stats | awk '{print $4}')
|
||||
|
||||
#per second
|
||||
conspersec=$(cat /proc/net/ip_vs_stats |tail -1| awk '{print $1}')
|
||||
pktpersec=$(cat /proc/net/ip_vs_stats |tail -1| awk '{print $2}')
|
||||
bytespersec=$(cat /proc/net/ip_vs_stats |tail -1| awk '{print $4}')
|
||||
|
||||
echo '<<<app-lvs_stats>>>'
|
||||
echo "connections_total:$((0x$connections))"
|
||||
echo "packets_total:$((0x$packets))"
|
||||
echo "bytes_total:$((0x$bytes))"
|
||||
echo "connections_sec:$((0x$conspersec))"
|
||||
echo "packets_sec:$((0x$pktpersec))"
|
||||
echo "bytes_sec:$((0x$bytespersec))"
|
||||
|
||||
fi
|
Reference in New Issue
Block a user