Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > e5dacb39141c2088e2c30e21fa0b2b06 > files > 73

nagios-check_mk-doc-1.2.3i1-3.mga4.noarch.rpm

#!/bin/bash

# Beware: this is a draft and not yet tested. Use this as datasource_program
# for a host that is an DELL iDrac remote management interface.

HOST=$1
USERNAME=$2
PASSWORD=$3

echo '<<<check_mk>>>'
echo 'Version: ipmi 1.0'
echo 'AgentOS: IPMI'

if which ipmi-sensors >/dev/null 2>&1
then
    echo '<<<ipmi_sensors>>>'
    ipmi-sensors -h $1 -u $2 -p $3 -l USER -Q --ignore-not-available-sensors --legacy-output \
       | sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@ \([^(]*\)_(\([^)]*\))@ \2_\1@'
else
    echo '<<<ipmi>>>'
    ipmitool -i lan -H "$HOST" -U "$USERNAME" -f "$PASSWORD" sensor show 2>/dev/null \
       | grep -v 'command failed' \
       | sed -e 's/ *| */|/g' -e 's/ /_/g' -e 's/_*"'$'"//' -e 's/|/ /g' \
       | egrep -v '^[^ ]+ na ' \
       | grep -v ' discrete '
fi