[ZBX-23134] Zabbix Agent on pfsense 2.7.0 not fully working Created: 2023 Jul 20  Updated: 2023 Oct 23

Status: Open
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 6.4.4
Fix Version/s: None

Type: Patch request Priority: Trivial
Reporter: Florian Dickbauer Assignee: Victor Breda Credidio
Resolution: Unresolved Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,

today I upgraded my pfsense from 2.6.0 to 2.7.0 but I forgot to check if the Zabbix agent is compatible. Basically the agent seems to be running but I can see the following error in the console:

PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 817, Message: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /root/scripts/pfsense_zbx.php:817
Stack trace:
#0 /root/scripts/pfsense_zbx.php(863): pfz_dhcp_get('failover')
#1 /root/scripts/pfsense_zbx.php(876): pfz_dhcp_check_failover()
#2 /root/scripts/pfsense_zbx.php(1091): pfz_dhcp('failover', NULL)
#3 {main}

 

Can you please check and fix?

Thanks in advance and best regards

Florian



 Comments   
Comment by Francesco Cossettini [ 2023 Sep 14 ]

I add also this exceptions visible in crashreport and php error.log

 

PHP Errors:
PHP Fatal error:  Uncaught Error: Undefined constant "crt" in /root/scripts/pfsense_zbx.php:1087
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1296): pfz_get_cert_date('validTo.min')
#1 {main}
  thrown in /root/scripts/pfsense_zbx.php on line 1087
PHP Fatal error:  Uncaught Error: Undefined constant "crt" in /root/scripts/pfsense_zbx.php:1081
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1296): pfz_get_cert_date('validFrom.max')
#1 {main}
  thrown in /root/scripts/pfsense_zbx.php on line 1081

Pfsense version: 2.7.0

Pfsense package: zabbix-agent6 version 1.0.6

 

Comment by Chris Fox [ 2023 Sep 14 ]

I am seeing the same thing, also pfSense 2.7.0 is creating a crash report for Zabbix-agent64 Version 1.06

 Im getting a crash report and PHP Errors

 

Crash report details:

PHP Errors:
[14-Sep-2023 07:33:40 America/Phoenix] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /root/scripts/pfsense_zbx.php:936
Stack trace:
#0 /root/scripts/pfsense_zbx.php(982): pfz_dhcp_get('failover')
#1 /root/scripts/pfsense_zbx.php(995): pfz_dhcp_check_failover()
#2 /root/scripts/pfsense_zbx.php(1257): pfz_dhcp('failover', NULL)
#3 {main}
  thrown in /root/scripts/pfsense_zbx.php on line 936
[14-Sep-2023 07:33:42 America/Phoenix] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /root/scripts/pfsense_zbx.php:160
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1224): pfz_interface_speedtest_value('igb0', 'download')
#1 {main}
  thrown in /root/scripts/pfsense_zbx.php on line 160
[14-Sep-2023 07:33:42 America/Phoenix] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /root/scripts/pfsense_zbx.php:160
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1224): pfz_interface_speedtest_value('igb0', 'ping')
#1 {main}
  thrown in /root/scripts/pfsense_zbx.php on line 160
[14-Sep-2023 07:33:42 America/Phoenix] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /root/scripts/pfsense_zbx.php:160
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1224): pfz_interface_speedtest_value('igb0', 'upload')
#1 {main}
  thrown in /root/scripts/pfsense_zbx.php on line 160
[14-Sep-2023 07:35:40 America/Phoenix] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /root/scripts/pfsense_zbx.php:936
Stack trace:
#0 /root/scripts/pfsense_zbx.php(982): pfz_dhcp_get('failover')
#1 /root/scripts/pfsense_zbx.php(995): pfz_dhcp_check_failover()
#2 /root/scripts/pfsense_zbx.php(1257): pfz_dhcp('failover', NULL)
#3 {main}
  thrown in /root/scripts/pfsense_zbx.php on line 936

 

 

PHP Errors

 

PHP errors

  • {}PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 936, Message: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /root/scripts/pfsense_zbx.php:936
    Stack trace:
    #0 /root/scripts/pfsense_zbx.php(982): pfz_dhcp_get('failover')
    #1 /root/scripts/pfsense_zbx.php(995): pfz_dhcp_check_failover()
    #2 /root/scripts/pfsense_zbx.php(1257): pfz_dhcp('failover', NULL)
    #3 {main}
    thrown @ 2023-09-14 07:37:40
    Close
     
Comment by Jeff Bremer [ 2023 Oct 12 ]

I have experienced the same issue.
I solved it by disabling the Zabbix item "DHCP Failover Pool Problems".

Our pfSense-cluster does not use the dhcp function, so no problem for us if this is not monitored.

Maybe this helps to solve the problem:
The item key in Zabbix is this:
pfsense.value[dhcp,failover]

Comment by Francesco Cossettini [ 2023 Oct 20 ]

@Jeff Bremer,

thanks for your hint. I will give it a try.

Update: after 3 days I can confirm the workaround just works.

 

 

Generated at Sat Apr 26 03:20:31 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.