Hi Buran,
changed some code... used snmp.get instead of snmp.get_bulk
now i am getting below report
changed some code... used snmp.get instead of snmp.get_bulk
now i am getting below report
#!/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(fans_oids)] temp_status = [temp.value for temp in session.get(temps_oids)] print (fan_values) print (temp_status)output is as below
Output:[root@localhost scripts]# python zyxelheath.py
[u'4320', u'4386', u'4354']
[u'42', u'34', u'35']
[u'3958', u'4020', u'4032']
[u'41', u'32', u'33']
can you please help to print like Sr No, IP, Fan1 Fan2 Fan3 Temp1 Temp2 Temp3