mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
cisco vpdn graphing
git-svn-id: http://www.observium.org/svn/observer/trunk@2741 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
25
html/includes/graphs/device/vpdn_sessions_l2tp.inc.php
Normal file
25
html/includes/graphs/device/vpdn_sessions_l2tp.inc.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/vpdn-l2tp.rrd";
|
||||
|
||||
$stats = array('sessions');
|
||||
|
||||
$i=0;
|
||||
foreach ($stats as $stat)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['ds'] = $stat;
|
||||
}
|
||||
|
||||
$colours='mixed';
|
||||
|
||||
$nototal = 1;
|
||||
$simple_rrd = 1;
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
?>
|
||||
25
html/includes/graphs/device/vpdn_tunnels_l2tp.inc.php
Normal file
25
html/includes/graphs/device/vpdn_tunnels_l2tp.inc.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/vpdn-l2tp.rrd";
|
||||
|
||||
$stats = array('tunnels');
|
||||
|
||||
$i=0;
|
||||
foreach ($stats as $stat)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['ds'] = $stat;
|
||||
}
|
||||
|
||||
$colours='mixed';
|
||||
|
||||
$nototal = 1;
|
||||
$simple_rrd = 1;
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
?>
|
||||
@@ -360,6 +360,7 @@ $config['poller_modules']['cisco-remote-access-monitor'] = 1;
|
||||
$config['poller_modules']['cisco-cef'] = 1;
|
||||
$config['poller_modules']['cisco-mac-accounting'] = 1;
|
||||
$config['poller_modules']['cipsec-tunnels'] = 1;
|
||||
$config['poller_modules']['cisco-vpdn'] = 1;
|
||||
$config['poller_modules']['entity-physical'] = 1;
|
||||
|
||||
|
||||
|
||||
59
includes/polling/cisco-vpdn.inc.php
Executable file
59
includes/polling/cisco-vpdn.inc.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
#CISCO-VPDN-MGMT-MIB::cvpdnTunnelTotal.0 = Gauge32: 0 tunnels
|
||||
#CISCO-VPDN-MGMT-MIB::cvpdnSessionTotal.0 = Gauge32: 0 users
|
||||
#CISCO-VPDN-MGMT-MIB::cvpdnDeniedUsersTotal.0 = Counter32: 0 attempts
|
||||
#CISCO-VPDN-MGMT-MIB::cvpdnSystemTunnelTotal.l2tp = Gauge32: 437 tunnels
|
||||
#CISCO-VPDN-MGMT-MIB::cvpdnSystemSessionTotal.l2tp = Gauge32: 1029 sessions
|
||||
#CISCO-VPDN-MGMT-MIB::cvpdnSystemDeniedUsersTotal.l2tp = Counter32: 0 attempts
|
||||
#CISCO-VPDN-MGMT-MIB::cvpdnSystemClearSessions.0 = INTEGER: none(1)
|
||||
|
||||
if ($device['os_group'] == "ios")
|
||||
{
|
||||
$data = snmpwalk_cache_oid($device, "cvpdnSystemEntry", NULL, "CISCO-VPDN-MGMT-MIB");
|
||||
|
||||
foreach($data as $type => $vpdn)
|
||||
{
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("vpdn-".$type.".rrd");
|
||||
$rrd_create = " DS:tunnels:GAUGE:600:0:U";
|
||||
$rrd_create .= " DS:sessions:GAUGE:600:0:U";
|
||||
$rrd_create .= " DS:denied:COUNTER:600:0:100000";
|
||||
$rrd_create .= " RRA:AVERAGE:0.5:1:1200";
|
||||
$rrd_create .= " RRA:AVERAGE:0.5:1:2000";
|
||||
$rrd_create .= " RRA:AVERAGE:0.5:6:2000";
|
||||
$rrd_create .= " RRA:AVERAGE:0.5:24:2000";
|
||||
$rrd_create .= " RRA:AVERAGE:0.5:288:2000";
|
||||
$rrd_create .= " RRA:MAX:0.5:1:1200";
|
||||
$rrd_create .= " RRA:MAX:0.5:6:2000";
|
||||
$rrd_create .= " RRA:MAX:0.5:24:2000";
|
||||
$rrd_create .= " RRA:MAX:0.5:288:2000";
|
||||
$rrd_create .= " RRA:MIN:0.5:1:1200";
|
||||
$rrd_create .= " RRA:MIN:0.5:6:2000";
|
||||
$rrd_create .= " RRA:MIN:0.5:24:2000";
|
||||
$rrd_create .= " RRA:MIN:0.5:288:2000";
|
||||
|
||||
if (is_file($rrd_filename) || $vpdn['cvpdnSystemTunnelTotal'] || $vpdn['cvpdnSystemSessionTotal'])
|
||||
{
|
||||
if (!file_exists($rrd_filename))
|
||||
{
|
||||
rrdtool_create($rrd_filename, $rrd_create);
|
||||
}
|
||||
|
||||
$rrd_update = "N";
|
||||
$rrd_update .= ":".$vpdn['cvpdnSystemTunnelTotal'];
|
||||
$rrd_update .= ":".$vpdn['cvpdnSystemSessionTotal'];
|
||||
$rrd_update .= ":".$vpdn['cvpdnSystemDeniedUsersTotal'];
|
||||
|
||||
rrdtool_update($rrd_filename, $rrd_update);
|
||||
|
||||
$graphs['vpdn_sessions_'.$type] = TRUE;
|
||||
$graphs['vpdn_tunnels_'.$type] = TRUE;
|
||||
|
||||
echo(" Cisco VPDN ($type) ");
|
||||
}
|
||||
}
|
||||
unset($data, $vpdn, $type, $rrd_filename, $rrd_create, $rrd_update);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -168,6 +168,8 @@ function poll_device($device, $options)
|
||||
### If there any don't match, they're added/deleted from the database.
|
||||
### Ideally we should hold graphs for xx days/weeks/polls so that we don't needlessly hide information.
|
||||
|
||||
print_r($graphs);
|
||||
|
||||
foreach (dbFetch("SELECT `graph` FROM `device_graphs` WHERE `device_id` = ?", array($device['device_id'])) as $graph)
|
||||
{
|
||||
if (!isset($graphs[$graph["graph"]]))
|
||||
|
||||
@@ -804,7 +804,7 @@ foreach ($config['os'] as $this_os => $blah)
|
||||
|
||||
### Graph Types
|
||||
|
||||
$config['graph_sections'] = array('system', 'firewall', 'netstats', 'wireless', 'storage');
|
||||
$config['graph_sections'] = array('system', 'firewall', 'netstats', 'wireless', 'storage', 'vpdn');
|
||||
|
||||
$config['graph_types']['device']['wifi_clients']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['wifi_clients']['order'] = '0';
|
||||
@@ -919,6 +919,15 @@ $config['graph_types']['device']['uptime']['section'] = 'system';
|
||||
$config['graph_types']['device']['uptime']['order'] = '0';
|
||||
$config['graph_types']['device']['uptime']['descr'] = 'System Uptime';
|
||||
|
||||
$config['graph_types']['device']['vpdn_sessions_l2tp']['section'] = 'vpdn';
|
||||
$config['graph_types']['device']['vpdn_sessions_l2tp']['order'] = '0';
|
||||
$config['graph_types']['device']['vpdn_sessions_l2tp']['descr'] = 'VPDN L2TP Sessions';
|
||||
|
||||
$config['graph_types']['device']['vpdn_tunnels_l2tp']['section'] = 'vpdn';
|
||||
$config['graph_types']['device']['vpdn_tunnels_l2tp']['order'] = '0';
|
||||
$config['graph_types']['device']['vpdn_tunnels_l2tp']['descr'] = 'VPDN L2TP Tunnels';
|
||||
|
||||
|
||||
### Device Types
|
||||
|
||||
$i = 0;
|
||||
|
||||
Reference in New Issue
Block a user