mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Update all applications to store metrics (#7853)
* Update all applications to store metrics * fix db schema * Add glue test
This commit is contained in:
committed by
Neil Lathwood
parent
0dd3ec25d3
commit
b620692426
@@ -10,12 +10,12 @@ $app_id = $app['app_id'];
|
||||
$options = '-O qv';
|
||||
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.9.115.104.111.117.116.99.97.115.116';
|
||||
$shoutcast = snmp_get($device, $oid, $options);
|
||||
update_application($app, $shoutcast);
|
||||
|
||||
echo ' shoutcast';
|
||||
|
||||
$servers = explode("\n", $shoutcast);
|
||||
|
||||
$metrics = array();
|
||||
foreach ($servers as $item => $server) {
|
||||
$server = trim($server);
|
||||
|
||||
@@ -44,8 +44,11 @@ foreach ($servers as $item => $server) {
|
||||
'max' => $data['7'],
|
||||
'unique' => $data['8'],
|
||||
);
|
||||
$metrics[$server] = $fields;
|
||||
|
||||
$tags = compact('name', 'app_id', 'host', 'port', 'rrd_name', 'rrd_def');
|
||||
data_update($device, 'app', $tags, $fields);
|
||||
}//end if
|
||||
}//end foreach
|
||||
|
||||
update_application($app, $shoutcast, $metrics);
|
||||
|
Reference in New Issue
Block a user