I try listen new file lines and resend it in snmptraps
:
#!/usr/bin/env python
import subprocess
sreader = "tail -f /root/zsv/log"
ssreader = subprocess.Popen(sreader,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
strap = 'snmptrap -c iptvinfo -v 2c 192.168.10.10:163 "" 1.3.3.3.3.3.3.3 1.2.2.2.2.2.2 s '
subprocess.Popen([strap + ssreader.communicate()[0]],shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
And I'm not getting anything.. This is my first program, please help fix it