Random Project

SNMP version not considered

Hi!
I am trying your script to check a FortiGate-100D.
But I always get «SNMP service is not available on at ./check_fortigate_vpn.pl line 187» and exit code of 255.
I think it is related with SNMP version, this particular Fortigate only has v1 enabled and not vc2 nor v3.

I’ve noticed you use a serie of perl functions but I dont understand how can I hardcode SNMP v1 on those
– get_snmp_session($ip, $community);
– get_snmp_value($session, $oid_unitdesc);
– get_snmp_table($session, $oid_ipsectuntableroot . $oidf_tunndx);
– close_snmp_session($session);
– get_snmp_request($session, $oid)

Can you please tell me hou can I force the SNMP version?

Thank you