mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 08:02:23 +02:00
fix discovery to remove include_dir function. ignore -32768 values returned for sensors. build rrd graphs via pipe.
git-svn-id: http://www.observium.org/svn/observer/trunk@2493 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -221,17 +221,21 @@ $config['ignore_mount_removable'] = 1; # Ignore removable disk storage
|
||||
$config['ignore_mount_network'] = 1; # Ignore network mounted storage
|
||||
$config['ignore_mount_optical'] = 1; # Ignore mounted optical discs
|
||||
|
||||
### Per-device interface graph filters
|
||||
|
||||
$config['device_traffic_iftype'][] = '/loopback/';
|
||||
$config['device_traffic_iftype'][] = '/tunnel/';
|
||||
$config['device_traffic_iftype'][] = '/virtual/';
|
||||
$config['device_traffic_iftype'][] = '/mpls/';
|
||||
$config['device_traffic_iftype'][] = '/ieee8023adLag/';
|
||||
$config['device_traffic_iftype'][] = '/l2vlan/';
|
||||
|
||||
$config['device_traffic_descr'][] = '/loopback/';
|
||||
$config['device_traffic_descr'][] = '/vlan/';
|
||||
$config['device_traffic_descr'][] = '/tunnel/';
|
||||
$config['device_traffic_descr'][] = '/:\d+/';
|
||||
$config['device_traffic_descr'][] = '/bond/';
|
||||
|
||||
### IRC Bot configuration
|
||||
|
||||
$config['irc_host'] = "chat.eu.freenode.net";
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<?php
|
||||
echo("Current: ");
|
||||
|
||||
include_dir("includes/discovery/current");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/current";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
|
||||
if ($debug) { print_r($valid['sensor']['current']); }
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
## APC
|
||||
if ($device['os'] == "apc")
|
||||
{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
// blindly copied from sentry3
|
||||
|
||||
if ($device['os'] == 'raritan')
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<?php
|
||||
|
||||
echo("Fanspeeds : ");
|
||||
include_dir("includes/discovery/fanspeeds");
|
||||
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/fanspeeds";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
if ($debug) { print_r($valid['sensor']['fanspeed']); }
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
echo("Frequencies: ");
|
||||
|
||||
include_dir("includes/discovery/frequencies");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/frequencies";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
if ($debug) { print_r($valid['sensor']['frequency']); }
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
echo("Humidity : ");
|
||||
|
||||
include_dir("includes/discovery/humidity");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/humidity";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
if ($debug) { print_r($valid['sensor']['humidity']); }
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
echo("Memory : ");
|
||||
|
||||
global $valid_mempool; ## FIXME PLEASE!
|
||||
### Include all discovery modules
|
||||
|
||||
include_dir("includes/discovery/mempools");
|
||||
$include_dir = "includes/discovery/mempools";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
### Remove memory pools which weren't redetected here
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
if ($device['os'] == "aos")
|
||||
{
|
||||
echo("Alcatel-Lucent OS: ");
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
if ($device['os'] == "ios" || $device['os_group'] == "ios")
|
||||
{
|
||||
echo("CISCO-ENHANCED-MEMORY-POOL: ");
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
## Ignore this discovery module if we have already discovered things in CISCO-ENHANCED-MEMPOOL-MIB. Dirty duplication.
|
||||
|
||||
$cemp_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `mempools` WHERE `device_id` = '".$device['device_id']."' AND `mempool_type` = 'cemp'"),0);
|
||||
@@ -21,4 +19,4 @@ if (($device['os'] == "ios" || $device['os_group'] == "ios") && $cemp_count == "
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
#NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1
|
||||
#NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966
|
||||
#NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166
|
||||
@@ -41,4 +39,4 @@ if (is_array($array))
|
||||
unset($array);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
$storage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES:NetWare-Host-Ext-MIB");
|
||||
|
||||
if (is_array($storage_array))
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
if ($device['os'] == "ironware" || $device['os_type'] == "ironware")
|
||||
{
|
||||
echo("Ironware Dynamic: ");
|
||||
@@ -13,4 +11,4 @@ if ($device['os'] == "ironware" || $device['os_type'] == "ironware")
|
||||
discover_mempool($valid_mempool, $device, 0, "ironware-dyn", "Dynamic Memory", "1", NULL, NULL);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
## JUNOS mempools
|
||||
if ($device['os'] == "junos")
|
||||
{
|
||||
@@ -32,4 +30,4 @@ if ($device['os'] == "junos")
|
||||
|
||||
unset ($mempools_array);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
if ($device['os'] == "screenos")
|
||||
{
|
||||
echo("ScreenOS: ");
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
echo("Power: ");
|
||||
|
||||
include_dir("includes/discovery/power");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/power";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
if ($debug) { print_r($valid['sensor']['power']); }
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
echo("Processors : ");
|
||||
|
||||
include_dir("includes/discovery/processors");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/processors";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
## Last-resort discovery here
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
echo("Storage : ");
|
||||
|
||||
global $valid_storage;
|
||||
|
||||
include_dir("includes/discovery/storage");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/storage";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
### Remove storage which weren't redetected here
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
$hrstorage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES:NetWare-Host-Ext-MIB");
|
||||
|
||||
global $valid_storage;
|
||||
|
||||
if (is_array($hrstorage_array))
|
||||
{
|
||||
echo("hrStorage : ");
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
echo("Temperatures: ");
|
||||
|
||||
include_dir("includes/discovery/temperatures");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/temperatures";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
if ($debug) { print_r($valid['sensor']['temperature']); }
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
echo("Voltages: ");
|
||||
|
||||
include_dir("includes/discovery/voltages");
|
||||
### Include all discovery modules
|
||||
|
||||
$include_dir = "includes/discovery/voltages";
|
||||
include("includes/include-dir.inc.php");
|
||||
|
||||
if ($debug) { print_r($valid['sensor']['voltage']); }
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ function poll_sensor($device, $class, $unit)
|
||||
$sensor_value = snmp_get($device, $sensor['sensor_oid'], "-OUqnv", "SNMPv2-MIB");
|
||||
}
|
||||
|
||||
if($sensor_value == -32768) { echo("Invalid (-32768) "); $sensor_value = 0; }
|
||||
|
||||
if ($sensor['sensor_divisor']) { $sensor_value = $sensor_value / $sensor['sensor_divisor']; }
|
||||
if ($sensor['sensor_multiplier']) { $sensor_value = $sensor_value * $sensor['sensor_multiplier']; }
|
||||
|
||||
|
||||
@@ -766,6 +766,7 @@ $rewrite_ios_features = array(
|
||||
|
||||
$rewrite_shortif = array (
|
||||
'tengigabitethernet' => 'Te',
|
||||
'tengige' => 'Te',
|
||||
'gigabitethernet' => 'Gi',
|
||||
'fastethernet' => 'Fa',
|
||||
'ethernet' => 'Et',
|
||||
@@ -779,6 +780,7 @@ $rewrite_ios_features = array(
|
||||
'vlan' => 'Vlan',
|
||||
'tunnel' => 'Tunnel',
|
||||
'serviceinstance' => 'SI',
|
||||
'dwdm' => 'DWDM',
|
||||
);
|
||||
|
||||
$rewrite_iftype = array (
|
||||
@@ -841,7 +843,7 @@ function makeshortif($if)
|
||||
$if = fixifName ($if);
|
||||
$if = strtolower($if);
|
||||
$if = array_str_replace($rewrite_shortif, $if);
|
||||
|
||||
$if = ucfirst($if);
|
||||
return $if;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ function rrdtool_fetch($rrdfile, $rrdupdate)
|
||||
return rrdtool("fetch", $rrdfile, $rrdupdate);
|
||||
}
|
||||
|
||||
function rrdtool_graph($rrdfile, $rrdupdate)
|
||||
{
|
||||
return rrdtool("graph", $rrdfile, $rrdupdate);
|
||||
}
|
||||
#function rrdtool_graph($rrdfile, $rrdupdate)
|
||||
#{
|
||||
# return rrdtool("graph", $rrdfile, $rrdupdate);
|
||||
#}
|
||||
|
||||
function rrdtool_last($rrdfile, $rrdupdate)
|
||||
{
|
||||
@@ -51,4 +51,4 @@ function rrdtool($command, $file, $options)
|
||||
return shell_exec($command);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user