diff --git a/AUTHORS.md b/AUTHORS.md index cd334a7743..8131f6ca09 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -205,6 +205,7 @@ LibreNMS contributors: - Dominik Bay (eimann) - Nick Peelman (peelman) - Patrick Ryon (slashdoom) +- Mike Williams (network-guy) Observium was written by: - Adam Armstrong diff --git a/html/includes/graphs/device/asyncos_conns.inc.php b/html/includes/graphs/device/asyncos_conns.inc.php new file mode 100644 index 0000000000..e8fbfadd3d --- /dev/null +++ b/html/includes/graphs/device/asyncos_conns.inc.php @@ -0,0 +1,19 @@ + * 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 */ +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; + } +} diff --git a/sql-schema/194.sql b/sql-schema/194.sql new file mode 100644 index 0000000000..fce964810a --- /dev/null +++ b/sql-schema/194.sql @@ -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);