Refresh intervals, also known as automatic refresh, can be implemented in the System Management Agent. You can use a callback mechanism that calls a specified function at regular intervals. Data refresh can be implemented by the snmp_alarm_register() function. In demo_module_4, the load data is refreshed at a configurable time interval, 60 seconds in this example, using the following callback:
snmp_alarm_register(60, SA_REPEAT, refreshLoadAvg, NULL); void refreshLoadAvg(unsigned int clientreg, void *clientarg){ // Refresh the load data here }
The snmp_alarm_register() function can be included in the init_()module() function so that the refresh interval is set during the initialization of the module.