Dec-29-2017, 07:31 AM
Looks fine. This code could not produce the output from your previous post.
I guess fan.value and temp.values is not what you expect - i.e. just RPM or degrees.
could you run following code and post the output
I guess fan.value and temp.values is not what you expect - i.e. just RPM or degrees.
could you run following code and post the output
#!/usr/bin/python from easysnmp import Session community = 'public' with open('zyxeldslam.txt') as ipfile: for sr_no, line in enumerate(ipfile, start=1): ip = line.strip() # Create an SNMP session to be used for all our requests session = Session(hostname=ip, community=community, version=2) # You may retrieve an individual OID using an SNMP GET fan_oids_templ = '1.3.6.1.4.1.890.1.5.13.1.2.1.1.2.0.{}' temp_oids_templ = '1.3.6.1.4.1.890.1.5.13.1.2.3.1.2.0.0.{}' fans_oids = [fan_oids_templ.format(i) for i in range(1,4)] temps_oids = [temp_oids_templ.format(i) for i in range(1,4)] fan_values = [fan.value for fan in session.get_bulk(fans_oids)] temp_status = [temp.value for temp in session.get_bulk(temps_oids)] print (fan_values) print (temp_values)