ATS-Watts/includes/polling/applications/ats-watts.inc.php

18 lines
588 B
PHP
Raw Permalink Normal View History

2018-08-23 11:24:29 -04:00
<?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);