rbicelli / pfsense-zabbix-template

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

IPsec Multiply Servers Issue #59

Closed dragoangel closed 3 years ago

dragoangel commented 3 years ago

Warning: array_key_exists() expects parameter 2 to be array, unknown given in /root/pfsense_zbx.php on line 810

if (array_key_exists($value, $valuemap))
          return $valuemap[$value];

Looks like valuemap is missing, in $value there is correctly displayed server IP.

rbicelli commented 3 years ago

In my testing machine I've only a single ipsec tunnel with a single phase 2. Please launch the script without arguments and post the result of IPsec status section, redacting the sensitive informations.

dragoangel commented 3 years ago

Hi, not sure how to send this, there 1k lines only about IPsec I tried to redact sensetive data but this going to total mess 😢

dragoangel commented 3 years ago

I will send you this at mail, hope it fine

rbicelli commented 3 years ago

Have you idea which value Zabbix is trying to fetch?

dragoangel commented 3 years ago

On new line after error it writes local IPsec peer IP, but this all, so not sure what it tries or not tries insert in valuemap.

rbicelli commented 3 years ago

Please try latest commit, I removed some checks that are not working due to handle mismatch in Ipsec Phase 2.

dragoangel commented 3 years ago

Now speaking same about 811 line, one note there was not mine, but remote ip*

rbicelli commented 3 years ago

Please try via pfsense cli: php pfsense_zbx.php ipsec_ph1 3 remote-gateway php pfsense_zbx.php ipsec_ph1 2 remote-gateway

Only way is to go in Zabbix Host, check item created by discovery, and call the correspondent php script one by one.

I committed another version of php script which checks for $valuemap variable. maybe you are using a different version of php.

FYI I think fixed your gateway problem, please check it out!

dragoangel commented 3 years ago

Thank you, I will check this tommorow and reply back.

pfsense which has multiple ipsec + multiple phases is on 2.5 developer branch. I will check what php version it use if it will help.

Issue with GW status is reproduce (on both stable and development pfsense), will try debug it tommorow.

rbicelli commented 3 years ago

I'm closing the issue since I did some improvements on IPsec side, most regarding 2.5.

dragoangel commented 3 years ago

Sorry, had another issue (not related to your pfsense template) for long time with zabbix so had not working monitoring and forget about this issue.