rbicelli / pfsense-zabbix-template

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

Add UnsafeUserParameters to how to #60

Closed Flawioo closed 3 years ago

Flawioo commented 3 years ago

Hi, I had some problems to get some data about openvpn clients from pfsense box because the default zabbix agent conf didn't permit the use of special characters like my error log below:

69979:20210121:111322.537 active check "pfsense.value[openvpn_server_uservalue_numeric,"2+[error]",peer_id]" is not supported: Special characters "\, ', ", `, *, ?, [, ], {, }, ~, $, !, &, ;, (, ), <, >, |, #, @, 0x0a" are not allowed in the parameters.

image

To correct this issue I just have added the parameter in the config file and the collections were done partially ok.

UnsafeUserParameters=1

image

Some errors still persists because this box I've referred is a backup node from a pfsense carp cluster and just have a openvpn running on the master node. It is acceptable.

image

No more errors were found in the log file as below:

image

rbicelli commented 3 years ago

Are you using the latest commit? Please check Issue #58, I added a special char replacement for openvpn clients.

Flawioo commented 3 years ago

Yes, I'm using the last one. I've also searched the issues about this but I think my word weren't the correct to this issue. No problem, I just wanted to help someone with the same issue or you if you had hadn't saw before.

rbicelli commented 3 years ago

Sorry did read too fast your post!

Regarding unsafe parameters, you don't need to set UnsafeUserParameters=1. Latest version of PHP Script should do the special chars replacement transparently. You only have to update the php script and wait discovery to run. You will see new items appearing and old items becoming deprecated.

As for OpenVPN, in my CARP setup I tend to put OpenVPN listening on localhost, then NAT fromone or more CARP VIPs. In this case the service stays up on both nodes and you shouldn't have problems with missing values.