Initial commit

master
Ariel Antigua 2018-08-23 11:24:29 -04:00
parent 9fe43380b6
commit 51eb012777
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<?php
use LibreNMS\RRD\RrdDefinition;
$name = 'ats-watts';
$app_id = $app['app_id'];
$options = '-O qv';
$oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.8.97.116.115.119.97.116.116.115.1';
$rrd_name = array('app', $name, $app_id);
$rrd_def = RrdDefinition::make()->addDataset('Watts', 'GAUGE', 0);
$atswatts = snmp_get($device, $oid, $options, $mib);
$fields = array('Watts' => $atswatts,);
$tags = array('name' => $name, 'app_id' => $app_id, 'rrd_def' => $rrd_def, 'rrd_name' => $rrd_name);
data_update($device, 'app', $tags, $fields);
update_application($app, $atswatts, $fields, $atswatts);