Parsing stdout through a pipe?

MK MK at foo.com
Sat Jul 12 13:05:20 EDT 2003


I have a Win32 console application (SNMPUTIL.EXE) which listens
to incoming SNMP messages:

C:\>snmputil trap
snmputil: listening for traps...


When a trap is generated on a remote server, it is being sent to
the PC running SNMPUTIL.EXE, and  then finally printed out to
stdout like this:

snmputil: trap generic=6 specific=11003
  from -> 10.198.163.89
Variable = system.sysName.0
Value    = String DEAUDIIP109387
Variable = .iso.org.dod.internet.private.enterprises.232.11.2.11.1.0
Value    = Integer32 0
Variable = .iso.org.dod.internet.private.enterprises.232.11.2.8.1.0
Value    = String Compaq Management Agents Test Trap sent - Samstag, 12.
Juli 2003 18:52:19


I'd like to write a Python application which would intercept/parse this
stdout
output, and invoke various pop-ups ("alarms"). Any ideas?






More information about the Python-list mailing list