Download SunNet Manager 2.2.3 Programmer`s Guide

Transcript
12
Data gathering methods fall into two categories. Agents may be able to
report data instantly or they may need to integrate it over time before
reporting. For instant reporting, the agent reports the data then sleeps for
the interval specified. For integrative reporting, the agent performs some set
of actions over time before the data can be reported. For instance, the
supplied ping agent sends many ICMP ECHO requests at one second
intervals, then waits a small amount of time for the ECHO REPLY responses.
It may take up to 20 seconds for a single report to be sent.
Agents who take a substantial amount of time to integrate and report
should subtract their processing time from the manager-specified <interval>,
so reports are sent as often as requested. Otherwise, an interval of 20
seconds and a processing time of 20 seconds would mean reports would be
sent every 40 seconds—clearly not what the manager intended. Again, agent
writers are encouraged to document any specific decisions they make along
these lines, so users know what report intervals make sense for an agent.
<flags>
unsigned integer bit string specifying request options. Currently no request
options are defined for use by agents.
12.4 Sending Reports
After a request is received and validated, a child process is created and the
agent-supplied dispatch procedure is called. The dispatch procedure collects
the information requested and sends reports at the specified intervals.
Figure 12-3 provides a flow diagram for request handling.
When servicing a request, the child process should:
12-10
•
Get any optional request argument by calling netmgt_get_argument()
setting the parameter argname to NETMGT_OPTSTRING as defined in
netmgt_define.h.
•
•
Obtain the data.
Build a reporting argument list with the current attribute data using
netmgt_build_report(), once for each attribute. Check the return code
for any errors. If you are interested in whether an event has occurred for the
particular attribute (because you intend to do further processing), you can
SunNet Manager 2.2.3 Programmer’s Guide