Skip to content

Instantly share code, notes, and snippets.

@demofly
Created July 14, 2014 03:19
Show Gist options
  • Select an option

  • Save demofly/8eb63a5c4904c270f5bc to your computer and use it in GitHub Desktop.

Select an option

Save demofly/8eb63a5c4904c270f5bc to your computer and use it in GitHub Desktop.
152-ФЗ формат таблицы с описью OpenVZ виртуалок
seqid=0
for i in `vzlist -o ctid -H`
do
((sequid++))
vzctl exec $i "echo \"$sequid \`hostname -f\` \`lsb_release -a 2>/dev/null | grep Description | sed -r 's#.*:[ \t]+##g'\` \`cat /proc/cpuinfo | grep 'physical id' | uniq | wc -l\` CPU; \`free -h | grep Mem | awk '{print \$2}'\` RAM; \`df -hT | grep '/\$' | awk '{print \$3}'\` HDD \`ip -o -4 a s | grep brd | sed -r 's#.* ([0-9\.]{7,})/.*#\1#' | tr -s '\n' ' '\` \`netstat -tlpn | grep '^tcp\|^udp' | cut -d/ -f2 | sort -u | tr -s '\n' ' ' | sed 's#zabbix_agentd ##; s#exim4 ##; s#postgres#PostgreSQL#; s#config.ru ##; s#master#Postfix#; s#apache#Apache#; s#mysqld#MySQL#'\`\""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment