Parsing stdout through a pipe?
Miki Tebeka
tebeka at cs.bgu.ac.il
Sun Jul 13 11:05:20 EDT 2003
Hello MK,
> 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?
Have a look at the popen2 module.
I'd use wxPython or TKInter for the PopUps.
HTH.
Miki
More information about the Python-list
mailing list