We’re smarter together. Learn from this collection of community knowledge and add your expertise.

Defining an SNMP Alert in SAS Environment Manager

by SAS Employee davidbass on ‎04-21-2015 02:53 PM - edited on ‎10-05-2015 02:53 PM by Community Manager (1,860 Views)

One of the most useful features of SAS Environment Manager is the ability to create alerts. The application monitors metrics, scans log files, manages configuration changes, and monitors availability. When there is a change in a resource’s threshold value for one of these items, an event is recorded in SAS Environment Manager’s event message system.

 

If you want to identify a type of event for notification or further action, you can create an alert. Alerts are a user-defined type of event that indicates a critical condition in a selected resource. SAS Environment Manager enables you to create an SNMP trap notification for alerts.

 

Creating a SAS Management Console alert that results in an SNMP trap notification is a process that can be difficult to troubleshoot. There are many potential problem areas, such as routing and filtering, that can mask any configuration errors. In order to eliminate these external issues, the best practice is to configure a local SNMP trap receiver on the SAS Environment Manager server, test everything locally by sending a trap from SAS Environment Manager to a trap receiver that is also configured on the SAS Environment Manager server. After testing is complete, you can then change the configuration to use the production settings. The following steps provide an example of this testing process:

  1. Configure a local SNMP trap receiver for testing.
  2. Verify that the trap receiver works correctly by using an operating system-based trap sender.
  3. In SAS Environment Manager, enable SNMP trap sending and specify the SNMP configuration parameters.
  4. Create a sample SAS Environment Manager alert that causes a SNMP trap notification to be sent.
  5. Verify that the alert caused a SNMP trap notification to be sent.
  6. Change the settings to point to the production trap receiver instead of the local test trap receiver.

To configure the alert, follow these steps:

 

Step 1: Configure a Local SNMP Trap Receiver for Testing

Perform these steps as the root user ID.

  1. Edit the snmptrapd.conf file, located in the /etc directory.
  2. Add these two lines to the file:

    authCommunity log,execute,net public

    logOption f /tmp/snmptraps.log

     

    The logOption line specifies that snmptrapd should write trap messages to the external file /tmp/smptraps.log.

     

  3. Restart the snmptrapd server by issuing this command:

         /etc/init.d/snmptrapd restart

    Verify that you receive a response of OK from the server restart command.

     

  4. Restart the SNMP server by issuing this command:

         /etc/init.d/snmpd restart

    Verify that you receive a response of OK from the server restart command.

Step 2: Verify the SNMP Trap Receiver

After you configure the test configuration, verify that the trap is working as expected. If you are using Windows, you can verify the operation using a snmptrap receiver tool.

  1. Verify that the snmpd server is operating correctly by issuing these commands:

         snmptest –v 2c –c public <host>

         Variable: system.sysDescr.0

         Variable:<blank>

    The value for host is the FQDN name of the SAS Environment Manager server.

     

    Verify that the system responds by returning the MIB system description, for example:

    SNMPv2-MIB::sysDescr.0 = STRING: Linux <host> 2.6.32-220.17.1.el6.x86_64 #1 SMP Thu Apr 26 13:37:13 EDT 2012 x86_64

     

  2. Issue a simple and local snmptrap command. For example:

    snmptrap -v 1 -c public host UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" \

    SNMPv2-MIB::sysLocation.0 s "snmp test string"

     

  3. Verify that the following log entry has been written to your /tmp/snmptraps.log:

    2015-03-13 11:03:04 192.193.194.195(via UDP: [10.122.32.74]:43576->[10.122.32.74]) TRAP, SNMP v1, community public

        iso.2.3.4.5.6 Enterprise Specific Trap (99) Uptime: 0:00:00.55

        iso.11.12.13.14.15 = STRING: "SNMP trap test string"

     

Step 3: Enable SNMP Trap Sending in SAS Environment Manager

Before you can create an alert in SAS Environment Manager that uses SNMP, you must enable SNMP trap sending. At this point in the process, you are configuring SAS Environment Manager to send SNMP traps to the local test receiver.

  1. In SAS Environment Manager, select Manage-> Server Settings to display the Edit Server Settings page.
  2. In the Edit Server Settings page, locate the SNMP Server Configuration Properties area and select 1 in the SNMP Protocol Version field.
  3. Specify these values for the SNMP Server Configuration Properties:

    SNMP Trap OID

    The selected OID value for the test (for example, 1.3.6.1.2.1.11.0.6). This value is the OID of the local test trap receiver.

    Community

    public (the default value).

    Generic ID

    0

    Enterprise OID

    The selected OID value for the test (for example, 1.3.6.1.2.1.11.0.6). This value is the OID of the local test trap receiver.

    Default Notification Mechanism

    v1 Trap

    Specific ID

    leave blank

    Agent Address

    Specify the IP address of the SAS Environment Manager server.

     

Step 4: Create a Test Alert in SAS Environment Manager

After you have verified that the SNMP trap works as expected, use SAS Environment Manager to create a test alert that causes a SNMP trap to be sent. This example creates an alert that will trigger when the File System Reads/Writes per Minute metric is greater than 10. Because this alert will be triggered every time SAS Environment Manager scans for new alerts, it will test the SNMP trap configuration relatively quickly.

  1. In SAS Environment Manager, select Resources ->Browse -> Platform. Locate the entry in the platform table for the SAS Environment Manager platform and select the Alert icon to the left of the platform entry to display the Alerts page.
  2. On the Alerts page, select New to display the New Alert Definition page.
  3. In the New Alert Definition page, specify the following information to define the alert:

    If Condition Metric

    Select File System Reads/Writes per Minute

    If Condition comparison

    Select Greater than and specify 10 for the comparison value.

    Enable Action

    Select Each time conditions are met.

  4. Click OK to define the alert and display the Alert Definition page. Select SNMP Notification.
  5. Specify these values:

    IP Address

    Specify the IP address of the SAS Environment Manager server, followed by a slash and the SNMP trap port (typically 162). An example entry might be 10.122.32.74/162.

    Notification Mechanism

    Select v1 Trap.

    OID

    Specify the OID value for the local test trap receiver (for example, 1.3.6.1.2.1.11.0.6).

    Click Save Changes to save the alert.

     

Step 5: Verify That the Alert Sent a SNMP Trap

After you define the alert, verify that an occurrence of the alert writes a record to the SNMP trap log, which verifies that the SNMP trap was successfully sent from SAS Environment Manager to the local test trap receiver.

  1. Wait until the alert triggers. Be default, alerts are scanned every five minutes, and the alert should be triggered whenever the alerts are scanned. When the alert triggers, a trap should be written to the location specified in step 2 (in this example, /tmp/snmptrap.log). Because the trap is sent to the local test receiver, this location is on the SAS Environment Manager Server machine.
  2. Verify that snmptrapd on the received the trap. The trap should be similar to the following:

    2015-03-13 11:00:23 ptnode24.ptest.sas.com [10.122.32.74] (via UDP: [10.122.32.74]:60162->[10.122.32.74]) TRAP, SNMP v1, community public

    [SNMPv2-MIB::snmp.0.6 Cold Start Trap (0) Uptime: 0:00:00.00

    SNMPv2-MIB::snmp.0.6 = STRING: "SNMP trap example:SNMP trap example <host> File System Reads/Writes per Minute (433.0)

     

Step 6: Change the Alert Settings to Send Traps to the Production Receiver

  1. After you verify that the alert works properly with the local trap receiver, you must change the settings in SAS Environment Manager to send traps to the production trap receiver. Contact your IT staff to determine the values for your organization’s production SNMP trap receiver. You will need to know the IP address and port for the receiver, as well as the OID value.
  2. In SAS Environment Manager, select Manage -> Server Settings to edit the SNMP server configuration properties. Replace the test OID values with your production OID values.
  3. Edit the alert definition in SAS Environment Manager. Change the alert conditions to specify the alert that you want to cause a SNMP notification. Specify your organization’s values for IP Address and OID and save the alert.
  4. If you want to create more alerts with SNMP notification, create the alert normally and specify the values for the production SNMP trap receiver.
Your turn
Sign In!

Want to write an article? Sign in with your profile.