mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updated netscaler mib. netscaler vserver poller. netscaler vserver subtab in routing.
git-svn-id: http://www.observium.org/svn/observer/trunk@2826 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
20
html/includes/graphs/netscalervsvr/auth.inc.php
Normal file
20
html/includes/graphs/netscalervsvr/auth.inc.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (is_numeric($id))
|
||||
{
|
||||
|
||||
$vsvr = dbFetchRow("SELECT * FROM `netscaler_vservers` AS I, `devices` AS D WHERE I.vsvr_id = ? AND I.device_id = D.device_id", array($id));
|
||||
|
||||
if (is_numeric($vsvr['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($vsvr['device_id'])))
|
||||
{
|
||||
$device = device_by_id_cache($vsvr['device_id']);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("netscaler-vsvr-".$vsvr['vsvr_name'].".rrd");
|
||||
|
||||
$title = generate_device_link($device);
|
||||
$title .= " :: Netscaler VServer :: " . htmlentities($vsvr['vsvr_name']);
|
||||
$auth = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
8
html/includes/graphs/netscalervsvr/bits.inc.php
Normal file
8
html/includes/graphs/netscalervsvr/bits.inc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$ds_in = "TotalRequestBytes";
|
||||
$ds_out = "TotalResponseBytes";
|
||||
|
||||
include("includes/graphs/generic_bits.inc.php");
|
||||
|
||||
?>
|
||||
19
html/includes/graphs/netscalervsvr/conns.inc.php
Normal file
19
html/includes/graphs/netscalervsvr/conns.inc.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$ds_in = "CurClntConnections";
|
||||
$ds_out = "CurSrvrConnections";
|
||||
|
||||
$colour_area_in = "AA66AA";
|
||||
$colour_line_in = "330033";
|
||||
$colour_area_out = "FFDD88";
|
||||
$colour_line_out = "FF6600";
|
||||
|
||||
$colour_area_in_max = "cc88cc";
|
||||
$colour_area_out_max = "FFefaa";
|
||||
|
||||
$graph_max = 1;
|
||||
$unit_text = "Packets";
|
||||
|
||||
include("includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
?>
|
||||
19
html/includes/graphs/netscalervsvr/pkts.inc.php
Normal file
19
html/includes/graphs/netscalervsvr/pkts.inc.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$ds_in = "TotalPktsRecvd";
|
||||
$ds_out = "TotalPktsSent";
|
||||
|
||||
$colour_area_in = "AA66AA";
|
||||
$colour_line_in = "330033";
|
||||
$colour_area_out = "FFDD88";
|
||||
$colour_line_out = "FF6600";
|
||||
|
||||
$colour_area_in_max = "cc88cc";
|
||||
$colour_area_out_max = "FFefaa";
|
||||
|
||||
$graph_max = 1;
|
||||
$unit_text = "Packets";
|
||||
|
||||
include("includes/graphs/generic_duplex.inc.php");
|
||||
|
||||
?>
|
||||
@@ -155,8 +155,17 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
|
||||
### $routing_tabs is used in device/routing/ to build the tabs menu. we built it here to save some queries
|
||||
|
||||
$device_routing_count['loadbalancer_vservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_routing_count['loadbalancer_vservers']) { $routing_tabs[] = 'loadbalancer_vservers'; }
|
||||
if($device['os'] == "netscaler") /// Netscaler
|
||||
{
|
||||
$device_routing_count['netscaler_vsvr'] = dbFetchCell("SELECT COUNT(*) FROM `netscaler_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_routing_count['netscaler_vsvr']) { $routing_tabs[] = 'netscaler_vsvr'; }
|
||||
}
|
||||
|
||||
if($device['os'] == "acsw") /// Cisco ACE
|
||||
{
|
||||
$device_routing_count['loadbalancer_vservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_routing_count['loadbalancer_vservers']) { $routing_tabs[] = 'loadbalancer_vservers'; }
|
||||
}
|
||||
|
||||
$device_routing_count['loadbalancer_rservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_rservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_routing_count['loadbalancer_rservers']) { $routing_tabs[] = 'loadbalancer_rservers'; }
|
||||
|
||||
@@ -6,8 +6,14 @@ $link_array = array('page' => 'device',
|
||||
|
||||
#$type_text['overview'] = "Overview";
|
||||
$type_text['ipsec_tunnels'] = "IPSEC Tunnels";
|
||||
|
||||
## Cisco ACE
|
||||
$type_text['loadbalancer_rservers'] = "Rservers";
|
||||
$type_text['loadbalancer_vservers'] = "Serverfarms";
|
||||
|
||||
## Citrix Netscaler
|
||||
$type_text['netscaler_vsvr'] = "VServers";
|
||||
|
||||
$type_text['bgp'] = "BGP";
|
||||
$type_text['cef'] = "CEF";
|
||||
$type_text['ospf'] = "OSPF";
|
||||
|
||||
82
html/pages/device/routing/netscaler_vsvr.inc.php
Normal file
82
html/pages/device/routing/netscaler_vsvr.inc.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<span style='font-weight: bold;'>Serverfarms</span> » ");
|
||||
|
||||
#$auth = TRUE;
|
||||
|
||||
$menu_options = array('basic' => 'Basic',
|
||||
);
|
||||
|
||||
if (!$vars['view']) { $vars['view'] = "basic"; }
|
||||
|
||||
$sep = "";
|
||||
foreach ($menu_options as $option => $text)
|
||||
{
|
||||
if ($vars['view'] == $option) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="'.generate_url($vars, array('view' => 'basic', 'graph' => NULL)).'">'.$text.'</a>');
|
||||
if ($vars['view'] == $option) { echo("</span>"); }
|
||||
echo(" | ");
|
||||
}
|
||||
|
||||
unset($sep);
|
||||
echo(' Graphs: ');
|
||||
$graph_types = array("bits" => "Bits",
|
||||
"pkts" => "Packets",
|
||||
"conns" => "Connections");
|
||||
|
||||
|
||||
foreach ($graph_types as $type => $descr)
|
||||
{
|
||||
echo("$type_sep");
|
||||
if ($vars['graph'] == $type) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo('<a href="'.generate_url($vars, array('view' => 'graphs', 'graph' => $type)).'">'.$descr.'</a>');
|
||||
if ($vars['graph'] == $type) { echo("</span>"); }
|
||||
$type_sep = " | ";
|
||||
}
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
$i = "0";
|
||||
foreach (dbFetchRows("SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? ORDER BY `vsvr_name`", array($device['device_id'])) as $vsvr)
|
||||
{
|
||||
if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
||||
|
||||
if($vsvr['vsvr_state'] == "up") { $vsvr_class="green"; } else { $vsvr_class="red"; }
|
||||
|
||||
echo("<tr bgcolor='$bg_colour'>");
|
||||
echo("<td width=320 class=list-large>" . $vsvr['vsvr_name'] . "</a></td>");
|
||||
echo("<td width=320 class=list-small>" . $vsvr['vsvr_ip'] . ":" . $vsvr['vsvr_port'] . "</a></td>");
|
||||
echo("<td width=100 class=list-small><span class='".$vsvr_class."'>" . $vsvr['vsvr_state'] . "</span></td>");
|
||||
echo("<td width=320 class=list-small>" . format_si($vsvr['vsvr_bps_in']*8) . "bps</a></td>");
|
||||
echo("<td width=320 class=list-small>" . format_si($vsvr['vsvr_bps_out']*8) . "bps</a></td>");
|
||||
echo("</tr>");
|
||||
if ($vars['view'] == "graphs")
|
||||
{
|
||||
echo('<tr class="list-bold" bgcolor="'.$bg_colour.'">');
|
||||
echo('<td colspan="5">');
|
||||
$graph_type = "netscalervsvr_" . $vars['graph'];
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "213";
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['id'] = $vsvr['vsvr_id'];
|
||||
$graph_array['type'] = $graph_type;
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("
|
||||
</td>
|
||||
</tr>");
|
||||
}
|
||||
|
||||
echo("</td>");
|
||||
echo("</tr>");
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo("</table></div>");
|
||||
|
||||
?>
|
||||
@@ -364,6 +364,7 @@ $config['poller_modules']['cisco-mac-accounting'] = 1;
|
||||
$config['poller_modules']['cipsec-tunnels'] = 1;
|
||||
$config['poller_modules']['cisco-ace-loadbalancer'] = 1;
|
||||
$config['poller_modules']['cisco-ace-serverfarms'] = 1;
|
||||
$config['poller_modules']['netscaler-vsvr'] = 1;
|
||||
|
||||
## List of discovery modules. Need to be in this array to be
|
||||
## considered for execution.
|
||||
|
||||
115
includes/polling/netscaler-vsvr.inc.php
Normal file
115
includes/polling/netscaler-vsvr.inc.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
# NS-ROOT-MIB::vsvrName."observium" = STRING: "observium"
|
||||
# NS-ROOT-MIB::vsvrIpAddress."observium" = IpAddress: 195.78.84.141
|
||||
# NS-ROOT-MIB::vsvrPort."observium" = INTEGER: 80
|
||||
# NS-ROOT-MIB::vsvrType."observium" = INTEGER: http(0)
|
||||
# NS-ROOT-MIB::vsvrState."observium" = INTEGER: up(7)
|
||||
# NS-ROOT-MIB::vsvrCurClntConnections."observium" = Gauge32: 18
|
||||
# NS-ROOT-MIB::vsvrCurSrvrConnections."observium" = Gauge32: 0
|
||||
# NS-ROOT-MIB::vsvrSurgeCount."observium" = Counter32: 0
|
||||
# NS-ROOT-MIB::vsvrTotalRequests."observium" = Counter64: 64532
|
||||
# NS-ROOT-MIB::vsvrTotalRequestBytes."observium" = Counter64: 22223153
|
||||
# NS-ROOT-MIB::vsvrTotalResponses."observium" = Counter64: 64496
|
||||
# NS-ROOT-MIB::vsvrTotalResponseBytes."observium" = Counter64: 1048603453
|
||||
# NS-ROOT-MIB::vsvrTotalPktsRecvd."observium" = Counter64: 629637
|
||||
# NS-ROOT-MIB::vsvrTotalPktsSent."observium" = Counter64: 936237
|
||||
# NS-ROOT-MIB::vsvrTotalSynsRecvd."observium" = Counter64: 43130
|
||||
# NS-ROOT-MIB::vsvrCurServicesDown."observium" = Gauge32: 0
|
||||
# NS-ROOT-MIB::vsvrCurServicesUnKnown."observium" = Gauge32: 0
|
||||
# NS-ROOT-MIB::vsvrCurServicesOutOfSvc."observium" = Gauge32: 0
|
||||
# NS-ROOT-MIB::vsvrCurServicesTransToOutOfSvc."observium" = Gauge32: 0
|
||||
# NS-ROOT-MIB::vsvrCurServicesUp."observium" = Gauge32: 0
|
||||
# NS-ROOT-MIB::vsvrTotMiss."observium" = Counter64: 0
|
||||
# NS-ROOT-MIB::vsvrRequestRate."observium" = STRING: "0"
|
||||
# NS-ROOT-MIB::vsvrRxBytesRate."observium" = STRING: "248"
|
||||
# NS-ROOT-MIB::vsvrTxBytesRate."observium" = STRING: "188"
|
||||
# NS-ROOT-MIB::vsvrSynfloodRate."observium" = STRING: "0"
|
||||
# NS-ROOT-MIB::vsvrIp6Address."observium" = STRING: 0:0:0:0:0:0:0:0
|
||||
# NS-ROOT-MIB::vsvrTotHits."observium" = Counter64: 64537
|
||||
# NS-ROOT-MIB::vsvrTotSpillOvers."observium" = Counter32: 0
|
||||
# NS-ROOT-MIB::vsvrTotalClients."observium" = Counter64: 43023
|
||||
# NS-ROOT-MIB::vsvrClientConnOpenRate."observium" = STRING: "0"
|
||||
|
||||
if($device['os'] == "netscaler")
|
||||
{
|
||||
|
||||
echo("Netscaler VServers\n");
|
||||
|
||||
$oids_gauge = array('vsvrCurClntConnections','vsvrCurSrvrConnections');
|
||||
|
||||
$oids_counter = array('vsvrSurgeCount','vsvrTotalRequests','vsvrTotalRequestBytes','vsvrTotalResponses','vsvrTotalResponseBytes','vsvrTotalPktsRecvd',
|
||||
'vsvrTotalPktsSent','vsvrTotalSynsRecvd','vsvrTotMiss','vsvrTotHits','vsvrTotSpillOvers','vsvrTotalClients');
|
||||
|
||||
$oids = array_merge($oids_gauge, $oids_counter);
|
||||
|
||||
unset($snmpstring, $rrdupdate, $snmpdata, $snmpdata_cmd, $rrd_create);
|
||||
|
||||
$rrd_create = "RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 \
|
||||
RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797";
|
||||
|
||||
foreach ($oids_gauge as $oid)
|
||||
{
|
||||
$oid_ds = truncate(str_replace("vsvr", "", $oid), 19, '');
|
||||
$rrd_create .= " DS:$oid_ds:GAUGE:600:U:100000000000";
|
||||
}
|
||||
|
||||
foreach ($oids_counter as $oid)
|
||||
{
|
||||
$oid_ds = truncate(str_replace("vsvr", "", $oid), 19, '');
|
||||
$rrd_create .= " DS:$oid_ds:COUNTER:600:U:100000000000";
|
||||
}
|
||||
|
||||
|
||||
$vsvr_array = snmpwalk_cache_oid($device, "vserverEntry", array(), "NS-ROOT-MIB");
|
||||
|
||||
$vsvr_db = dbFetchRows("SELECT * FROM `netscaler_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
foreach ($vsvr_db as $vsvr) { $vsvrs[$vsvr['vsvr_name']] = $vsvr; }
|
||||
|
||||
foreach($vsvr_array as $index => $vsvr)
|
||||
{
|
||||
|
||||
if(isset($vsvr['vsvrName']))
|
||||
{
|
||||
|
||||
$rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/netscaler-vsvr-".safename($vsvr['vsvrName']).".rrd";
|
||||
|
||||
$rrdupdate = "N";
|
||||
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
if (is_numeric($vsvr[$oid]))
|
||||
{
|
||||
$rrdupdate .= ":".$vsvr[$oid];
|
||||
} else {
|
||||
$rrdupdate .= ":U";
|
||||
}
|
||||
}
|
||||
|
||||
echo(str_pad($vsvr['vsvrName'], 25) . " | " . str_pad($vsvr['vsvrType'],5) . " | " . str_pad($vsvr['vsvrState'],6) ." | ". str_pad($vsvr['vsvrIpAddress'],16) ." | ". str_pad($vsvr['vsvrPort'],5));
|
||||
echo(" | " . str_pad($vsvr['vsvrRequestRate'],8) . " | " . str_pad($vsvr['vsvrRxBytesRate']."B/s", 8)." | ". str_pad($vsvr['vsvrTxBytesRate']."B/s", 8));
|
||||
|
||||
$db_update = array('vsvr_ip' => $vsvr['vsvrIpAddress'], 'vsvr_port' => $vsvr['vsvrPort'], 'vsvr_state' => $vsvr['vsvrState'], 'vsvr_type' => $vsvr['vsvrType'],
|
||||
'vsvr_req_rate' => $vsvr['RequestRate'], 'vsvr_bps_in' => $vsvr['vsvrRxBytesRate'], 'vsvr_bps_out' => $vsvr['vsvrTxBytesRate']);
|
||||
|
||||
|
||||
if(!is_array($vsvrs[$vsvr['vsvrName']]))
|
||||
{
|
||||
$db_insert = array_merge(array('device_id' => $device['device_id'], 'vsvr_name' => $vsvr['vsvrName']), $db_update);
|
||||
|
||||
$vsvr_id = dbInsert($db_insert, 'netscaler_vservers'); echo (" +");
|
||||
} else {
|
||||
$updated = dbUpdate($db_update, 'netscaler_vservers', '`vsvr_id` = ?', array($vsvrs[$vsvr['vsvrName']]['vsvr_id']));
|
||||
echo(" U");
|
||||
}
|
||||
|
||||
if (!file_exists($rrd_file)) { rrdtool_create($rrd_file, $rrd_create); }
|
||||
rrdtool_update($rrd_file, $rrdupdate);
|
||||
|
||||
echo("\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
2626
mibs/NS-MIB
2626
mibs/NS-MIB
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user