Script to check the load of all VPS from the main node:

# for i in `vzlist |egrep -v '(VEID|CTID)' |awk '{print $1}'`; do echo "For VEID $i (`vzctl exec $i hostname`) --->" ; vzctl exec $i w ; echo; done

Instead of "w" replace with the COMMANDS you need to be executed common in ALL of the VPSs and you'll get corresponding results !!! :)

For eg:

[root@vz1 ~]# for i in `vzlist |egrep -v ‘(VEID|CTID)’ |awk ‘{print $1}’`; do echo “For VEID $i (`vzctl exec $i hostname`) —>” ; vzctl exec $i w ; echo; done

For VEID 107 (vpn.xxx.net) —>
04:01:08 up 210 days, 6:01, 0 users, load average: 0.08, 0.02, 0.01
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

For VEID 109 (xxx.xxx.net) —>
04:01:08 up 210 days, 6:01, 0 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

For VEID 111 (xxx.xxxx.com) —>
04:01:08 up 210 days, 6:01, 0 users, load average: 0.00, 0.00, 0.02
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

Leave a Reply

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny