# Path: credentials.py
# SNMP_COMMUNITY = "public"


from pysnmp.entity.rfc3413.oneliner import cmdgen
from credentials import SNMP_COMMUNITY
import time
import json
import logging.config
    def __init__(self, name, oids):
        self.name = name
        self.interface_oids = oids          # List of oids
        self.snmp_data = []                 # Hold raw data
        self.datapoints = []                # Holds pretty data
        self.__class__.all_aggr_interfaces.append(self)     # Add self to static array


class SNMPDatapoint:
    def __init__(self, value, timeticks):
        self.value = value
        self.timeticks = timeticks


def get_snmp(device, community, snmp_oid1, snmp_oid2, snmp_uptime_oid):
    """Returns the value of the specified snmp OID.
     Also gets the uptime (TimeTicks) so we know exactly when the sample was taken."""

    # Perform a synchronous SNMP GET
    cmd_gen = cmdgen.CommandGenerator()
    error_indication, error_status, error_index, var_binds = cmd_gen.getCmd(
        cmdgen.CommunityData(community), cmdgen.UdpTransportTarget((device, 161)), snmp_oid1, snmp_oid2, snmp_uptime_oid
    )

    snmp_value1 = None
    snmp_value2 = None
    snmp_error = None
    snmp_uptime_value = None

    if error_indication:                         # Check for SNMP errors

# Path: credentials.py
# SNMP_COMMUNITY = "public"


# Path: snmp_interface_1.py
from pysnmp.entity.rfc3413.oneliner import cmdgen
from credentials import SNMP_COMMUNITY
import time
import json
import logging.config

    def __init__(self, name, oids):
        self.name = name
        self.interface_oids = oids          # List of oids
        self.snmp_data = []                 # Hold raw data
        self.datapoints = []                # Holds pretty data
        self.__class__.all_aggr_interfaces.append(self)     # Add self to static array


class SNMPDatapoint:
    def __init__(self, value, timeticks):
        self.value = value
        self.timeticks = timeticks


def get_snmp(device, community, snmp_oid1, snmp_oid2, snmp_uptime_oid):
    """Returns the value of the specified snmp OID.
     Also gets the uptime (TimeTicks) so we know exactly when the sample was taken."""

    # Perform a synchronous SNMP GET
    cmd_gen = cmdgen.CommandGenerator()
    error_indication, error_status, error_index, var_binds = cmd_gen.getCmd(
        cmdgen.CommunityData(community), cmdgen.UdpTransportTarget((device, 161)), snmp_oid1, snmp_oid2, snmp_uptime_oid
    )

    snmp_value1 = None
    snmp_value2 = None
    snmp_error = None
    snmp_uptime_value = None

    if error_indication:                         # Check for SNMP errors

        snmp_error = str(error_indication)