Ambari SNMP Alert Setting
Test Environment
Description
Prepare the SNMP Test Server
- install snmp
1 | yum install net-snmp net-snmp-utils net-snmp-libs –y |
- change authorization
1 | # authCommunity log,execute,net public |
- add Ambari MIB definition
The current version of Ambari (2.4.2) does not contain MIB definition file. Manually copy the content from ambari jira
https://issues.apache.org/jira/secure/attachment/12761892/APACHE-AMBARI-MIB.txt
1 | vi /usr/share/snmp/mibs/APACHE-AMBARI-MIB.txt |
- Start the SNMP trap daemon to log all traps to /tmp/traps.log for testing purpose
1 | nohup snmptrapd -m ALL -A -n -Lf /tmp/traps.log & |
- test the Ambari MIB is being respected by SNMP Server
From the SNMP server, run below command
1 | snmptrap -v 2c -c public localhost '' APACHE-AMBARI-MIB::apacheAmbariAlert alertDefinitionName s "definitionName" alertDefinitionHash s "definitionHash" alertName s "name" alertText s "text" alertState i 0 alertHost s "host" alertService s "service" alertComponent s "component" |
Then check the notification/trap is loged in /tmp/traps.log
1 | 2017-07-05 12:04:17 UDP: [127.0.0.1]:48795->[127.0.0.1]:162 [UDP: [127.0.0.1]:48795->[127.0.0.1]:162]: |
Define notification from Ambari Server
From Menu "Alerts->Actions->Manage Notifications"
![DefineAmbariSNMPNotification.PNG]
Test Ambari Cluster notification can be sent out
Stop Kafka Broker and check the SNMP Server /tmp/traps.log
1 | 2017-07-05 10:47:48 UDP: [10.241.212.35]:39631->[10.241.86.87]:162 [UDP: [10.241.222.35]:39631->[10.241.86.87]:162]: |
Reference Url
https://community.hortonworks.com/articles/74370/snmp-alert.html
https://github.com/apache/ambari/tree/trunk/contrib/alert-snmp-mib