mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add jetdirect support, fix automatic type assignment
git-svn-id: http://www.observium.org/svn/observer/trunk@1283 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -131,7 +131,7 @@ while ($device = mysql_fetch_array($device_query))
|
|||||||
include("includes/discovery/ucd-diskio.inc.php");
|
include("includes/discovery/ucd-diskio.inc.php");
|
||||||
include("includes/discovery/services.inc.php");
|
include("includes/discovery/services.inc.php");
|
||||||
|
|
||||||
if ($device['type'] == "unknown")
|
if ($device['type'] == "unknown" || $device['type'] == "")
|
||||||
{
|
{
|
||||||
if ($config['os'][$device['os']]['type'])
|
if ($config['os'][$device['os']]['type'])
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
html/images/os/jetdirect.png
Executable file
BIN
html/images/os/jetdirect.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -13,11 +13,11 @@ $valid_toner = array();
|
|||||||
|
|
||||||
echo("Toner : ");
|
echo("Toner : ");
|
||||||
|
|
||||||
if ($device['os'] == "dell-laser")
|
if ($device['os'] == "dell-laser" || $device['os'] == "jetdirect")
|
||||||
{
|
{
|
||||||
$oids = trim(snmp_walk($device, "SNMPv2-SMI::mib-2.43.12.1.1.2.1 ", "-OsqnU"));
|
$oids = trim(snmp_walk($device, "SNMPv2-SMI::mib-2.43.12.1.1.2.1 ", "-OsqnU"));
|
||||||
if ($debug) { echo($oids."\n"); }
|
if ($debug) { echo($oids."\n"); }
|
||||||
if ($oids) echo("Dell ");
|
if ($oids) echo("Jetdirect ");
|
||||||
foreach(explode("\n", $oids) as $data)
|
foreach(explode("\n", $oids) as $data)
|
||||||
{
|
{
|
||||||
$data = trim($data);
|
$data = trim($data);
|
||||||
@@ -35,7 +35,7 @@ if ($device['os'] == "dell-laser")
|
|||||||
$current = snmp_get($device, $toner_oid, "-Oqv");
|
$current = snmp_get($device, $toner_oid, "-Oqv");
|
||||||
$capacity = snmp_get($device, $capacity_oid, "-Oqv");
|
$capacity = snmp_get($device, $capacity_oid, "-Oqv");
|
||||||
$current = $current / $capacity * 100;
|
$current = $current / $capacity * 100;
|
||||||
$type = "dell-laser";
|
$type = "jetdirect";
|
||||||
echo discover_toner($valid_toner,$device, $toner_oid, $index, $type, $descr, $capacity, $current);
|
echo discover_toner($valid_toner,$device, $toner_oid, $index, $type, $descr, $capacity, $current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,13 @@ $config['os']['dell-laser']['overtext'] = "Toner";
|
|||||||
$config['os']['dell-laser']['ifname'] = 1;
|
$config['os']['dell-laser']['ifname'] = 1;
|
||||||
$config['os']['dell-laser']['type'] = "printer";
|
$config['os']['dell-laser']['type'] = "printer";
|
||||||
|
|
||||||
|
$config['os']['jetdirect']['group'] = "printer";
|
||||||
|
$config['os']['jetdirect']['text'] = "HP Printer";
|
||||||
|
$config['os']['jetdirect']['overgraph'][] = "device_toner";
|
||||||
|
$config['os']['jetdirect']['overtext'] = "Toner";
|
||||||
|
$config['os']['jetdirect']['ifname'] = 1;
|
||||||
|
$config['os']['jetdirect']['type'] = "printer";
|
||||||
|
|
||||||
$config['os']['3com']['text'] = "3Com";
|
$config['os']['3com']['text'] = "3Com";
|
||||||
$config['os']['3com']['overgraph'][] = "";
|
$config['os']['3com']['overgraph'][] = "";
|
||||||
$config['os']['3com']['overtext'] = "";
|
$config['os']['3com']['overtext'] = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user