Giter Club home page Giter Club logo

snmptrap-alerting-extension's Introduction

AppDynamics SNMP Trap Alerting Integration

##Use Case

Simple Network Management Protocol (SNMP) is a protocol for managing IP network devices such as routers, switches, servers, workstations, etc. An SNMP trap is an asynchronous notification between an SNMP agent to its SNMP manager.

With the SNMP Trap integration you can leverage your existing alerting infrastructure to notify your operations team to resolve performance degradation issues.

This tool sends SNMP trap alerts when triggered via an AppDynamics 3.6/3.7 policy violation and can be configured as a custom action (see Installation).

##Installation

  1. Download the SNMPTrapAlertingExtension zip from AppDynamics Exchange

  2. Unzip the SNMPTrapAlertingExtension.zip file into <CONTROLLER_HOME_DIR>/custom/actions/ . You should have <CONTROLLER_HOME_DIR>/custom/actions/SNMPTrapAlertingExtension created.

  3. Check if you have custom.xml file in <CONTROLLER_HOME_DIR>/custom/actions/ directory. If yes, add the following xml to the element.

     ```
         <action>
              <type>SNMPTrapAlertingExtension</type>
              <!-- For Linux/Unix *.sh -->
              <executable>snmpTrapSender.sh</executable>
              <!-- For windows *.bat -->
              <!--<executable>snmpTrapSender.bat</executable>-->
         </action>
     ```
    

    If you don't have custom.xml already, create one with the below xml content.

           <custom-actions>
           <action>
                <type>SNMPTrapAlertingExtension</type>
                <!-- For Linux/Unix *.sh -->
                <executable>snmpTrapSender.sh</executable>
                <!-- For windows *.bat -->
                <!--<executable>snmpTrapSender.bat</executable>-->
           </action>
           </custom-actions>
    

    Uncomment the appropriate executable tag based on windows or linux/unix machine.

  4. cd into /custom/conf/SNMPTrapAlertingExtension and edit the config.xml configuration file.

    ###Parameters

    SNMP Parameters Description
    host Host of the destination where the trap is being sent
    port Port of the destination where the trap is being sent
    trap-host IP address of the source that is sending the trap
    community Community type of the SNMP trap. Default = PUBLIC
    enable-logs Enables logging for debugging purposes
    snmp-version Trap version. (Supports v1, v2 and v3 traps)

    ####Trap Version 3 specific parameters

    SNMP Parameters Description
    security-level NoAuthNoPriv = 1 
    AuthNoPriv = 2
    AuthPriv = 3

    If necessary, see information on security levels.
    username Username to validate trap
    password Password to validate trap. Required for security-level greater than 1
    auth-protocol Authentication Protocol (MD5 or SHA). Required for security-level greater than 1
    priv-protocol Privacy Protocol. Required for security-level = 3 (AuthPriv)

    Supports:
    • AES256
    • AES192
    • AES128
    • 3DES
    • DES
    priv-protocol-password Privacy protocol password. Required for security-level = 3 (AuthPriv)

    ###Example:

    <snmp-trap>
    	<host>localhost</host>
        <port>9000</port>    
        <community>PUBLIC</community>     
        <trap-host>172.16.0.0</trap-host>     
        <enable-logs>true</enable-logs>     
        <snmp-version>3</snmp-version>     
        <!--Only requred if version set to 3.-->     
        <v3>         
        	<security-level>2</security-level>         
        	<username>username</username>         
       		<password>password</password>         
        	<auth-protocol>SHA</auth-protocol>         
        	<priv-protocol>DES</priv-protocol>         
        	<priv-protocol-password>password</priv-protocol-password>     
      	</v3> 
      </snmp-trap> 
             
    
  5. Now you are ready to use this extension as a custom action. In the AppDynamics UI, go to 'Alert & Respond' -> 'Actions'. Click on the 'Create Action' button. Select 'Custom Action' and click OK. In the drop-down menu you can find the action called 'SNMPTrapAlertingExtension'.

  6. Use the MIB file <CONTROLLER_HOME_DIR>/custom/actions/SNMPTrapAlertingExtension/conf/APPD-CTLR-MIB.mib to interpret the trap at the trap receiver.

##Debugging

To debug the code:

  1. Modify the config file and enable logs.

    <enable-logs>true</enable-logs>
    
  2. Open <custom_action_directory>/logs/snmpTrapSender.log

##Testing

If you'd like to send a test trap for Debug purpose please use the sendSampleTrap.sh script. This Script will send a simple Trap using the Action Configuration. You can use this to verify that the transmission works and the Trap would be received without the need of producing a real error or event.

##Using the jar file as a standalone

The jar file can be used as a standalone. For information enter "--help" when running the jar:

```
For Windows,

..\..\..\jdk\bin\java -Dlog4j.configuration=file:conf\log4j.xml -DSNMP_TRAP_SENDER_HOME=. -jar .\lib\SNMPTrapSender.jar --help


For Linux/Unix,

../../../jdk/bin/java -Dlog4j.configuration=file:conf/log4j.xml -DSNMP_TRAP_SENDER_HOME=. -jar ./lib/SNMPTrapSender.jar --help
```

##Contributing

Always feel free to fork and contribute any changes directly via GitHub.

##Community

Find out more in the AppSphere community.

##Support

For any questions or feature request, please contact AppDynamics Center of Excellence.

snmptrap-alerting-extension's People

Contributors

appdashishmehta avatar dustinwhittle avatar kunalgupapdx avatar leika avatar viktorgavrielov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.