<?php

if ($device['os'] === 'terra') {
    $query = [
        ['sti410C', '.1.3.6.1.4.1.30631.1.9.1.1.5.0'],
        ['sti440',  '.1.3.6.1.4.1.30631.1.18.1.326.5.0'],
    ];

    foreach ($query as $row) {
        if (str_contains((string) $device['sysDescr'], $row[0])) {
            $value = SnmpQuery::get($row[1])->value();
            if (is_numeric($value)) {
                $c = $value / 10;
                discover_sensor(null, 'voltage', $device, $row[1], 0, $row[0], 'Supply voltage', 10, 1, null, null, null, null, $c);
            }
        }
    }

    unset($query);
}
