Merge pull request #2687 from fiveninedigital/canon-printer

Canon printer support
This commit is contained in:
Neil Lathwood
2016-01-04 12:28:35 +00:00
4 changed files with 29 additions and 1 deletions
+1
View File
@@ -77,4 +77,5 @@ Contributors to LibreNMS:
- Ruairi Carroll <ruairi.carroll@gmail.com> (rucarrol)
- Maxim Tsyplakov <maxim.tsyplakov@gmail.com> (tsypa)
- D. Britz <github@wrind.de> (flatterlight)
- Tobias Herrmann <tobias@fiveninedigital.ch> (Mightea)
[1]: http://observium.org/ "Observium web site"
+8 -1
View File
@@ -1157,7 +1157,14 @@ $config['os'][$os]['text'] = 'Samsung Printer';
$config['os'][$os]['type'] = 'printer';
$config['os'][$os]['over'][0]['graph'] = 'device_toner';
$config['os'][$os]['over'][0]['text'] = 'Toner';
$os ='canonprinter';
$config['os'][$os]['group'] = 'printer';
$config['os'][$os]['text'] = 'Canon Printer';
$config['os'][$os]['type'] = 'printer';
$config['os'][$os]['over'][0]['graph'] = 'device_toner';
$config['os'][$os]['over'][0]['text'] = 'Toner';
$os = '3com';
$config['os'][$os]['text'] = '3Com';
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
@@ -0,0 +1,7 @@
<?php
if (!$os) {
// Canon Multifunction Printer/Scanner
if (strstr($sysDescr, 'Canon MF')) {
$os = 'canonprinter';
}
}
+13
View File
@@ -0,0 +1,13 @@
<?php
// SNMPv2-SMI::enterprises.1602.1.1.1.1.0 = STRING: "MF8500C Series"
$hardware = trim(snmp_get($device, 'SNMPv2-SMI::enterprises.1602.1.1.1.1.0', '-OQv', '', ''), '" ');
// SNMPv2-SMI::mib-2.43.5.1.1.17.1 = STRING: "QJY44712"
$serial = trim(snmp_get($device, 'SNMPv2-SMI::mib-2.43.5.1.1.17.1', '-OQv', '', ''), '" ');
// SNMPv2-SMI::enterprises.1602.1.1.1.4.0 = STRING: "03.03"
$version = trim(snmp_get($device, 'SNMPv2-SMI::enterprises.1602.1.1.1.4.0', '-OQv', '', ''), '" ');
// Strip off useless brand fields
$hardware = str_ireplace(' Series', '', $hardware);