Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PPPoE Sessions Graph for Mikrotik #10056

Merged
merged 1 commit into from Apr 2, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

newdevice: Added PPPoE Sessions Graph for Mikrotik

Cli command to get session count: /interface pppoe-server print count-only
  • Loading branch information...
neszt committed Apr 1, 2019
commit 7f6e7f5f2b9e9dfa7a3b977154d29e24f545cae2
@@ -0,0 +1,19 @@
<?php
$rrd_filename = rrd_name($device['hostname'], 'routeros_pppoe_sessions');
require 'includes/graphs/common.inc.php';
$ds = 'pppoe_sessions';
$colour_area = '99cc99';
$colour_line = '00cc00';
$colour_area_max = '99cc99';
$scale_min = '0';
$graph_max = 1;
$graph_min = 0;
$unit_text = 'PPPoE Sessions';
require 'includes/graphs/generic_simplex.inc.php';
@@ -503,6 +503,10 @@
$config['graph_types']['device']['routeros_leases']['order'] = 0;
$config['graph_types']['device']['routeros_leases']['descr'] = 'DHCP Lease Count';
$config['graph_types']['device']['routeros_pppoe_sessions']['section'] = 'network';
$config['graph_types']['device']['routeros_pppoe_sessions']['order'] = 0;
$config['graph_types']['device']['routeros_pppoe_sessions']['descr'] = 'PPPoE Session Count';
//CheckPoint SPLAT specific graphs
$config['graph_types']['device']['secureplatform_sessions']['section'] = 'firewall';
@@ -26,3 +26,19 @@
}
unset($leases);
$pppoe_sessions = snmp_get($device, '1.3.6.1.4.1.9.9.150.1.1.1.0', '-OQv', '', '');
if (is_numeric($pppoe_sessions)) {
$rrd_def = RrdDefinition::make()->addDataset('pppoe_sessions', 'GAUGE', 0);
$fields = array(
'pppoe_sessions' => $pppoe_sessions,
);
$tags = compact('rrd_def');
data_update($device, 'routeros_pppoe_sessions', $tags, $fields);
$graphs['routeros_pppoe_sessions'] = true;
}
unset($pppoe_sessions);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.