mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updates
git-svn-id: http://www.observium.org/svn/observer/trunk@2230 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -46,7 +46,7 @@ while ($toner = mysql_fetch_assoc($sql))
|
||||
$hostname = gethostbyid($toner['device_id']);
|
||||
|
||||
$descr = substr(str_pad($toner['toner_descr'], 16),0,16);
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("toner-" . $toner['toner_descr'] . ".rrd");
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("toner-" . $toner['toner_index'] . ".rrd");
|
||||
$toner_id = $toner['toner_id'];
|
||||
|
||||
$rrd_options .= " DEF:toner$toner_id=$rrd_filename:toner:AVERAGE";
|
||||
@ -58,4 +58,4 @@ while ($toner = mysql_fetch_assoc($sql))
|
||||
$iter++;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -21,7 +21,9 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id'])
|
||||
|
||||
$select[$section] = "selected";
|
||||
|
||||
$device = device_by_id_cache($_GET['id']);
|
||||
$device = device_by_id_cache($_GET['id']);
|
||||
$attribs = get_dev_attribs($device['device_id']);
|
||||
|
||||
if ($config['os'][$device['os']]['group']) { $device['os_group'] = $config['os'][$device['os']]['group']; }
|
||||
|
||||
echo('<table style="margin: 0px 7px 7px 7px;" cellpadding="15" cellspacing="0" class="devicetable" width="99%">');
|
||||
|
@ -249,6 +249,18 @@ function set_dev_attrib($device, $attrib_type, $attrib_value)
|
||||
return mysql_affected_rows();
|
||||
}
|
||||
|
||||
function get_dev_attribs($device)
|
||||
{
|
||||
$attribs = array();
|
||||
$sql = "SELECT attrib_type, attrib_value FROM devices_attribs WHERE `device_id` = '" . mres($device['device_id']) . "'";
|
||||
$data = mysql_query($sql);
|
||||
while($entry = mysql_fetch_array($data))
|
||||
{
|
||||
$attribs[$entry['attrib_type']] = $attribs['attrib_value'];
|
||||
}
|
||||
return $attribs;
|
||||
}
|
||||
|
||||
function get_dev_attrib($device, $attrib_type)
|
||||
{
|
||||
$sql = "SELECT attrib_value FROM devices_attribs WHERE `device_id` = '" . mres($device['device_id']) . "' AND `attrib_type` = '$attrib_type'";
|
||||
|
@ -13,7 +13,13 @@ if ($config['enable_printers'])
|
||||
|
||||
$tonerperc = snmp_get($device, $toner['toner_oid'], "-OUqnv") / $toner['toner_capacity'] * 100;
|
||||
|
||||
$tonerrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("toner-" . $toner['toner_descr'] . ".rrd");
|
||||
$old_tonerrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("toner-" . $toner['toner_descr'] . ".rrd");
|
||||
$tonerrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("toner-" . $toner['toner_index'] . ".rrd");
|
||||
|
||||
if (!is_file($tonerrrd) && is_file($old_tonerrrd))
|
||||
{
|
||||
rename($old_tonerrrd, $tonerrrd);
|
||||
}
|
||||
|
||||
if (!is_file($tonerrrd))
|
||||
{
|
||||
@ -41,4 +47,4 @@ if ($config['enable_printers'])
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user