mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
improve hp procurve version detection
git-svn-id: http://www.observium.org/svn/observer/trunk@3034 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,44 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (is_file($config['install_dir'] . "/includes/polling/os/".$device['os'].".inc.php"))
|
||||
{
|
||||
## OS Specific
|
||||
include($config['install_dir'] . "/includes/polling/os/".$device['os'].".inc.php");
|
||||
}
|
||||
elseif ($device['os_group'] && is_file($config['install_dir'] . "/includes/polling/os/".$device['os_group'].".inc.php"))
|
||||
{
|
||||
## OS Group Specific
|
||||
include($config['install_dir'] . "/includes/polling/os/".$device['os_group'].".inc.php");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("Generic :(\n");
|
||||
}
|
||||
if (is_file($config['install_dir'] . "/includes/polling/os/".$device['os'].".inc.php"))
|
||||
{
|
||||
## OS Specific
|
||||
include($config['install_dir'] . "/includes/polling/os/".$device['os'].".inc.php");
|
||||
}
|
||||
elseif ($device['os_group'] && is_file($config['install_dir'] . "/includes/polling/os/".$device['os_group'].".inc.php"))
|
||||
{
|
||||
## OS Group Specific
|
||||
include($config['install_dir'] . "/includes/polling/os/".$device['os_group'].".inc.php");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("Generic :(\n");
|
||||
}
|
||||
|
||||
if ($version && $device['version'] != $version)
|
||||
{
|
||||
$update_array['version'] = $version;
|
||||
log_event("OS Version -> ".$version, $device, 'system');
|
||||
}
|
||||
if ($version && $device['version'] != $version)
|
||||
{
|
||||
$update_array['version'] = $version;
|
||||
log_event("OS Version -> ".$version, $device, 'system');
|
||||
}
|
||||
|
||||
if ($features != $device['features'])
|
||||
{
|
||||
$update_array['features'] = $features;
|
||||
log_event("OS Features -> ".$features, $device, 'system');
|
||||
}
|
||||
if ($features != $device['features'])
|
||||
{
|
||||
$update_array['features'] = $features;
|
||||
log_event("OS Features -> ".$features, $device, 'system');
|
||||
}
|
||||
|
||||
if ($hardware && $hardware != $device['hardware'])
|
||||
{
|
||||
$update_array['hardware'] = $hardware;
|
||||
log_event("Hardware -> ".$hardware, $device, 'system');
|
||||
}
|
||||
if ($hardware && $hardware != $device['hardware'])
|
||||
{
|
||||
$update_array['hardware'] = $hardware;
|
||||
log_event("Hardware -> ".$hardware, $device, 'system');
|
||||
}
|
||||
|
||||
if ($serial && $serial != $device['serial'])
|
||||
{
|
||||
$update_array['serial'] = $serial;
|
||||
log_event("serial -> ".$serial, $device, 'system');
|
||||
}
|
||||
if ($serial && $serial != $device['serial'])
|
||||
{
|
||||
$update_array['serial'] = $serial;
|
||||
log_event("Serial -> ".$serial, $device, 'system');
|
||||
}
|
||||
|
||||
echo("Hardware: ".$hardware." Version: ".$version." Features: ".$features."\n");
|
||||
echo("\nHardware: ".$hardware." Version: ".$version." Features: ".$features." Serial: ".$serial."\n");
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
<?php
|
||||
|
||||
list($hardware, $version, $features) = explode(",", str_replace(", ", ",", $poll_device['sysDescr']));
|
||||
list($features) = explode("(", $version);
|
||||
list($hardware, $version, ) = explode(",", str_replace(", ", ",", $poll_device['sysDescr']));
|
||||
|
||||
# Clean up hardware
|
||||
$hardware = str_replace("PROCURVE","ProCurve",$hardware);
|
||||
if (substr($hardware,0,3) == "HP ") { $hardware = substr($hardware,3); }
|
||||
if (substr($hardware,0,24) == "Hewlett-Packard Company ") { $hardware = substr($hardware,24); }
|
||||
|
||||
$altversion = trim(snmp_get($device,"hpSwitchOsVersion.0", "-Oqv", "NETSWITCH-MIB"),'"');
|
||||
if ($altversion) { $version = $altversion; }
|
||||
|
||||
$altversion = trim(snmp_get($device,".1.3.6.1.4.1.11.2.3.7.11.12.1.2.1.11.0", "-Oqv"),'"');
|
||||
if ($altversion) { $version = $altversion; }
|
||||
|
||||
$serial = snmp_get($device, ".1.3.6.1.4.1.11.2.36.1.1.2.9.0", "-Oqv", "SEMI-MIB");
|
||||
$serial = trim(str_replace("\"", "", $serial));
|
||||
|
||||
Reference in New Issue
Block a user