Skip to content

Commit

Permalink
Added session graphs for Barracuda NGFW (librenms#10102)
Browse files Browse the repository at this point in the history
* devices: Corrected discovery object ID for Barracuda NGFW; Added fw session graphs
* device: Added test data
  • Loading branch information
pobradovic08 authored and Spencer Butler committed May 21, 2019
1 parent 1f1a2fe commit 8b4e430
Show file tree
Hide file tree
Showing 7 changed files with 6,777 additions and 935 deletions.
6 changes: 6 additions & 0 deletions includes/definitions.inc.php
Expand Up @@ -79,6 +79,12 @@
$config['graph_types']['device']['siklu_rfinterfaceOtherOctets']['order'] = '6';
$config['graph_types']['device']['siklu_rfinterfaceOtherOctets']['descr'] = 'Other Octets';

// Barracuda Firewall support
$config['graph_types']['device']['barracuda_firewall_sessions']['section'] = 'firewall';
$config['graph_types']['device']['barracuda_firewall_sessions']['order'] = 0;
$config['graph_types']['device']['barracuda_firewall_sessions']['descr'] = 'Active Sessions';


// Ceragon Ceraos support
$config['graph_types']['device']['ceraos_RxLevel']['section'] = 'wireless';
$config['graph_types']['device']['ceraos_RxLevel']['order'] = '0';
Expand Down
8 changes: 7 additions & 1 deletion includes/definitions/barracudangfirewall.yaml
Expand Up @@ -3,8 +3,14 @@ text: 'Barracuda NG Firewall'
type: firewall
icon: barracuda
over:
- { graph: device_bits, text: Traffic }
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectID:
- .1.3.6.1.4.1.10704.1
- sysDescr:
- Barracuda Firewall
- Barracuda NG Firewall
mib_dir:
- barracuda
19 changes: 19 additions & 0 deletions includes/html/graphs/device/barracuda_firewall_sessions.inc.php
@@ -0,0 +1,19 @@
<?php

$rrd_filename = rrd_name($device['hostname'], 'barracuda_firewall_sessions');

require 'includes/html/graphs/common.inc.php';

$ds = 'fw_sessions';

$colour_area = '9999cc';
$colour_line = '0000cc';

$colour_area_max = '9999cc';

#$graph_max = 1;
$graph_min = 0;

$unit_text = 'Sessions';

require 'includes/html/graphs/generic_simplex.inc.php';
16 changes: 16 additions & 0 deletions includes/polling/os/barracudangfirewall.inc.php
Expand Up @@ -10,6 +10,22 @@
* the source code distribution for details.
*/

use LibreNMS\RRD\RrdDefinition;

if ($device['sysObjectID'] == '.1.3.6.1.4.1.10704.1.10') {
$hardware = $device['sysName'];
}

$sessions = snmp_get($device, 'firewallSessions64.8.102.119.83.116.97.116.115.0', '-OQv', 'PHION-MIB');

if (is_numeric($sessions)) {
$rrd_def = RrdDefinition::make()->addDataset('fw_sessions', 'GAUGE', 0);

$fields = array(
'fw_sessions' => $sessions
);

$tags = compact('rrd_def');
data_update($device, 'barracuda_firewall_sessions', $tags, $fields);
$graphs['barracuda_firewall_sessions'] = true;
}

0 comments on commit 8b4e430

Please sign in to comment.