Solaris System Management Agent Developer's Guide

Thresholds for Sending Traps

In the System Management Agent, any configurable data can be stored in a module-specific configuration file. Data from this file can be loaded into the module at the time of module initialization. Data is read from the configuration files into a module by registering a callback function to be called whenever an interesting token is encountered.

register_config_handler("demo_module_4", "threshold_loadavg1",
read_load_thresholds, NULL, NULL);

In this example demo_module_4, whenever a threshold_loadavg1 token is read by the agent in the demo_module_4.conf file, the read_load_thresholds() function is called, with token name and value as arguments. The read_load_thresholds() function stores the token value in appropriate variables and uses these thresholds to determine alarm conditions. For more information on the register_config_handler APIs, see the documentation in /usr/sfw/doc/sma_snmp/html/group__read__config.html.