agent/module, monitoring, and traps
Joel Thompson <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Folks,
I've successfully installed the latest net-snmp on windows (using cygwin
to run the snmpd, but
will be next attempting to make this MSVC compiled and started as native
exe w/o cygwin
dependencies).
I've used this tutorial to setup a simple GET/SET of a variable w/
nstAgentModuleObject.c .
My objective is to use NET-SNMP to monitor our RESOURCE (our own
database software);
and create traps when DB is down (unexpectedly). I'm wanting to do this
as simply as
possible, and hopefully all through C programming, I'd prefer to not use
shell scripts and cron,
since that would mean our clients would have to setup cygwin to run our
SNMP mgmt solution
(via net-snmp).
*** Monitoring resource
Plan A:
I'm thinking could spin a thread in the Agent to "monitor" the resource
(my custom db), and then call
the net-snmp functions to create the trap. Any tips on this would be
great. How can
I init/startup up my thread within the framework of net-snmp startup?
Also, I read
that net-snmp is NOT thread safe - yet I'd just be setting my own
"status" variable
at intervals determined within my own thread. Any problems with this
type of
approach, or is there something simpler/better within the framework of
NET-SNMP?
Plan B: write a standalone program, that we kick off with startup batch
file that also
starts up SNMPD, and then it would then monitor my resource, and simply
make a
fork-exec call to run "snmpset"
I don't believe I need to run snmptrapd to handle TRAPS, as I want the
traps to
go to the NMS (Network Mgmt Stations), is that correct?
*** I'd also like some feedback on my AGENT/Module implementation:
Implement the agent side by compiling into NET-SNMP a Module (as modeled
after nstAgentModuleObject.c). The module will have these features. The
monitor
part will be implemented with the TRAP strategy above.
1) state variable {UP,DOWN,STARTING,SHUTTING DOWN}
2) command variable {STATUS, PING, STARTUP, SHUTDOWN,TRAPPED}
3) a monitor (plan A or B, above) that checks for the state of the
system (RESOURCE),
and generate a TRAP (when system is down, and last
command is NOT SHUTDOWN or TRAPPED), it then
set's the last command to TRAPPED and state to DOWN.
4) if PING command sent from NMS, and system is DOWN, then do #3
5) if STATUS command sent from NMS, then it probes actual state of
RESOURCE, and
will set state variable accordingly, but will not generate TRAP in #3.
Thank you for any advice you have. I really appreciate it.
Sincerely,
Joel
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users