Commit version 24.12.13800
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
@ -7,26 +6,35 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
if (is_numeric($vars['id']))
|
||||
{
|
||||
//$sensor = dbFetchRow("SELECT * FROM `sensors` WHERE `sensor_id` = ?", array($vars['id']));
|
||||
$sensor = get_entity_by_id_cache('sensor', $vars['id']);
|
||||
if (!is_intnum($vars['id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_numeric($sensor['device_id']) && ($auth || is_entity_permitted($sensor['sensor_id'], 'sensor') || device_permitted($sensor['device_id'])))
|
||||
{
|
||||
$sensor = get_entity_by_id_cache('sensor', $vars['id']);
|
||||
|
||||
if (is_numeric($sensor['device_id']) && ($auth || is_entity_permitted($sensor['sensor_id'], 'sensor') || device_permitted($sensor['device_id']))) {
|
||||
|
||||
$device = device_by_id_cache($sensor['device_id']);
|
||||
|
||||
$rrd_filename = get_rrd_path($device, get_sensor_rrd($device, $sensor));
|
||||
|
||||
$title = generate_device_link($device);
|
||||
$title .= " :: Sensors :: ";
|
||||
$auth = TRUE;
|
||||
}
|
||||
$auth = TRUE;
|
||||
|
||||
$title_array = [];
|
||||
$title_array[] = [ 'text' => $device['hostname'],
|
||||
'url' => generate_url([ 'page' => 'device', 'device' => $device['device_id'] ]) ];
|
||||
$title_array[] = [ 'text' => 'Sensors ('.nicecase($sensor['sensor_class']).')',
|
||||
'url' => generate_url([ 'page' => 'device', 'device' => $device['device_id'], 'tab' => 'health', 'metric' => $sensor['sensor_class'] ]) ];
|
||||
$title_array[] = [ 'text' => escape_html($sensor['status_descr']),
|
||||
'url' => generate_url([ 'page' => 'device', 'device' => $device['device_id'], 'tab' => 'health', 'metric' => $sensor['sensor_class'], 'sensor_id' => $vars['id'] ]) ];
|
||||
|
||||
|
||||
$graph_title = device_name($device, TRUE);
|
||||
$graph_title .= " :: Sensor :: " . $sensor['sensor_descr'];
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user