mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
move current to sensors table, plug some sql injection holes
git-svn-id: http://www.observium.org/svn/observer/trunk@1312 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -6,7 +6,7 @@ $device = device_by_id_cache($id);
|
||||
$rrd_options .= " -l 0 -E ";
|
||||
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM current where device_id = '$id'");
|
||||
$sql = mysql_query("SELECT * FROM sensors WHERE sensor_class='current' AND device_id = '$id'");
|
||||
$rrd_options .= " COMMENT:' Cur Min Max\\n'";
|
||||
while($current = mysql_fetch_array($sql))
|
||||
{
|
||||
@@ -39,9 +39,9 @@ while($current = mysql_fetch_array($sql))
|
||||
|
||||
$hostname = gethostbyid($current['device_id']);
|
||||
|
||||
$descr = substr(str_pad($current['current_descr'], 15),0,15);
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("current-" . $current['current_descr'] . ".rrd");
|
||||
$current_id = $current['current_id'];
|
||||
$descr = substr(str_pad($current['sensor_descr'], 15),0,15);
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("current-" . $current['sensor_descr'] . ".rrd");
|
||||
$current_id = $current['sensor_id'];
|
||||
|
||||
$rrd_options .= " DEF:current$current_id=$rrd_filename:current:AVERAGE";
|
||||
$rrd_options .= " LINE1:current$current_id#".$colour.":'" . $descr . "'";
|
||||
|
||||
Reference in New Issue
Block a user