Re: win32 snmptrapd installation and name resolving
"Roland Klein Overmeer [GISS]" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <CACFFo8tF4Pvw+iMRciWhWajaSNnVBgveiKUfmJ2qxVLtJ+XX8g@mail.gmail.com> |
I wanted to have the Python script to send the traps through syslog to my
monitoring server, but when implementing the net-snmp trap handler I found
out that they are also logged to the event log. This is now my main source
of retreiving the traps. The script is almost non functional now and has the
following lines:
import sys
import socket
import time
host='127.0.0.1'
port = 514
trapdata = sys.stdin.read()
# Uncoment for debug
# f = open('c:\snmptrapdlog.txt', 'a')
# f.write("------ " +time.strftime('%X %x') + " ---- New trap received\n")
# f.write(trapdata)
# f.close()
result_trap = 'SNMPTrap '
for datastr in trapdata.split('\n'):
result_trap = result_trap + datastr + ';\n'
#sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#sock.sendto(str(result_trap), (host, port))
#sock.close()
I just did a comment-out of the handler line, restarted the service and
triggered a trap. The handler is still not doing a lookup.
Roland.
On Mon, Aug 22, 2011 at 12:16 PM, Dave Shield <[email protected]>wrote:
> On 22 August 2011 10:02, Roland Klein Overmeer [GISS]
> <[email protected]> wrote:
>
> > config is (snmptrapd.conf):
>
> > traphandle default C:\Python27\python.exe C:\net-snmp\etc\snmp\handler.py
>
>
> So the traps are being logged by a python script - yes?
> What does this script look like?
>
> What happens if you comment out this 'traphandle' line and restart
> snmptrapd (i.e. using the default logging mechanism)?
> What gets logged then?
>
> Dave
>
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
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