diff --git a/Template pfSense Active.xml b/Template pfSense Active.xml index 8fe9011..60c0f6f 100644 --- a/Template pfSense Active.xml +++ b/Template pfSense Active.xml @@ -1,7 +1,7 @@ 4.0 - 2020-03-27T07:54:22Z + 2020-03-27T09:02:11Z Templates @@ -3157,7 +3157,7 @@ Version 1.0.0 - Network traffic on $1 + Network traffic on {#IFNAME} 900 200 0.0000 @@ -3879,6 +3879,66 @@ Version 1.0.0 30d + + OpenVPN Server {#NAME} Clients Connected + 7 + + + pfsense.value[openvpn_servervalue,{#SERVER},conns] + 60s + 90d + 365d + 0 + 3 + + + + + 0 + 0 + + 0 + + + + 0 + + + + + + + 0 + + + OpenVPN Server + + + + + + + 3s + + + + 200 + 1 + 0 + + + 0 + 0 + 0 + 0 + + + + 0 + 0 + + + OpenVPN Server {#NAME} Mode 7 @@ -4055,11 +4115,11 @@ Version 1.0.0 5 (.*) -\1:up=1:down=0:none=2:reconnecting=3 +\1:up=1:down=0:none=2:reconnecting; ping-restart=3:waiting=4 5 - (up|down|none|reconnecting)(?=.*:\1=(\d)) + (up|down|none|reconnecting; ping-restart|waiting)(?=.*:\1=(\d)) \2 @@ -5889,6 +5949,10 @@ or 3 Reconnecting + + 4 + Waiting + diff --git a/pfsense_zbx.php b/pfsense_zbx.php index 7a55476..1a5ef18 100644 --- a/pfsense_zbx.php +++ b/pfsense_zbx.php @@ -149,6 +149,13 @@ function pfz_openvpn_servervalue($server_id,$valuekey){ if($server['vpnid']==$server_id) $value = $server[$valuekey]; } + + //Client Connections: isan array so it is sufficient to count elements + if ($valuekey=="conns"){ + $value=count($conns); + if ($value=="") $value="0"; + } + if ($value=="") $value="none"; echo $value; }