Files
librenms-librenms/includes/polling/cisco-asa-firewall.inc.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.3 KiB
PHP
Raw Normal View History

<?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
use LibreNMS\RRD\RrdDefinition;
if ($device['os_group'] == 'cisco' && ($device['os'] == 'asa' || $device['os'] == 'ftd') && $device['type'] == 'firewall') {
$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,
]);
$rrd_def = RrdDefinition::make()->addDataset('connections', 'GAUGE', 0);
$fields = [
'connections' => $connections,
];
$tags = compact('rrd_def');
data_update($device, 'asa_conns', $tags, $fields);
2015-08-19 20:58:02 +00:00
$os->enableGraph('asa_conns');
echo ' ASA Connections';
}
unset($connections, $data, $rrd_def, $fields, $tags);
2015-07-13 20:10:26 +02:00
}//end if