mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #4267 from HybridAU/master
newdevice: Added support for Lanier printers #4267
This commit is contained in:
@@ -123,6 +123,7 @@ LibreNMS contributors:
|
||||
- Bennett Blodinger <bennett.blodinger@gmail.com> (benwa)
|
||||
- Michael Hansen <nerdalertdk@gmail.com> (nerdalertdk)
|
||||
- Daniel Cox <danielcoxman@gmail.com> (ospfbgp)
|
||||
- Michael Van Delft <librenms@xo.tc> (HybridAU)
|
||||
|
||||
[1]: http://observium.org/ "Observium web site"
|
||||
Observium was written by:
|
||||
|
||||
BIN
html/images/os/lanier.png
Normal file
BIN
html/images/os/lanier.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 438 B |
@@ -1501,6 +1501,15 @@ $config['os'][$os]['icon'] = 'ricoh';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_toner';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Toner';
|
||||
|
||||
// lanier is a rebadged ricoh
|
||||
$os = 'lanier';
|
||||
$config['os'][$os]['group'] = 'printer';
|
||||
$config['os'][$os]['text'] = 'Lanier Printer';
|
||||
$config['os'][$os]['type'] = 'printer';
|
||||
$config['os'][$os]['icon'] = 'lanier';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_toner';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Toner';
|
||||
|
||||
$os = 'nrg';
|
||||
$config['os'][$os]['group'] = 'printer';
|
||||
$config['os'][$os]['text'] = 'NRG Printer';
|
||||
@@ -1534,13 +1543,6 @@ $config['os'][$os]['icon'] = 'hp';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_toner';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Toner';
|
||||
|
||||
$os = 'richoh';
|
||||
$config['os'][$os]['group'] = 'printer';
|
||||
$config['os'][$os]['text'] = 'Ricoh Printer';
|
||||
$config['os'][$os]['type'] = 'printer';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_toner';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Toner';
|
||||
|
||||
$os = 'okilan';
|
||||
$config['os'][$os]['group'] = 'printer';
|
||||
$config['os'][$os]['text'] = 'OKI Printer';
|
||||
|
||||
7
includes/discovery/os/lanier.inc.php
Normal file
7
includes/discovery/os/lanier.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (strstr($sysDescr, 'LANIER')) {
|
||||
$os = 'lanier';
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ if ($device['os_group'] == 'printer') {
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
if (is_numeric($role)) {
|
||||
//ricoh using private oids to expose toner levels
|
||||
if ($os == 'ricoh' || $os == 'nrg') {
|
||||
if ($os == 'ricoh' || $os == 'nrg' || $os == 'lanier') {
|
||||
$toner_oid = ".1.3.6.1.4.1.367.3.2.1.2.24.1.1.5.$index";
|
||||
$descr_oid = ".1.3.6.1.4.1.367.3.2.1.2.24.1.1.3.$index";
|
||||
} else {
|
||||
@@ -37,14 +37,14 @@ if ($device['os_group'] == 'printer') {
|
||||
$current = snmp_get($device, $toner_oid, '-Oqv');
|
||||
|
||||
//ricoh private mibs returns values as percent, no capacity is disclosed as it is not needed
|
||||
if ($os == 'ricoh') {
|
||||
if ($os == 'ricoh' || $os == 'lanier') {
|
||||
$capacity = 100;
|
||||
} else {
|
||||
$capacity = snmp_get($device, $capacity_oid, '-Oqv');
|
||||
}
|
||||
|
||||
//fix for ricoh devices returning garbage and devices returning percentage
|
||||
if ($os == 'ricoh' || $os == 'nrg') {
|
||||
if ($os == 'ricoh' || $os == 'nrg' || $os == 'lanier') {
|
||||
if ($current == '-3') {
|
||||
$current = 50;
|
||||
} elseif ($current == '-100') {
|
||||
|
||||
Reference in New Issue
Block a user