-- MathiasMuench - 20 Oct 2008

LSF Batch Host status für Nagios
/usr/lib/nagios/plugins/check_snmp -P 1 -C public -p 163 -m LSF-SNMP-MIB -H lxlsf1 -w 5:4 -c 3:2 -o

LSF Batch Host Names
snmpwalk -v 1 -c public -m LSF-SNMP-MIB -Ov -OQ lxlsf1:163 lsbHostName

E-Mail Prefixes and Passwords from Wiki (for Nagios), /tmp/xx contains list of wiki names
lxwww01:~# for i in $(cat /tmp/xx); do grep Email.*gsi.de $i.txt | sed -e 's/^.*: //' -e 's/@.*$//' | tr [:upper:] [:lower:]; grep $i /var/www/wiki.gsi.de/data/.htpasswd; done

Massen-Kommando für Nagios
while read; do echo "[$(date +%s)] ACKNOWLEDGE_HOST_PROBLEM;$REPLY;1;1;1;Mathias Muench;Stromabschaltung"; done >/var/lib/nagios2/rw/nagios.cmd

LSF Batch infos in Config verwandeln
ssh lxi008 ". /LSF/lsf/conf/profile.lsf; /LSF/lsf/bin/bhosts -R sarge32" | sed 1d | tr -s \  | cut -d\  -f1 | while read; do echo "{../LSF_Batch_Hosts/$REPLY/Jobs},+,"; done

/usr/lib/nagios/plugins/check_generic -n "LSF Batch Host Status" -e "snmpget -v 1 -c public -m LSF-SNMP-MIB -Oq -Ov lxlsf1:163" -o "=~/ok|closed/" -w "=~/unavail|unreach/"

cfengine hosts
cfshow --last-seen | grep '^[0-9]' | cut -d\  -f1 | sort -u | while read; do host $REPLY; done | grep pointer | cut -d\  -f5 | cut -d\. -f1

Tote SNMP Agents
perl -e 'print reverse <>' /var/log/torrus/collector.IT.log | sed '/Rebuilding/q' | grep unreach | sed -e 's/:161:public//' -e 's/.*: //' | sort -u | while read; do host $REPLY; done

Tote NFS Filesysteme
mount | sort -u | awk '$1 ~ /:/ { print $1 }' | while read; do ping -c 1 ${REPLY%:*} || umount -l $REPLY; done
Topic revision: r7 - 2009-05-18, MathiasMuench
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)