Hi,
I would like to monitor the number of dialup VPN on a Fortigate with a hardcoded value in the Centreon configuration that will be modified over the time.
Ideally, I would like to have a warning when we have more than this number, and a critical when we have less.
The current plugin Fortigate does not return dialup vpn information as those one seem stored in differents OID than standard site 2 site VPN. Here are the some additionnal information: https://docs.fortinet.com/document/fortigate/6.4.0/new-features/32869/snmp-polling-extensions-to-support-new-oids-6-4-2
So, I ran an snmpwalk on this OID: 1.3.6.1.4.1.12356.101.12.4.1.1.16 I can find some interesting values:
p...]
.1.3.6.1.4.1.12356.101.12.4.1.1.16.1 = STRING: "DialUpX_0"
.1.3.6.1.4.1.12356.101.12.4.1.1.16.2 = STRING: "DialUpX_1"
.1.3.6.1.4.1.12356.101.12.4.1.1.16.3 = STRING: "DialUpY_1"
.1.3.6.1.4.1.12356.101.12.4.1.1.16.4 = STRING: "DialUpY_4"
.1.3.6.1.4.1.12356.101.12.4.1.1.16.5 = STRING: "DialUpZ_3"
b...]
So my idea is to first catch all the value for DialUpY which is working great with the following:
#/usr/lib/centreon/plugins/centreon_generic_snmp.pl --plugin=apps::protocols::snmp::plugin --hostname=<ip> --snmp-version='3' --snmp-username="user" --authpassphrase="authpass" --authprotocol="SHA" --privpassphrase="privpass" --privprotocol="AES" --mode=string-value --oid-table='1.3.6.1.4.1.12356.101.12.4.1.1.16' --filter-table-value="DialUpY"
OK: 11 value(s)
Then, I would like to write a regex allowing me to hardcode a number. Let’s say 10. In that case I will have a warning because I have 11 values.
Is it the right way to proceed (maybe another generic plugin?) ? Anyone know how to write such a regexp to stay with standard plugin ?
Thanks for reading
NB1: maybe I can also play with the “map” feature because I have, for each entrie under 1.3.6.1.4.1.12356.101.12.4.1.1.16 a numeric value of 2 under 1.3.6.1.4.1.12356.101.12.4.1.1.17, … :
2...]
.1.3.6.1.4.1.12356.101.12.4.1.1.17.1 = INTEGER: 2
.1.3.6.1.4.1.12356.101.12.4.1.1.17.2 = INTEGER: 2
.1.3.6.1.4.1.12356.101.12.4.1.1.17.3 = INTEGER: 2
.1.3.6.1.4.1.12356.101.12.4.1.1.17.4 = INTEGER: 2
.1.3.6.1.4.1.12356.101.12.4.1.1.17.5 = INTEGER: 2
1...]