mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Added Current Connections Graph for Cisco WSA (#6734)
* Added current connections graph for AsyncOS devices * Fixed issues with AsyncOS connections polling and add name to AUTHORS file * Update 194.sql
This commit is contained in:
committed by
Neil Lathwood
parent
60f0553a33
commit
dc498be4f0
@@ -205,6 +205,7 @@ LibreNMS contributors:
|
||||
- Dominik Bay <db@rrbone.net> (eimann)
|
||||
- Nick Peelman <nick@peelman.us> (peelman)
|
||||
- Patrick Ryon <patrick@slashdoom.com> (slashdoom)
|
||||
- Mike Williams <mike@mgww.net> (network-guy)
|
||||
|
||||
Observium was written by:
|
||||
- Adam Armstrong
|
||||
|
||||
19
html/includes/graphs/device/asyncos_conns.inc.php
Normal file
19
html/includes/graphs/device/asyncos_conns.inc.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = rrd_name($device['hostname'], 'asyncos_conns');
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$ds = 'connections';
|
||||
|
||||
$colour_area = '9999cc';
|
||||
$colour_line = '0000cc';
|
||||
|
||||
$colour_area_max = '9999cc';
|
||||
|
||||
$graph_max = 1;
|
||||
$graph_min = 0;
|
||||
|
||||
$unit_text = 'Connections';
|
||||
|
||||
require 'includes/graphs/generic_simplex.inc.php';
|
||||
@@ -6,6 +6,7 @@ over:
|
||||
- { graph: device_bits, text: Traffic }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
- { graph: device_asyncos_conns, text: 'Current Connections' }
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.15497.1
|
||||
|
||||
@@ -2,14 +2,20 @@
|
||||
/*
|
||||
* LibreNMS Cisco AsyncOS information module
|
||||
*
|
||||
* Copyright (c) 2017 Mike Williams <mike@mgww.net>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Mike Williams
|
||||
* @author Mike Williams <mike@mgww.net>
|
||||
*/
|
||||
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
|
||||
list($hardware,$version,,$serial) = explode(',', $device['sysDescr']);
|
||||
|
||||
preg_match('/\w[\d]+\w?/', $hardware, $regexp_results);
|
||||
@@ -20,3 +26,24 @@ $version = $regexp_results[0];
|
||||
|
||||
preg_match('/[[\w]+-[\w]+/', $serial, $regexp_results);
|
||||
$serial = $regexp_results[0];
|
||||
|
||||
$sysobjectid = $poll_device['sysObjectID'];
|
||||
|
||||
# Get stats only if device is web proxy
|
||||
if (strcmp($sysobjectid, 'enterprises.15497.1.2') == 0) {
|
||||
$connections = snmp_get($device, 'tcpCurrEstab.0', '-OQv', 'TCP-MIB');
|
||||
|
||||
if (is_numeric($connections)) {
|
||||
$rrd_name = 'asyncos_conns';
|
||||
$rrd_def = RrdDefinition::make()->addDataset('connections', 'GAUGE', 0, 50000);
|
||||
|
||||
$fields = array(
|
||||
'connections' => $connections,
|
||||
);
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'asyncos_conns', $tags, $fields);
|
||||
|
||||
$graphs['asyncos_conns'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
1
sql-schema/194.sql
Normal file
1
sql-schema/194.sql
Normal file
@@ -0,0 +1 @@
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'asyncos_conns', 'proxy', 'Current Connections', 0);
|
||||
Reference in New Issue
Block a user