mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Basic Zebra Print Server detection (#6162)
This commit is contained in:
committed by
Neil Lathwood
parent
8ca1f169b3
commit
a3c26d07f7
1
html/images/logos/zebra.svg
Normal file
1
html/images/logos/zebra.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 439.08664 140.8797"><path d="M411.028 77.244l-7.638-23.627-7.638 23.545zM368.37 105.33l23.966-71.986h22.646l24.105 71.987h-19.38l-4.736-13.986-23.373-.056-4.678 14.043zM345.546 65.1c4.335-3.41 5.604-12.164-2.732-16.845-1.47-1.047-5.505-1.226-11.415-1.18v20.175c7.37.23 9.882 1.204 14.146-2.15zM314.2 33.344h23.177c10.525-.052 18.042 1.656 23.24 6.855 11.738 14.568 5.958 33.186-8.043 38.848l15.796 26.283h-20.816L331.4 77.274v28.058h-17.2zm-27.262 45.1c-4.69-3.524-6.202-2.87-14.91-2.87V93.28s10.547.49 14.04-1.762c3.963-2.552 4.84-10.09.87-13.073zm-1.442-17.477c3.062-2.182 3.506-8.298 1.76-10.725-3.784-5.256-9.033-3.808-15.23-3.808v16.9c4.367-.125 9.632.37 13.47-2.367zm-30.57-27.623h26.572c8.775 0 11.46 1.086 15.02 2.836 6.143 3.02 9.075 8.257 9.113 16.22.018 3.456-1.193 7.407-2.105 9.17-1.33 3.253-7.634 7.94-10.005 8.534 2.71.383 6.853 1.397 9.027 4.074 3.927 4.835 4.164 5.273 4.058 12.44-.11 7.453-3.1 13.544-8.27 16.18-3.558 1.816-5.69 2.26-9.95 2.254l-33.46-.048zm-50.86 0h41.744v13.98h-23.934v14.763h23.934V76.25h-23.934v15.375h23.934v13.706h-41.744zm-63.27 71.987l30.217-57.998-26.856.053 7.455-14.04h46.077l-29.813 57.624 26.658.603-6.952 13.758zM54.25 0l-.072 32.49c8.942.02 16.207-7.237 16.227-16.208C70.425 7.31 63.193.02 54.25 0zM26.733 5.247c-2.977 1.58-5.392 3.088-8 5.184l25.823 26.122-.128 56.938 19.298 19.385.005-.005V98.965l-9.842-9.832.107-47.13h23.968l-9.812-9.842-14.53.342zM11.19 17.854C9.1 20.396 7.27 23.124 5.718 26l18.34 18.32.052 14.934L1.462 36.627C.756 39.245.267 41.912 0 44.603v4.48l34 34.375-.142-42.956h-.004l.004-.003zm52.943 24.85l-.108 47.73 9.986.024.086-37.736zm10.53 10.17c3.033 3.33 6.583 6.602 9.807 9.843h14.082l-9.793-9.843zm9.85 10.322l-.06 27.505 9.986.024.04-17.51zM0 63.3v13.913l63.73 63.667v-13.912zm104.757 15.038l-.028 12.41-9.964-.022c-.01.15-.02.302-.025.454-.018 8.942 7.215 16.207 16.157 16.227 7.255.015 13.635-4.798 15.613-11.778l-.025-4.958-12.238-12.276z"/></svg>
|
After Width: | Height: | Size: 1.9 KiB |
1
html/images/os/zebra.svg
Normal file
1
html/images/os/zebra.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160.00586 178.18082"><path d="M68.615 0l-.092 41.092c11.31.025 20.498-9.152 20.524-20.5C89.073 9.247 79.925.027 68.615 0zM33.81 6.637c-3.765 1.996-6.82 3.905-10.12 6.556L56.353 46.23l-.162 72.014 24.408 24.517.006-.005V125.17l-12.448-12.437.135-59.607h30.315l-12.41-12.45-18.38.432zM14.152 22.58c-2.64 3.216-4.96 6.666-6.92 10.304l23.196 23.172.066 18.887L1.85 46.325C.956 49.635.337 53.01 0 56.413v5.664l43.002 43.48-.18-54.33h-.004l.004-.005zm66.96 31.43l-.135 60.37 12.63.03.108-47.73zM94.43 66.875c3.838 4.213 8.327 8.35 12.405 12.45h17.81l-12.384-12.45zm12.46 13.055l-.077 34.786 12.63.03.05-22.147zM0 80.06v17.597l80.604 80.524v-17.595zm132.494 19.02l-.035 15.695-12.603-.028c-.013.192-.023.383-.03.574-.026 11.31 9.123 20.5 20.433 20.525 9.176.02 17.245-6.068 19.746-14.897l-.03-6.27-15.48-15.524z"/></svg>
|
After Width: | Height: | Size: 867 B |
10
includes/definitions/zebra.yaml
Normal file
10
includes/definitions/zebra.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
os: zebra
|
||||
text: 'ZebraNet'
|
||||
type: printer
|
||||
icon: zebra
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.683.
|
||||
- .1.3.6.1.4.1.10642.
|
45
includes/polling/os/zebra.inc.php
Normal file
45
includes/polling/os/zebra.inc.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* zebra.inc.php
|
||||
*
|
||||
* Detect print server information
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
// ESI-MIB::genProductNumber.0 .1.3.6.1.4.1.683.1.4.0
|
||||
// ESI-MIB::genSerialNumber.0 .1.3.6.1.4.1.683.1.5.0
|
||||
// ESI-MIB::genVersion.0 .1.3.6.1.4.1.683.1.9.0
|
||||
if (starts_with($poll_device['sysObjectID'], 'enterprises.683')) {
|
||||
$oids = array(
|
||||
'hardware' => '.1.3.6.1.4.1.683.1.4.0',
|
||||
'serial' => '.1.3.6.1.4.1.683.1.5.0',
|
||||
'version' => '.1.3.6.1.4.1.683.1.9.0',
|
||||
);
|
||||
$os_data = snmp_get_multi_oid($device, $oids);
|
||||
foreach ($oids as $var => $oid) {
|
||||
$$var = trim($os_data[$oid], '"');
|
||||
}
|
||||
}
|
||||
|
||||
if (str_contains($poll_device['sysDescr'], 'Wireless')) {
|
||||
$features = 'wireless';
|
||||
} else {
|
||||
$features = 'wired';
|
||||
}
|
@@ -1757,6 +1757,12 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('xos');
|
||||
}
|
||||
|
||||
public function testZebra()
|
||||
{
|
||||
$this->checkOS('zebra');
|
||||
$this->checkOS('zebra', 'zebra1');
|
||||
}
|
||||
|
||||
public function testZxr10()
|
||||
{
|
||||
$this->checkOS('zxr10');
|
||||
|
2
tests/snmpsim/zebra.snmprec
Normal file
2
tests/snmpsim/zebra.snmprec
Normal file
@@ -0,0 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|ZebraNet Wired PS
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.683.6.0
|
2
tests/snmpsim/zebra1.snmprec
Normal file
2
tests/snmpsim/zebra1.snmprec
Normal file
@@ -0,0 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|Zebra Wired
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.10642.1.1
|
Reference in New Issue
Block a user