From e1a7179b45d4b2748667163bf7bd57a8144518ad Mon Sep 17 00:00:00 2001 From: Riccardo Bicelli Date: Wed, 13 May 2020 10:39:21 +0200 Subject: [PATCH] Fixed issues on openvpn service detection --- README.md | 2 ++ pfsense_zbx.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 55ad35f..1c7d2ab 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ UserParameter=pfsense.value[*],/usr/local/bin/php /root/scripts/pfsense_zbx.php _Please note that **AllowRoot=1** option is required in order to execute correctly OpenVPN checks and others._ +Also increase the **Timeout** value at least to **5**, otherwise some checks will fail. + Then import xml templates in Zabbix and add your pfSense hosts. If you are running a redundant CARP setup you should adjust the macro {#EXPECTED_CARP_STATUS} to a value representing what is CARP expected status on monitored box. diff --git a/pfsense_zbx.php b/pfsense_zbx.php index 5b8f0f9..afdc73c 100644 --- a/pfsense_zbx.php +++ b/pfsense_zbx.php @@ -131,7 +131,7 @@ function pfz_openvpn_servervalue($server_id,$valuekey){ if($server['vpnid']==$server_id){ $value = $server[$valuekey]; if ($valuekey=="status") { - if ( ($server['mode']=="server_user") || ($server['mode']=="server_tls_user") ){ + if ( ($server['mode']=="server_user") || ($server['mode']=="server_tls_user") || ($server['mode']=="server_tls") ){ if ($value=="") $value="server_user_listening"; } } @@ -289,7 +289,7 @@ function pfz_service_value($name,$value){ //List of service which are stopped on CARP Slave. //For now this is the best way i found for filtering out the triggers //Waiting for a way in Zabbix to use Global Regexp in triggers with items discovery - $stopped_on_carp_slave = array("haproxy","openvpn."); + $stopped_on_carp_slave = array("haproxy","openvpn.","openvpn"); foreach ($services as $service){ $namecfr=str_replace("__"," ",$service["name"]);