[Tutor] os.popen doesn't give up

Ben Vinger benvinger at yahoo.co.uk
Thu Dec 2 17:37:15 CET 2004


I call net-snmp from a Python script as below.  The
script works fine and runs every 5 minutes.  But after
collecting data for a few weeks, I noticed many
instances of the script, as well as the snmpget
executable in the process table.  I think this must be
due to times when the remote site was not available,
so would like to know how I can get os.popen and
snmpget not to do this (ie, give it a rest when the
remote site doesn't respond)


I = os.popen(r'snmpget -Os -c ' + SNMPcommunity + ' -v
2c -r 3 ' + IP + ' ' + counter, 'r')

Thanks
Ben


		
___________________________________________________________ 
Moving house? Beach bar in Thailand? New Wardrobe? Win £10k with Yahoo! Mail to make your dream a reality. 
Get Yahoo! Mail www.yahoo.co.uk/10k


More information about the Tutor mailing list