JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Solaris System Management Agent Developer's Guide
search filter icon
search icon

Document Information

Preface

1.  Introduction to the System Management Agent

2.  Creating Modules

3.  Data Modeling

4.  Storing Module Data

5.  Implementing Alarms

Refresh Intervals

Asynchronous Trap Notification

Thresholds for Sending Traps

demo_module_4 Code Example for Alarms

Reading Data From the demo_module_4.conf Configuration File

Using SNMP_CALLBACK_POST_READ_CONFIG in demo_module_4

Generating Traps in demo_module_4

6.  Deploying Modules

7.  Multiple Instance Modules

8.  Long-Running Data Collection

9.  Entity MIB

10.  Migration of Solstice Enterprise Agents to the System Management Agent

A.  SMA Resources

B.  MIBs Implemented in SMA

Glossary

Index

Asynchronous Trap Notification

Typically, checking for trap conditions is done in the following sequence:

  1. Get current data for a particular node.

  2. Compare the data with a threshold to check if the trap condition is met.

  3. Send a trap to the manager if the condition is met.

Steps 2 and 3 are implemented in SMA by calling an algorithm after data for a node is acquired. The algorithm determines if an alarm condition is met. The algorithm in most cases involves comparing the current data with the threshold. If the algorithm indicates that an alarm condition is met, the appropriate trap functions are called to issue a trap. In demo_module_4, steps 2 and 3 are performed in the following function:

void refreshLoadAvg(unsigned int clientreg, void *clientarg) { 

    // Refresh Load data

    // Check if Load data crossed thresholds, send trap if necessary.
    check_loadavg1_state();
    check_loadavg5_state();
    check_loadavg15_state();

}

The check_loadavg_state functions compare the current load data with thresholds. The functions also send the traps if necessary.

The module must use a trap function such as send_v2trap() to send a trap to the manager. For more information on SNMP trap APIs, see /usr/sfw/doc/sma_snmp/html/group__agent__trap.html. The SNMP trap notifications are defined in SNMP-NOTIFICATION-MIB.txt. For demo_module_4, the trap notifications are defined in SDK-DEMO4-MIB.txt.