Monday, 21 November 2011

Check average ambient temp in server room using BMC on IBM servers via Icinga or Nagios

First allow in /etc/sudoers for user icinga to launch  /usr/sbin/smbridged without password. Sometimes it needs root privileges. smbridged can be downladed somewhere from IBM :)

Icinga (Nagios) plugin:

#!/bin/bash
s1=$(sudo /usr/sbin/smbridged -ip 192.168.0.10 -u user -p password 
sensor | grep Ambient | cut -d "|" -f5 | cut -d "." -f1)
s2=$(sudo /usr/sbin/smbridged -ip 192.168.0.18 -u user -p 
password sensor | grep Ambient | cut -d "|" -f5 | cut -d "." -f1)
s3=$(( (s1 + s2) / 2 ))


if [ $s3 -ge 23 ] && [ $s3 -le 26 ]; then
echo "Warning: Ambient temperature is $s3" && exit 1
elif [ $s3 -ge 27 ]; then
echo "Critical: Ambient temperature is $s3" && exit 2
else
echo "OK: Ambient temperature is $s3" && exit 0

Check BMC status on IBM servers via Icinga and Nagios

First allow in /etc/sudoers for user icinga to launch  /usr/sbin/smbridged without password. Sometimes it needs root privileges. smbridged can be downladed somewhere from IBM :)

Extreme simple plugin:
#!/bin/bash
error=$(sudo /usr/sbin/smbridged -ip $1 -u user -p password sensor 2>&1 | cut -d '|' -f 4 | egrep -i "Failure|Error")
if [ -n "$error" ]
then
echo Warning: $error && exit 1
else
echo Everything is OK! && exit 0
fi

Ping does not work

Today I would like to discuss a banal situation: host A is directly connected to host B, ping from host A to host B does not work. What are...