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]; […]

rm -r für 1001 Nacht

Es war einmal ein Sysadmin, der hatte schon 1000 mal als root den Befehl “rm -r” ausgeführt. Das war gefährlich aber manchmal unabdingbar. Beim 1001ten mal dachte er – nach einem ‘ls /mnt/vz2’ – er sei bereits im Verzeichnis vz2. Aber er war ein Verzeichnis höher. Als er plötzlich die Fehlermeldung sah, “cannot delete /proc/23422… […]

Add/duplicate mailman list

pre:/usr/lib/mailman/bin# newlist Enter the name of the list: vmk11 Enter the email of the person running the list: root@vmk.zhdk.ch Initial vmk11 password: To finish creating your mailing list, you must edit your /etc/aliases (or equivalent) file by adding the following lines, and possibly running the `newaliases’ program: ## vmk11 mailing list vmk11: “|/var/lib/mailman/mail/mailman post vmk11” […]