<?php use LibreNMS\RRD\RrdDefinition; $name = 'cabinet_climate'; $app_id = $app['app_id']; $options = '-Oqv'; $oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.15.99.97.98.105.110.101.116.95.99.108.105.109.97.116.101'; $cabinet_climate = snmp_walk($device, $oid, $options); list( $inside_cabinet_temperature, $inside_cabinet_humidity, $outside_cabinet_temperature, $outside_cabinet_humidity, 'app', $name, $app_id ); $rrd_def = RrdDefinition::make() ->addDataset('inside_cabinet_temperature', 'GAUGE', 0) ->addDataset('inside_cabinet_humidity', 'GAUGE', 0) ->addDataset('outside_cabinet_temperature', 'GAUGE', 0) ->addDataset('outside_cabinet_humidity', 'GAUGE', 0) ; 'inside_cabinet_temperature' => $inside_cabinet_temperature, 'inside_cabinet_humidity' => $inside_cabinet_humidity, 'outside_cabinet_temperature' => $outside_cabinet_temperature, 'outside_cabinet_humidity' => $outside_cabinet_humidity, ); 'name' => $name, 'app_id' => $app_id, 'rrd_def' => $rrd_def, 'rrd_name' => $rrd_name ); data_update($device, 'app', $tags, $fields); update_application($app, $cabinetclimate, $fields);