(I moved this from snmptt-users to net-snmp-users)

Miguel Gómez wrote:
You are right, Dave. Traps are done to report changes in variables we
are interested in. But, how could I do to send a trap periodically no
matter its value changes or not? I have to monitor values like CPU
load and send traps with this value so I use this in "snmpd.conf":

monitor -r 1 -o laNames -o laErrMessage "CargaCPU" laErrorFlag != 0

I found this in snmpd.conf man page. But how could i send a trap every one second that contains the CPU load?

I'm not sure if that is possible, but even if it was, there's probably a better way.


You should be using snmpget to *poll* the server for the memory. For example:

snmpget -v 1 -c public server1 memTotalReal.0

If you really want to send a trap every second and it can't be done using the monitor command (I doubt it can), then you can write a script that polls using the snmpget command above, sends a trap using snmptrap, and then sleeps for 1 second and then loops.

Can I ask why you want to poll for memory every second? What did you plan on doing with the received traps? Are you feeding it in to another system?

If you can describe what exactly you are doing, and why you are doing it, then maybe we can recommend a better approach.

Alex

Dave and Alex, thank you for your help.

Reply via email to