Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vpn.pm to add IPSec Tunnel Counter #5382

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

jummo
Copy link

@jummo jummo commented Jan 10, 2025

Add counter for IPSec tunnels and remove default to CRITICAL if one tunnel is down.

Community contributors

Description

Reopen #5341 as I have closed it by accident

Add a counter for IPSec tunnels on Fortigate firewalls.
With this counter it is possible to check the current available IPSec tunnels and set the status to WARNING or CRITICAL on the count.

Added to the output IPSec tunnels state up: 2 in the global sections.
Full output:
OK: Virtual domain 'root' Logged users: 0, Active web sessions: 0, Active tunnels: 0, IPSec tunnels state up: 2 - All vpn are ok | 'root#vpn.users.logged.count'=0users;;;0; 'root#vpn.websessions.active.count'=0sessions;;;0; 'root#vpn.tunnels.active.count'=0tunnels;;;0; 'root#vpn.ipsec.tunnels.state.count'=2tunnels;@1:1;@0:0;0; 'root~t_hub1-1_111#vpn.traffic.in.bitspersecond'=1077.27b/s;;;0; 'root~t_hub1-1_111#vpn.traffic.out.bitspersecond'=1206.72b/s;;;0; 'root~t_hub2-1_111#vpn.traffic.in.bitspersecond'=1076.06b/s;;;0; 'root~t_hub2-1_111#vpn.traffic.out.bitspersecond'=1205.12b/s;;;0;

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Functionality enhancement or optimization (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

How this pull request can be tested ?

Run
`
perl src/centreon_plugins.pl --plugin=network::fortinet::fortigate::snmp::plugin
--mode vpn
--hostname firewall-cluster.example.com
--snmp-version 3
--snmp-username='SNMP-User1'
--authpassphrase='secret1'
--authprotocol='SHA'
--privpassphrase='secret2'
--privprotocol='AES'
--warning-ipsec_tunnels_count='@1:1'
--critical-ipsec_tunnels_count='@0:0'
--use-new-perfdata
--filter-vpn='_11'

Debug information

I have run with --debug option and attached the snmp data from it.
debug.run.snmp.data.txt

Attached are also the MIB files from Fortigate and and extract of the used one with PRTG MIB-Browser.
Fortigate.MIBs.zip

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (develop).
  • I have provide data or shown output displaying the result of this code in the plugin area concerned.

The traffic counters are reported via SNMP are in kbps and only needs to be multiple by 1000 to get the bps values.
@jummo jummo requested a review from a team as a code owner January 10, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants