Question

I'm new in SNMP and I just configured the agent and the manager and I'm able to receive the traps sent by the agent. But I noticed that the traps received by the manager are captured between 10 seconds, but I need to receive the traps as soon as I generate them not between 10 sec. I'll show you my script which is intended to capture the signal avg power that a client has with an Access Point, the samples are taking between 1 sec and I need to send that trap to the manager in less time than 1 sec.

while :
do
             valor=$(iw dev wlan0 station dump \
             | grep 'signal avg': | awk '{print $3}')
             snmptrap -v 1 -c public 192.168.1.25 '1.2.3.4.5.6' \
             '192.168.1.1' 6 99 '55' 1.11.12.13.14.15 s "$valor"
             echo $valor >> muestras.txt
             sleep 1
done

But surprisingly the traps seems to be generated between 10 sec or maybe the manager is receive them in an elapsed time of 10 sec. I don't know where is the problem, in the agent or in the manager, but I'm sure that the agent generates samples in 1 sec because "muestras.txt" shows that.

Hope you can help me!. Greetings!

Était-ce utile?

La solution

I found the answer. The problem was in the server who executes snmptrapd. Simply I passed the argument -n to the snmptrapd and that solved all!.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top