Comments (8)
Hi,
We upgraded to Zabbix 6.0 .. for the latest agent 6.0 we needed to upgrade to pFsense 23.01. Which has php 8.1..
Any help would be appreciated ..
from pfsense-zabbix-template.
DISCLAIMER: I HAVE NO CLUE WHAT I AM DOING!
I'm not entirely sure whether this creates the desired behaviour or not, but is has suppressed the errors for me
It does seem that the is_countable may have the same effect as count > 0 and putting both like I have is pointless.
It may be that the variables are the incorrect data type as required by the php upgrade, so my modifications are preventing the duplicate removal functions from happening.
It may be that the variable does not exist yet, intentionally or not, and count is being used to check it's existence. If that is the case then I believe this should be a viable solution.
With that said, I managed to suppress the error by changing line 978 from:
if (count($leases) > 0) {
to
if (is_countable($leases) && count($leases) > 0) {
And line 982 from:
if (count($pools) > 0) {
to
if (is_countable($pools) && count($pools) > 0) {
Use at your own risk!
from pfsense-zabbix-template.
A better workaroud is to disable items related to DHCP Pool Failover instead of editing the script.
from pfsense-zabbix-template.
DISCLAIMER: I HAVE NO CLUE WHAT I AM DOING!
I'm not entirely sure whether this creates the desired behaviour or not, but is has suppressed the errors for me
It does seem that the is_countable may have the same effect as count > 0 and putting both like I have is pointless.
It may be that the variables are the incorrect data type as required by the php upgrade, so my modifications are preventing the duplicate removal functions from happening.
It may be that the variable does not exist yet, intentionally or not, and count is being used to check it's existence. If that is the case then I believe this should be a viable solution.
With that said, I managed to suppress the error by changing line 978 from:
if (count($leases) > 0) {
toif (is_countable($leases) && count($leases) > 0) {
And line 982 from:
if (count($pools) > 0) {
toif (is_countable($pools) && count($pools) > 0) {
Use at your own risk!
after the modification, another error :
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1131, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1131
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1131): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validFrom.max')
#2 {main}
thrown @ 2023-02-28 09:59:35
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1139, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1139
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1139): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validTo.min')
#2 {main}
thrown @ 2023-02-28 09:59:37
from pfsense-zabbix-template.
What happens when you put the two occurrences of crt
in double quotes "crt"
? I did that on my local instance last week and that seems to have solved the situation, because the crt
constant doesn't exist and we actually need a "crt"
to access the correct field from $cert
.
This output for php 8.1.x and 7.4.x with regards to undefined constants demonstrates why it used to work:
https://onlinephp.io?s=s7EvyCjg5eLlSk3OyFdQCkktLlGyhvOTi0qsAQ%2C%2C&v=8.1.0%2C7.4.0
from pfsense-zabbix-template.
it change nothing...
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1131, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1131
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1131): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validFrom.max')
#2 {main}
thrown @ 2023-03-02 11:00:01
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1139, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1139
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1139): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validTo.min')
#2 {main}
thrown @ 2023-03-02 11:00:04
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1131, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1131
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1131): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validFrom.max')
#2 {main}
thrown @ 2023-03-02 11:01:02
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1139, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1139
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1139): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validTo.min')
#2 {main}
thrown @ 2023-03-02 11:01:04
from pfsense-zabbix-template.
I've submitted a PR #134 that fixes the issue.
I forgot about the change of this line: master...edeckers:pfsense-zabbix-template:elydeckers/fix/broken-pfsense-23-php-8-1#diff-9874529ae15a98afff9726709aa3f7ef31b25cdd0d903ed892ebe626e64a3c57R1119. That's why it didn't work for you @stephanehofman .
from pfsense-zabbix-template.
Hello, I have updated the script to last version, but I still have an error
PHP errors
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1131, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1131
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1131): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validFrom.max')
#2 {main}
thrown @ 2023-03-07 09:45:37
PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 1139, Message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /root/scripts/pfsense_zbx.php:1139
Stack trace:
#0 /root/scripts/pfsense_zbx.php(1139): in_array('62399625c19f2', NULL)
#1 /root/scripts/pfsense_zbx.php(1354): pfz_get_cert_date('validTo.min')
#2 {main}
thrown @ 2023-03-07 09:45:38
from pfsense-zabbix-template.
Related Issues (20)
- pfsense_zbx.php script version not being updated HOT 10
- Typo in Readme HOT 4
- PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /root/scripts/pfsense_zbx.php:817 HOT 1
- PHP Fatal error: Uncaught TypeError: openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, bool given in /root/scripts/pfsense_zbx.php:1237 HOT 14
- Disconnected status OpenVPN client HOT 1
- Crash report begins. Anonymous machine information: HOT 1
- Packages Update Available HOT 2
- Zabbix cannot obtain memory data HOT 2
- Unclosed error HOT 1
- Installation advice HOT 1
- Multiple Gateways HOT 2
- Error when trying to apply template to Pfsense in Zabbix HOT 1
- Latest data not populating HOT 6
- Zabbix Error on Phase1 and 2 status HOT 2
- Added functionality request: Include dhcp available leases HOT 2
- After update 2.7.2, the upload, download and information values have an error: Value of type "string" is not suitable for value type "Numeric (unsigned)". Value "" HOT 7
- Typo in Configuration
- pfSense Gateway Status value not going above 3
- Error "because a host interface of type "Agente" is required." HOT 1
- WAN HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pfsense-zabbix-template.