Comments (5)
Hi @stephanehofman , I've analyzed this code, but I fail to see how this specific error can occur. Are you absolutely sure you're using the latest version of the script? I'll share my observations below so maybe someone else can chime in with new insights.
Observations
The error occurs on lines 1131 and 1139 where the value of $revoked_cert_refs
appears to be NULL
, that issue was supposed to be fixed by initializing $revoked_cert_refs
with an empty array on line 1119. So, since it is initialized with value []
it has to be set to NULL
explicitly somewhere down the line to cause the errors you're experiencing. However, there are only four usages of $revoked_cert_refs
in the entire script, two of which are assignments:
On line 1119 you'll find the initial assignment I mentioned earlier, and the other mutation of the array is on line 1122 where an item is pushed to the end of it. So if there is a bug in the latest version of the script, then I expect this to be the culprit. I fail to see how though, because I've tried to upset PHP with some possible troublesome inputs but to no avail:
<?php
$xs = [];
var_dump($xs);
// array(0) {
// }
$xs[] = 1;
var_dump($xs);
// array(1) {
// [0]=>
// int(1)
// }
$xs[] = NULL;
var_dump($xs);
// array(2) {
// [0]=>
// int(1)
// [1]=>
// NULL
// }
var_dump(in_array("62399625c19f2", $xs));
// bool(false)
var_dump(in_array("62399625c19f2", [NULL]));
// bool(false)
from pfsense-zabbix-template.
I have downloaded this version :
https://raw.githubusercontent.com/rbicelli/pfsense-zabbix-template/master/pfsense_zbx.php
from pfsense-zabbix-template.
That is the correct url; I'm not sure how to reproduce the problem then unfortunately :(
Hopefully somebody else can help.
from pfsense-zabbix-template.
I am just a system admin that don't know how to code, and not sure what i am doing but hope this help
That pfsense_zbx.php work for me but I do need to make the change that LegsAJimbo sugguested on the fix
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) {
Also I need to make the change on openvpn for the status on the openvpn to work, thanks hvdhelm on that
// Value mappings
// Each value map is represented by an associative array
function pfz_valuemap($valuename, $value, $default="0"){
switch ($valuename){
case "openvpn.server.status":
$valuemap = array(
"down" => "0",
"up" => "1",
"connected (success)" => "1",
"none" => "2",
"reconnecting; ping-restart" => "3",
"waiting" => "4",
"server_user_listening" => "5");
break;
case "openvpn.client.status":
$valuemap = array(
"up" => "1",
"connected (success)" => "1",
"down" => "0",
"none" => "0",
"reconnecting; ping-restart" => "2");
break;
from pfsense-zabbix-template.
I had this same problem today, and just copied the raw code and replaced my existing content of the pfsense_zbx.php file and it fixed my problem.
Ignore the version comment at the top of the code in that file. I don't think it's been updated for a while. There was a change to the file a month ago, so not sure if that fixed this issue or not.
from pfsense-zabbix-template.
Related Issues (20)
- PHP Parse error: syntax error, unexpected '©' (T_STRING) in /root/scripts/pfsense_zbx.php on line 1384 HOT 1
- pfsense 2.7 error after upgrade HOT 2
- Pfsense 23.05.01 No Data from Interfaces HOT 4
- pfsense Active: Mounted filesystem discovery --> items already exist
- PFSense Active - Wrong PFsense State table on pfsense agent, Solved! HOT 1
- pfsense ver 23.05.1 doesn't work with speedtest cli HOT 1
- speedtest with option --source doesn`t work HOT 1
- High packet Loss on WAN_DHCP6? HOT 1
- Duplicate Triggers in Gateway Discovery Template HOT 6
- OpenSSLAsymmetricKey error HOT 2
- Monitoring Table Usage Count HOT 5
- 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
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.