Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -5,50 +5,47 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*/
// FIXME - INSTANCES
if (!empty($agent_data['app']['shoutcast']))
{
$app_id = discover_app($device, 'shoutcast');
if (!empty($agent_data['app']['shoutcast'])) {
$app_id = discover_app($device, 'shoutcast');
// Polls shoutcast statistics from agent script
$servers = explode("\n", $agent_data['app']['shoutcast']);
$data = array();
// Polls shoutcast statistics from agent script
$servers = explode("\n", $agent_data['app']['shoutcast']);
$data = [];
foreach ($servers as $item => $server)
{
$server = trim($server);
foreach ($servers as $item => $server) {
$server = trim($server);
if (!empty($server))
{
$data = explode(";", $server);
list($host, $port) = explode(":", $data[0], 2);
if (!empty($server)) {
$data = explode(";", $server);
[$host, $port] = explode(":", $data[0], 2);
$stats[$data[0]] = array(
'bitrate' => $data[1],
'traf_in' => $data[2],
'traf_out' => $data[3],
'current' => $data[4],
'status' => $data[5],
'peak' => $data[6],
'max' => $data[7],
'unique' => $data[8],
);
$stats[$data[0]] = [
'bitrate' => $data[1],
'traf_in' => $data[2],
'traf_out' => $data[3],
'current' => $data[4],
'status' => $data[5],
'peak' => $data[6],
'max' => $data[7],
'unique' => $data[8],
];
rrdtool_update_ng($device, 'shoutcast', $stats[$data[0]], "$app_id-".$host."_".$port);
rrdtool_update_ng($device, 'shoutcast', $stats[$data[0]], "$app_id-" . $host . "_" . $port);
}
}
}
update_application($app_id, $stats);
update_application($app_id, $stats);
unset($app_id, $host, $port, $data, $servers, $server, $item);
unset($app_id, $host, $port, $data, $servers, $server, $item);
}
// EOF