ICR-3211
Send an SNMP Trap
This script is going to send an SNMP trap for when the power supply will reach the defined
threshold voltage.
Following items should be revised in the script:
•
SNMP destinated IP address,
•
OID of the SNMP trap,
•
threshold for minimal power supply voltage.
# This script monitors the supply voltage and will send an SNMP trap if below the
treshold.
SNMP_IP=192.168.1.1
# Set SNMP destinated IP address
OID="1.2.3.4.5.6.7.8" # Set the OID
THRESHOLD=8
# Set the threshold voltage level
SENT=0
while true; do
VOLTAGE=‘status sys | awk ’/Voltage/ { print $4 }’‘
if [ $THRESHOLD -lt ${VOLTAGE%.*} ]; then
SENT=0
elif [ $SENT -eq 0 ]; then
# Sending the SNMP trap
snmptrap -c public $SNMP_IP $OID s $VOLTAGE
SENT=1
fi
sleep 1
done
22