Hi,
I am using Ambari 2.2 and I would like to enable the SNMP
alerts.
For enabling the alerts I followed the below link:
https://community.hortonworks.com/articles/74370/snmp-alert.html
The "snmp_mib_script.sh" has snmptrap command, which take
localhost as the "HOST" parameter as below:
Can this "Host" parameter be taken from the Ambari "Edit Notification" screen,
just like the alert state, alertname etc?
HOST=localhost
COMMUNITY=public
STATE=0
if [ $4 == "OK" ]; then
STATE=0
elif [ $4 == "UNKNOWN" ]; then
STATE=1
elif [ $4 == "WARNING" ]; then
STATE=2
elif [ $4 == "CRITICAL" ]; then
STATE=3
fi
/usr/bin/snmptrap -v 2c -c $COMMUNITY $HOST ''
APACHE-AMBARI-MIB::apacheAmbariAlert alertDefinitionName s "$1" alertName s
"$2" alertText s "$5" alertState i $STATE alertService s "$3"
Thanks,
Satya.