mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Add Basic Oxidized Node List (#6017)
* feature: Add Basic Oxidized Node List
This commit is contained in:
committed by
Neil Lathwood
parent
55384ad1b0
commit
db58fea2d2
@ -1436,3 +1436,39 @@ function set_image_type()
|
||||
return header('Content-type: image/png');
|
||||
}
|
||||
}
|
||||
|
||||
function get_oxidized_nodes_list()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$context = stream_context_create(array(
|
||||
'http' => array(
|
||||
'header' => "Accept: application/json",
|
||||
)
|
||||
));
|
||||
|
||||
$data = json_decode(file_get_contents($config['oxidized']['url'] . '/nodes?format=json', false, $context), true);
|
||||
|
||||
foreach ($data as $object) {
|
||||
$device = device_by_name($object['name']);
|
||||
$fa_color = $object['status'] == 'success' ? 'success' : 'danger';
|
||||
echo "
|
||||
<tr>
|
||||
<td>
|
||||
" . generate_device_link($device) . "
|
||||
</td>
|
||||
<td>
|
||||
<i class='fa fa-square text-" . $fa_color . "'></i>
|
||||
</td>
|
||||
<td>
|
||||
" . $object['time'] . "
|
||||
</td>
|
||||
<td>
|
||||
" . $object['model'] . "
|
||||
</td>
|
||||
<td>
|
||||
" . $object['group'] . "
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user