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:
To configure the alert, follow these steps:
Perform these steps as the root user ID.
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.
/etc/init.d/snmptrapd restart
Verify that you receive a response of OK from the server restart command.
/etc/init.d/snmpd restart
Verify that you receive a response of OK from the server restart command.
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.
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
snmptrap -v 1 -c public host UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" \
SNMPv2-MIB::sysLocation.0 s "snmp test string"
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"
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.
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.
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.
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.
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.
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.
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)
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.