Fixed issues on openvpn service detection

This commit is contained in:
Riccardo Bicelli 2020-05-13 10:39:21 +02:00
parent 3758e762c1
commit e1a7179b45
2 changed files with 4 additions and 2 deletions

View File

@ -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.

View File

@ -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"]);