mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
change printer-supplies rrd name to include the supply_type (#12792)
* Update PrinterSupplies.php * Update toner.inc.php * Update auth.inc.php
This commit is contained in:
@@ -76,7 +76,7 @@ class PrinterSupplies implements Module
|
||||
|
||||
$tags = [
|
||||
'rrd_def' => RrdDefinition::make()->addDataset('toner', 'GAUGE', 0, 20000),
|
||||
'rrd_name' => ['toner', $toner['supply_index']],
|
||||
'rrd_name' => ['toner', $toner['supply_type'], $toner['supply_index']],
|
||||
'rrd_oldname' => ['toner', $toner['supply_descr']],
|
||||
'index' => $toner['supply_index'],
|
||||
];
|
||||
|
@@ -47,7 +47,7 @@ foreach (dbFetchRows('SELECT * FROM printer_supplies where device_id = ?', [$dev
|
||||
$hostname = gethostbyid($toner['device_id']);
|
||||
|
||||
$descr = \LibreNMS\Data\Store\Rrd::safeDescr(substr(str_pad($toner['supply_descr'], 16), 0, 16));
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['toner', $toner['supply_index']]);
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['toner', $toner['supply_type'], $toner['supply_index']]);
|
||||
$id = $toner['supply_id'];
|
||||
|
||||
$rrd_options .= " DEF:toner$id=$rrd_filename:toner:AVERAGE";
|
||||
|
@@ -5,7 +5,7 @@ if (is_numeric($vars['id'])) {
|
||||
|
||||
if (is_numeric($toner['device_id']) && ($auth || device_permitted($toner['device_id']))) {
|
||||
$device = device_by_id_cache($toner['device_id']);
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['toner', $toner['supply_index']]);
|
||||
$rrd_filename = Rrd::name($device['hostname'], ['toner', $toner['supply_type'], $toner['supply_index']]);
|
||||
|
||||
$title = generate_device_link($device);
|
||||
$title .= ' :: Toner :: ' . htmlentities($toner['supply_descr']);
|
||||
|
Reference in New Issue
Block a user