rbicelli / pfsense-zabbix-template

Zabbix Template for pfSense
Apache License 2.0
240 stars 107 forks source link

Script crash on pfsense 2.6 #97

Closed gjhuisman closed 1 year ago

gjhuisman commented 2 years ago

Currently running pfsense development branch version2.6 Since the upgrade the script bails out with the following error;

[28-Dec-2021 17:22:12 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 936 [28-Dec-2021 17:22:12 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 940 [28-Dec-2021 17:22:12 Europe/Amsterdam] PHP Warning: Invalid argument supplied for foreach() in /root/scripts/pfsense_zbx.php on line 984 [28-Dec-2021 17:24:12 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 936 [28-Dec-2021 17:24:12 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 940 [28-Dec-2021 17:24:12 Europe/Amsterdam] PHP Warning: Invalid argument supplied for foreach() in /root/scripts/pfsense_zbx.php on line 984 [28-Dec-2021 17:26:12 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 936 [28-Dec-2021 17:26:12 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 940 [28-Dec-2021 17:26:12 Europe/Amsterdam] PHP Warning: Invalid argument supplied for foreach() in /root/scripts/pfsense_zbx.php on line 984 [28-Dec-2021 17:27:24 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 936 [28-Dec-2021 17:27:24 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 940 [28-Dec-2021 17:27:24 Europe/Amsterdam] PHP Warning: Invalid argument supplied for foreach() in /root/scripts/pfsense_zbx.php on line 984

rbicelli commented 2 years ago

Hello, could you try to run the script from command line, without arguments, and post the output?

rbicelli commented 2 years ago

Please, could you try to disable DHCP server failover related checks and see if the crash persist? Thanks

gjhuisman commented 2 years ago

pfSense.txt

Dropped the output <Shell Output - /usr/local/bin/php /root/scripts/pfsense_zbx.php> did edit the file to anonymize the output. I have no failover related settings in this FW config.

Error on item pfsense.value[dhcp,failover] : `Value of type "string" is not suitable for value type "Numeric (unsigned)". Value " Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 936

Warning: count(): Parameter must be an array or an object that implements Countable in /root/scripts/pfsense_zbx.php on line 940

Warning: Invalid argument supplied for foreach() in /root/scripts/pfsense_zbx.php on line 984 0"`

rbicelli commented 2 years ago

Hello! It doesn't matter if you don't have failover related settings in firewall, you shoud try to disable in Zabbix the item relative to DHCP failover. The item is DHCP Failover Pool Problems - pfsense.value[dhcp,failover]

Ouput of script is ok since the error is in the code which checks DHCP pools.

gjhuisman commented 2 years ago

Then the script also fails on de certificate item checks for:

Disabled the items for know.

GuillaumeHullin commented 2 years ago

Hi @gjhuisman I just updated today my test environment to pfSense 2.6.0-RELEASE... and Certificates Manager: earliest "validTo" and Certificates Manager: latest "validFrom" are working from me...

If you open the Command Prompt and run php /root/scripts/pfsense_zbx.php cert_date validTo.min

What do you get?

GuillaumeHullin commented 2 years ago

@rbicelli from my tests right now, everything with 2.6.0... Is it the case for you too?