initial commit; version 22.5.12042

This commit is contained in:
2022-12-12 23:28:25 -05:00
commit af1b03d79f
17653 changed files with 22692970 additions and 0 deletions

25
scripts/agent-local/lvs_stats Executable file
View 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