mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
netscaler sensors
git-svn-id: http://www.observium.org/svn/observer/trunk@2823 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
ALTER TABLE `bills` CHANGE `bill_cdr` `bill_cdr` BIGINT( 20 ) NULL DEFAULT NULL;
|
||||
CREATE TABLE IF NOT EXISTS `loadbalancer_rservers` ( `rserver_id` int(11) NOT NULL AUTO_INCREMENT, `farm_id` varchar(128) CHARACTER SET utf8 NOT NULL, `device_id` int(11) NOT NULL, `StateDescr` varchar(64) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`rserver_id`)) ENGINE=MyISAM AUTO_INCREMENT=514 DEFAULT CHARSET=utf8
|
||||
CREATE TABLE IF NOT EXISTS `loadbalancer_vservers` ( `classmap_id` int(11) NOT NULL, `classmap` varchar(128) NOT NULL, `serverstate` varchar(64) NOT NULL, `device_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
|
||||
ALTER TABLE `sensors` CHANGE `sensor_index` `sensor_index` VARCHAR( 64 );
|
||||
|
@@ -1,25 +1,24 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netscaler-stats-tcp.rrd";
|
||||
|
||||
$stats = array('CurServerConn', 'CurClientConn');
|
||||
$ds_in = "CurClientConn";
|
||||
$ds_out = "CurServerConn";
|
||||
|
||||
$i=0;
|
||||
foreach ($stats as $stat)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['ds'] = $stat;
|
||||
}
|
||||
$in_text = "Client";
|
||||
$out_text = "Server";
|
||||
|
||||
$colours='mixed';
|
||||
$colour_area_in = "88FF88";
|
||||
$colour_line_in = "008800";
|
||||
$colour_area_out = "FF8888";
|
||||
$colour_line_out = "880000";
|
||||
|
||||
$nototal = 1;
|
||||
$simple_rrd = 1;
|
||||
$colour_area_in_max = "cc88cc";
|
||||
$colour_area_out_max = "FFefaa";
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
$graph_max = 1;
|
||||
$unit_text = "Connections";
|
||||
|
||||
include("includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
?>
|
||||
|
40
includes/discovery/sensors-netscaler.inc.php
Normal file
40
includes/discovery/sensors-netscaler.inc.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
|
||||
echo(" NetScaler ");
|
||||
|
||||
echo(" Caching OIDs:");
|
||||
|
||||
if (!is_array($ns_sensor_array))
|
||||
{
|
||||
$ns_sensor_array = array();
|
||||
echo(" sysHealthCounterValue ");
|
||||
$ns_sensor_array = snmpwalk_cache_multi_oid($device, "sysHealthCounterValue", $ns_sensor_array, "NS-ROOT-MIB");
|
||||
}
|
||||
|
||||
foreach($ns_sensor_array as $descr => $data)
|
||||
{
|
||||
|
||||
$current = $data['sysHealthCounterValue'];
|
||||
|
||||
$oid = ".1.3.6.1.4.1.5951.4.1.1.41.7.1.2.".strlen($descr);
|
||||
for($i = 0; $i != strlen($descr); $i++)
|
||||
{
|
||||
$oid .= ".".ord($descr[$i]);
|
||||
}
|
||||
|
||||
if (strpos($descr, "Temp") !== FALSE) { $divisor = 0; $multiplier = 0; $type = "temperature"; }
|
||||
elseif (strpos($descr, "Fan") !== FALSE) { $divisor = 0; $multiplier = 0; $type = "fanspeed"; }
|
||||
elseif (strpos($descr, "Volt") !== FALSE) { $divisor = 1000; $multiplier = 0; $type = "voltage"; }
|
||||
elseif (strpos($descr, "Vtt") !== FALSE) { $divisor = 1000; $multiplier = 0; $type = "voltage"; }
|
||||
|
||||
if($divisor) { $current = $current / $divisor; };
|
||||
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $descr, 'netscaler-health', $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current);
|
||||
|
||||
}
|
||||
|
||||
|
||||
unset($ns_sensor_array);
|
||||
|
||||
?>
|
@@ -8,6 +8,8 @@ include("includes/discovery/cisco-entity-sensor.inc.php");
|
||||
include("includes/discovery/entity-sensor.inc.php");
|
||||
include("includes/discovery/ipmi.inc.php");
|
||||
|
||||
if($device['os'] == "netscaler"){ include("includes/discovery/sensors-netscaler.inc.php"); }
|
||||
|
||||
include("includes/discovery/temperatures.inc.php");
|
||||
include("includes/discovery/humidity.inc.php");
|
||||
include("includes/discovery/voltages.inc.php");
|
||||
|
@@ -194,6 +194,7 @@ function snmp_walk($device, $oid, $options = NULL, $mib = NULL, $mibdir = NULL)
|
||||
|
||||
if (!$debug) { $cmd .= " 2>/dev/null"; }
|
||||
$data = trim(external_exec($cmd));
|
||||
$data = str_replace("\"", "", $data);
|
||||
|
||||
if (is_string($data) && (preg_match("/No Such (Object|Instance)/i", $data)))
|
||||
{
|
||||
|
Reference in New Issue
Block a user