Skip to content

Commit

Permalink
device: Added and Updated Blue Coat device support (librenms#8664)
Browse files Browse the repository at this point in the history
* Blue Coat device updates

* Blue Coat device updates

* Updated PHP code per @laf comments

* YAML update for Packetshaper

* SSL Visibility YAML and snmprec file

* Cleanup problematic MIB files which should not have been there

* Reset Packetshaper YAML to original

* Added json test data
  • Loading branch information
centralscrutiniser authored and TheMysteriousX committed May 20, 2018
1 parent c378d42 commit bd30eda
Show file tree
Hide file tree
Showing 15 changed files with 3,163 additions and 10 deletions.
18 changes: 18 additions & 0 deletions html/includes/graphs/device/sgos_client_connections.inc.php
@@ -0,0 +1,18 @@
<?php

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

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

$ds = 'client_connections';

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

$colour_area_max = '9999cc';

$scale_min = '0';

$unit_text = 'Client Conn';

require 'includes/graphs/generic_simplex.inc.php';
18 changes: 18 additions & 0 deletions html/includes/graphs/device/sgos_client_connections_active.inc.php
@@ -0,0 +1,18 @@
<?php

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

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

$ds = 'client_conn_active';

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

$colour_area_max = '9999cc';

$scale_min = '0';

$unit_text = 'Active Conn';

require 'includes/graphs/generic_simplex.inc.php';
18 changes: 18 additions & 0 deletions html/includes/graphs/device/sgos_client_connections_idle.inc.php
@@ -0,0 +1,18 @@
<?php

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

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

$ds = 'client_conn_idle';

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

$colour_area_max = '9999cc';

$scale_min = '0';

$unit_text = 'Idle Conn';

require 'includes/graphs/generic_simplex.inc.php';
18 changes: 18 additions & 0 deletions html/includes/graphs/device/sgos_server_connections.inc.php
@@ -0,0 +1,18 @@
<?php

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

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

$ds = 'server_connections';

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

$colour_area_max = '9999cc';

$scale_min = '0';

$unit_text = 'Server Conn';

require 'includes/graphs/generic_simplex.inc.php';
18 changes: 18 additions & 0 deletions html/includes/graphs/device/sgos_server_connections_active.inc.php
@@ -0,0 +1,18 @@
<?php

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

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

$ds = 'server_conn_active';

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

$colour_area_max = '9999cc';

$scale_min = '0';

$unit_text = 'Active Conn';

require 'includes/graphs/generic_simplex.inc.php';
18 changes: 18 additions & 0 deletions html/includes/graphs/device/sgos_server_connections_idle.inc.php
@@ -0,0 +1,18 @@
<?php

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

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

$ds = 'server_conn_idle';

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

$colour_area_max = '9999cc';

$scale_min = '0';

$unit_text = 'Idle Conn';

require 'includes/graphs/generic_simplex.inc.php';
9 changes: 8 additions & 1 deletion includes/definitions/packetshaper.yaml
@@ -1,6 +1,13 @@
os: packetshaper
text: 'Blue Coat Packetshaper'
text: 'Blue Coat PacketShaper'
type: network
ifname: 1
icon: bluecoat
mib_dir:
- bluecoat
over:
- { graph: device_bits, text: 'Device Traffic' }
discovery:
- sysDescr:
- PacketShaper

14 changes: 14 additions & 0 deletions includes/definitions/sslvis.yaml
@@ -0,0 +1,14 @@
os: sslvis
text: 'Blue Coat SSL Visibility'
type: network
ifname: 1
icon: bluecoat
mib_dir:
- bluecoat
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectID:
- .1.3.6.1.4.1.3417.1.5.
104 changes: 96 additions & 8 deletions includes/polling/os/sgos.inc.php
Expand Up @@ -2,17 +2,105 @@

use LibreNMS\RRD\RrdDefinition;

$version = trim(snmp_get($device, "BLUECOAT-SG-PROXY-MIB::sgProxyVersion.0", "-OQv"), '"');
$hardware = trim(snmp_get($device, "BLUECOAT-SG-PROXY-MIB::sgProxySoftware.0", "-OQv"), '"');
$hostname = trim(snmp_get($device, "SNMPv2-MIB::sysName.0", "-OQv"), '"');
$sgos_requests = snmp_get($device, "BLUECOAT-SG-PROXY-MIB::sgProxyHttpClientRequestRate.0", "-OQvU");
$oid_list = 'sgProxyVersion.0 sgProxySoftware.0 sgProxyHttpClientRequestRate.0 sgProxyHttpClientConnections.0 sgProxyHttpClientConnectionsActive.0 sgProxyHttpClientConnectionsIdle.0 sgProxyHttpServerConnections.0 sgProxyHttpServerConnectionsActive.0 sgProxyHttpServerConnectionsIdle.0';
$sgos = snmp_get_multi_oid($device, $oid_list, '-OUQs', 'BLUECOAT-SG-PROXY-MIB');
$version = $sgos[0]['sgProxyVersion.0'];
$hardware = $sgos[0]['sgProxySoftware.0'];

if (is_numeric($sgos_requests)) {
$rrd_def = RrdDefinition::make()->addDataset('requests', 'GAUGE', 0);
if (is_numeric($sgos[0]['sgProxyHttpClientRequestRate'])) {
$tags = array(
'rrd_def' => RrdDefinition::make()->addDataset('requests', 'GAUGE', 0),
);
$fields = array(
'requests' => $sgos_requests
'requests' => $sgos[0]['sgProxyHttpClientRequestRate'],
);
$tags = compact('rrd_def');

data_update($device, 'sgos_average_requests', $tags, $fields);

$graphs['sgos_average_requests'] = true;
echo ' HTTP Req Rate';
}

if (is_numeric($sgos[0]['sgProxyHttpClientConnections'])) {
$tags = array(
'rrd_def' => RrdDefinition::make()->addDataset('client_conn', 'GAUGE', 0),
);
$fields = array(
'client_conn' => $sgos[0]['sgProxyHttpClientConnections'],
);

data_update($device, 'sgos_client_connections', $tags, $fields);

$graphs['sgos_client_connections'] = true;
echo ' Client Conn';
}

if (is_numeric($sgos[0]['sgProxyHttpServerConnections'])) {
$tags = array(
'rrd_def' => RrdDefinition::make()->addDataset('server_conn', 'GAUGE', 0),
);
$fields = array(
'server_conn' => $sgos[0]['sgProxyHttpServerConnections'],
);

data_update($device, 'sgos_server_connections', $tags, $fields);

$graphs['sgos_server_connections'] = true;
echo ' Server Conn';
}

if (is_numeric($sgos[0]['sgProxyHttpClientConnectionsActive'])) {
$tags = array(
'rrd_def' => RrdDefinition::make()->addDataset('client_conn_active', 'GAUGE', 0),
);
$fields = array(
'client_conn_active' => $sgos[0]['sgProxyHttpClientConnectionsActive'],
);

data_update($device, 'sgos_client_connections_active', $tags, $fields);

$graphs['sgos_client_connections_active'] = true;
echo ' Client Conn Active';
}

if (is_numeric($sgos[0]['sgProxyHttpServerConnectionsActive'])) {
$tags = array(
'rrd_def' => RrdDefinition::make()->addDataset('server_conn_active', 'GAUGE', 0),
);
$fields = array(
'server_conn_active' => $sgos[0]['sgProxyHttpServerConnectionsActive'],
);

data_update($device, 'sgos_server_connections_active', $tags, $fields);

$graphs['sgos_server_connections_active'] = true;
echo ' Server Conn Active';
}

if (is_numeric($sgos[0]['sgProxyHttpClientConnectionsIdle'])) {
$tags = array(
'rrd_def' => RrdDefinition::make()->addDataset('client_idle', 'GAUGE', 0),
);
$fields = array(
'client_idle' => $sgos[0]['sgProxyHttpClientConnectionsIdle'],
);

data_update($device, 'sgos_client_connections_idle', $tags, $fields);

$graphs['sgos_client_connections_idle'] = true;
echo ' Client Conne Idle';
}

if (is_numeric($sgos[0]['sgProxyHttpServerConnectionsIdle'])) {
$tags = array(
'rrd_def' => RrdDefinition::make()->addDataset('server_idle', 'GAUGE', 0),
);
$fields = array(
'server_idle' => $sgos[0]['sgProxyHttpServerConnectionsIdle'],
);

data_update($device, 'sgos_server_connections_idle', $tags, $fields);

$graphs['sgos_server_connections_idle'] = true;
echo ' Server Conn Idle';
}

0 comments on commit bd30eda

Please sign in to comment.