Skip to content

Instantly share code, notes, and snippets.

View marcriddle's full-sized avatar

Marc Riddle marcriddle

View GitHub Profile
#!/bin/bash
# This script reads a static VM list from /tmp/vms.txt and live network data
# to produce a sorted report of the top 20 VMs with the highest network drop rates.
# Ensure the VM list file exists before running
if [ ! -f /tmp/vms.txt ]; then
echo "Error: VM list file /tmp/vms.txt not found."
echo "Please create it first with: qm list > /tmp/vms.txt"
exit 1
fi
#!/bin/bash
awk '
BEGIN {
# Print the header for our output with better formatting
printf "%-15s %-65s %15s %12s %12s\n",
"INTERFACE", "VM NAME", "TX PACKETS", "TX DROPS", "DROP RATE %"
printf "%-15s %-65s %15s %12s %12s\n",
"---------------", "-----------------------------------------------------------------",
"---------------", "------------", "------------"