simple snmp poller from a flat file

import easysnmp, schedule, csv
from easysnmp import Session

def poll(host, com, ver, mib):
    session = Session(hostname='host', community='com', version=ver)
    output = session.get(mib)

with open ('aircon-hosts.csv' 'w') as inventory:  
    invcsv = csv.reader(inventory)
    for row in invcsv:
        host = row[0]
        frequency = int(row[1])
        com = row[2]
        ver = int(row[3])
        mib = row[4:]
        schedule.every(frequency), com, ver, mib))

while True:

Leave a Reply

Your email address will not be published. Required fields are marked *