ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satyanarayana Jampa <sja...@innominds.com>
Subject Enabling SNMP alerts
Date Tue, 06 Jun 2017 06:09:54 GMT
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.


Mime
View raw message