riskersen / Monitoring

Monitoring plugins wich are Nagios/icinga compatible
65 stars 112 forks source link

Fortigate license check never error? #68

Closed HOSTED-POWER closed 2 years ago

HOSTED-POWER commented 3 years ago

Hi,

All checks are working properly, except for the license check it seems weird I cannot have any error:

./check_fortigate.pl -H x.x.x.x -C snmp4all -T license -c 5000 -w 5000 OK: ...

./check_fortigate.pl -H x.x.x.x -C snmp4all -T license -c 5000000-w 5000000 OK: ...

Whatever I fill in for value, it keeps giving ok ...

sgruber94 commented 3 years ago

Hi Hosted Power,

you are right. I found the error. The mode "ignore expired licenses" was the issue. https://github.com/riskersen/Monitoring/blob/master/fortigate/check_fortigate.pl#L1011

actual: if(($license_remaining > 0 ) && ($mode == 1))

changed: if($license_remaining >= 0 ) { if (($license_remaining <= $license_warning) && ($license_remaining <= $license_critcal) ) { push (@license_expiry_warn_table, ($license_contract_descpriction.'/'.$license_contract_expiry)); } if ($license_remaining <= $license_critcal) { push (@license_expiry_crit_table, ($license_contract_descpriction.'/'.$license_contract_expiry)); } }else{ if ($mode == 1) { push (@license_expiry_crit_table, ($license_contract_descpriction.'/'.$license_contract_expiry)); } }

i will create a PR for fixing it

sgruber94 commented 3 years ago

check #69

HOSTED-POWER commented 2 years ago

Yes it worked, thank you so much for the good support!