@metrics(['Environment | Sensor Status'], volatile=False, access='S')
def get_sensor_status(self, metrics):
    for metric in metrics:
        port = metric.labels[0].rsplit('::', 1)[(- 1)]
        if ('st' in port):
            continue
        value = 1
        port = metric.labels[0].rsplit('::', 1)[(- 1)]
        status = self.snmp.get(f'1.3.6.1.4.1.41752.5.15.1.{metric.ifindex}.0')
        if (status is None):
            continue
        if ((metric.ifindex == 1) and (int(status) == 0)):
            value = 0
        elif (metric.ifindex == 2):
            if (is_float(status) and ((- 55) < float(status) < 600)):
                value = 0
        elif ((metric.ifindex in [4, 6]) and (float(status) > 0)):
            value = 0
        elif ((metric.ifindex == 9) and (int(status) != 2)):
            value = 0
        self.set_metric(id=('Environment | Sensor Status', metric.labels), labels=[f'noc::sensor::{port}'], value=value)
@metrics(['Environment | Sensor Status'], volatile=False, access='S')
def get_sensor_status(self, metrics):
    for metric in metrics:
        port = metric.labels[0].rsplit('::', 1)[(- 1)]
        if ('st' in port):
            continue
        value = 1
        port = metric.labels[0].rsplit('::', 1)[(- 1)]
        status = self.snmp.get(f'1.3.6.1.4.1.41752.5.15.1.{metric.ifindex}.0')
        if (status is None):
            continue
        if ((metric.ifindex == 1) and (int(status) == 0)):
            value = 0
        elif (metric.ifindex == 2):
            if (is_float(status) and ((- 55) < float(status) < 600)):
                value = 0
        elif ((metric.ifindex in [4, 6]) and (float(status) > 0)):
            value = 0
        elif ((metric.ifindex == 9) and (int(status) != 2)):
            value = 0
        self.set_metric(id=('Environment | Sensor Status', metric.labels), labels=[f'noc::sensor::{port}'], value=value)