# 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
            rh_humidity = int(var_binds[2][1])
            rh_temperature = int(var_binds[3][1])
            rh_temperature = int(1.8 * rh_temperature) + 32

        # ===============TRI APC SMARTUPS  (Must be SNMPv1)
        logger.debug("Getting: TRI APC SMARTUPS data")
        error_indication, error_status, error_index, var_binds = cmd_gen.getCmd(
            cmdgen.CommunityData(SNMP_COMMUNITY, mpModel=0),       # mpModel=0 for SNMPv1
            cmdgen.UdpTransportTarget(("apc-tri-0.rbh.local", 161)),
            "1.3.6.1.2.1.33.1.2.3.0",                             # UPS Runtime
            "1.3.6.1.2.1.33.1.4.4.1.5.1",                         # UPS Output Load Percent
            "1.3.6.1.4.1.318.1.1.10.2.3.2.1.6.1",                 # Humidity
            "1.3.6.1.4.1.318.1.1.10.2.3.2.1.4.1"                  # Temperature
        )
        if error_indication or error_status:
            logger.warning("TRI APC: " + str(error_indication))
            tri_temperature = "XX"
            tri_humidity = "XX"
            tri_load = "XX"
            tri_runtime = "XX"
        else:
            tri_runtime = int(var_binds[0][1])
            tri_load = int(var_binds[1][1])
            tri_humidity = int(var_binds[2][1])
            tri_temperature = int(var_binds[3][1])
            tri_temperature = int(1.8 * tri_temperature) + 32

        # ===============RAL APC SMARTUPS  (Must be SNMPv1)
        logger.debug("Getting: RAL APC SMARTUPS data")
        error_indication, error_status, error_index, var_binds = cmd_gen.getCmd(

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


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

            rh_humidity = int(var_binds[2][1])
            rh_temperature = int(var_binds[3][1])
            rh_temperature = int(1.8 * rh_temperature) + 32

        # ===============TRI APC SMARTUPS  (Must be SNMPv1)
        logger.debug("Getting: TRI APC SMARTUPS data")
        error_indication, error_status, error_index, var_binds = cmd_gen.getCmd(
            cmdgen.CommunityData(SNMP_COMMUNITY, mpModel=0),       # mpModel=0 for SNMPv1
            cmdgen.UdpTransportTarget(("apc-tri-0.rbh.local", 161)),
            "1.3.6.1.2.1.33.1.2.3.0",                             # UPS Runtime
            "1.3.6.1.2.1.33.1.4.4.1.5.1",                         # UPS Output Load Percent
            "1.3.6.1.4.1.318.1.1.10.2.3.2.1.6.1",                 # Humidity
            "1.3.6.1.4.1.318.1.1.10.2.3.2.1.4.1"                  # Temperature
        )
        if error_indication or error_status:
            logger.warning("TRI APC: " + str(error_indication))
            tri_temperature = "XX"
            tri_humidity = "XX"
            tri_load = "XX"
            tri_runtime = "XX"
        else:
            tri_runtime = int(var_binds[0][1])
            tri_load = int(var_binds[1][1])
            tri_humidity = int(var_binds[2][1])
            tri_temperature = int(var_binds[3][1])
            tri_temperature = int(1.8 * tri_temperature) + 32

        # ===============RAL APC SMARTUPS  (Must be SNMPv1)
        logger.debug("Getting: RAL APC SMARTUPS data")
        error_indication, error_status, error_index, var_binds = cmd_gen.getCmd(

            cmdgen.CommunityData(SNMP_COMMUNITY, mpModel=0),       # mpModel=0 for SNMPv1