# vzlist | grep -v CTID | awk {‘print ” echo -n “””$1” – “” ; vzctl exec “$1″ cat /proc/loadavg ” ‘} | sh “On Linux the load average includes processes blocking on I/O. A slow disk setup can cause a high load.” http://openvz.org/pipermail/users/2009-March/002766.html
Tag Archives: openvz
Nagios Client for RAID / OpenVZ without sudo
apt-get install nagios-nrpe-server nagios-plugins wget http://www.lsi.com/downloads/Public/SATA/SATA%20Common%20Files/cli_linux_10.2.1_9.5.4.zip unzip cli_linux_10.2.1_9.5.4.zip mv x86_64/tw_cli /usr/local/sbin/ root@vz2010:~# cat /etc/nagios/nrpe_local.cfg command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 command[check_raid]=/bin/cat /tmp/3ware command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 10M -c 20M -p /dev/sda1 command[check_vz]=/usr/lib/nagios/plugins/check_vz_ubc root@vz2010:~# grep observer /etc/nagios/nrpe.cfg allowed_hosts=observer.vmk.zhdk.ch root@vz2010:~# crontab -l * * * * * cat /proc/user_beancounters > /tmp/user_beancounters * * * * * /usr/lib/nagios/plugins/check_3ware.pl -d c2 >/tmp/3ware […]
Skript zur Auswertung der UBC
Das folgende Skript liefert für jeden UBC-Parameter/VE den Wert: maxheld/limmit. Man sieht so, welche Resourcen von welcher VE am stärksten in Anspruch genommen werden. Gut zu erkennen ist das in folgendem ODS-Diagram (Skriptausgabe Copy/Paste ins Openoffice): VE-Parameters.ods #!/usr/bin/perl $params=`vzsplit -n 20`; @lines=split(/\n/,$params); foreach(@lines) { next if(/^#/); @cols=split(/[“:=]/); foreach(@cols) { $barrier{lc($cols[0])}=$cols[2]; […]
Cannot restart VE after moving to another partition
root@files2011:/mnt/vz2/private# vzctl start 2033 Starting container … vzquota : (error) Quota on syscall for id 2033: No such file or directory vzquota on failed [3] root@files2011:/mnt/vz5/root# rm /var/lib/vzquota/quota.2033
openvz do for all VEs
vzlist | awk {‘print “vzctl set ” $1 ” –save –cpuunits=33325 ” ‘} | grep -v CTID | sh
Migrate Webserver
Freshly setup a new VE and copy over config/data files from older one. A field tested example: 1. Setup new VE (1100) 2. On new VE: apt-get install php5-mysql php5-gd php5-imagick optional: cronolog imagemagick locate less 3. check for conflicting GID/UIDs: diff /mnt/vz1/private/1100/etc/group /mnt/vz3/private/1003/etc/group diff /mnt/vz1/private/1100/etc/passwd /mnt/vz3/private/1003/etc/passwd 4. If no conflicts: root@vz2011:/mnt# cp /mnt/vz3/private/1003/etc/group /mnt/vz1/private/1100/etc/ […]