2014-07-03 15:27:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* LibreNMS
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ fua http://www.lathwood.co.uk>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2015-07-13 20:10:26 +02:00
|
|
|
|
2017-02-23 22:45:50 +00:00
|
|
|
use LibreNMS\RRD\RrdDefinition;
|
|
|
|
|
2018-02-28 08:15:31 -05:00
|
|
|
if ($device['os_group'] == 'cisco' && ($device['os'] == 'asa' || $device['os'] == 'ftd') && $device['type'] == 'firewall') {
|
2023-10-05 01:29:22 -05:00
|
|
|
$connections = SnmpQuery::get('CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp.currentInUse')->value();
|
|
|
|
|
|
|
|
if ($connections) {
|
|
|
|
DB::table('ciscoASA')->updateOrInsert([
|
|
|
|
'device_id' => $device['device_id'],
|
|
|
|
'oid' => 'currentInUse',
|
|
|
|
], [
|
|
|
|
'data' => $connections,
|
|
|
|
]);
|
2014-07-03 15:27:52 +01:00
|
|
|
|
2017-02-23 22:45:50 +00:00
|
|
|
$rrd_def = RrdDefinition::make()->addDataset('connections', 'GAUGE', 0);
|
2015-08-18 16:26:55 +00:00
|
|
|
$fields = [
|
2023-10-05 01:29:22 -05:00
|
|
|
'connections' => $connections,
|
2015-08-18 16:26:55 +00:00
|
|
|
];
|
2014-07-03 15:27:52 +01:00
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
2016-08-28 12:32:58 -05:00
|
|
|
data_update($device, 'asa_conns', $tags, $fields);
|
2015-08-19 20:58:02 +00:00
|
|
|
|
2020-07-23 09:57:22 -05:00
|
|
|
$os->enableGraph('asa_conns');
|
2014-07-03 15:27:52 +01:00
|
|
|
echo ' ASA Connections';
|
|
|
|
}
|
|
|
|
|
2023-10-05 01:29:22 -05:00
|
|
|
unset($connections, $data, $rrd_def, $fields, $tags);
|
2015-07-13 20:10:26 +02:00
|
|
|
}//end if
|