Re: Trap to command rather than remote snmptrapd

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/4/17 Anthony Wright <[email protected]>:
> I suspect I know the answer to this, but is it possible to get snmpd to
> run a command when it issues a trap rather than sending out a trap packet?

Yes.  Well, sort-of.

It is certainly possible to configure the agent to run a command when
it receives a SET request.  (e.g. using the "extendfix" mechanism)


It is also possible to configure the agent to apply an internal SET request
(rather than sending a trap) when certain events occur.  See the
snmpd.conf(5) section on the DisMan Event MIB - in particular,
the setEvent token.



> I want to keep an eye on disk space and when it gets to high remove
> some log files.

Try splitting this task into several subtasks.

> I wondered if it is possible for snmpd to watch the disk space...

That much is already supported.
(You even have a choice of tables!)

>    ... and run my remove logs program...

Use "entendfix" (or the nsExtend tables directly) to configure this
command to be run "on demand".

>                                                     when the free space get's to low.

Configure the agent (using "monitor") to send a trap when this happens.
Then tweak that monitor directive to invoke a SET on the extendfix
instance instead.


Dave

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.