diff --git a/README.md b/README.md index 118c96e..a882af9 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ curl --create-dirs -o /root/scripts/pfsense_zbx.php https://raw.githubuserconten Then install package "Zabbix Agent 4" on your pfSense Box +Then install package "Zabbix Agent 5" (or "Zabbix Agent 4") on your pfSense Box In Advanced Features-> User Parameters @@ -104,7 +105,7 @@ For testing if speedtest is installed properly you can try it: Remember that you will need to install the package on *every* pfSense upgrade. -Speedtest template creates a cron job and checks for entry everytime Zabbix requests its items. If you want to uninstall the cron jobs simply run, from **Diagnostics/Command Prompt**: +Speedtest template creates a cron job and check for entry everytime Zabbix requests its items. If you want to uninstall the cron jobs simply run, from **Diagnostics/Command Prompt**: ```bash /url/local/bin/php /root/scripts/pfsense_zbx.php cron_cleanup @@ -112,4 +113,4 @@ Speedtest template creates a cron job and checks for entry everytime Zabbix requ ## Credits -[Keenton Zabbix Template](https://github.com/keentonsas/zabbix-template-pfsense) for Zabbix Agent freeBSD part. \ No newline at end of file +[Keenton Zabbix Template](https://github.com/keentonsas/zabbix-template-pfsense) for Zabbix Agent freeBSD part. diff --git a/pfsense_zbx.php b/pfsense_zbx.php index 1c6652f..a45d4ea 100644 --- a/pfsense_zbx.php +++ b/pfsense_zbx.php @@ -564,7 +564,6 @@ function pfz_ipsec_discovery_ph1(){ } - function pfz_ipsec_ph1($ikeid,$valuekey){ // Get Value from IPsec Phase 1 Configuration // If Getting "disabled" value only check item presence in config array @@ -665,13 +664,18 @@ function pfz_ipsec_status($ikeid,$reqid=-1,$valuekey='state'){ $a_phase1 = &$config['ipsec']['phase1']; $conmap = array(); foreach ($a_phase1 as $ph1ent) { - if (get_ipsecifnum($ph1ent['ikeid'], 0)) { - $cname = "con" . get_ipsecifnum($ph1ent['ikeid'], 0); - } else { - $cname = "con{$ph1ent['ikeid']}00000"; - } - $conmap[$cname] = $ph1ent['ikeid']; - } + if (function_exists('get_ipsecifnum')) { + if (get_ipsecifnum($ph1ent['ikeid'], 0)) { + $cname = "con" . get_ipsecifnum($ph1ent['ikeid'], 0); + } else { + $cname = "con{$ph1ent['ikeid']}00000"; + } + } else{ + $cname = ipsec_conid($ph1ent); + } + + $conmap[$cname] = $ph1ent['ikeid']; + } $status = ipsec_list_sa(); $ipsecconnected = array(); @@ -736,6 +740,42 @@ function pfz_ipsec_status($ikeid,$reqid=-1,$valuekey='state'){ return $value; } +// Temperature sensors Discovery +function pfz_temperature_sensors_discovery(){ + + + $json_string = '{"data":['; + $sensors = []; + exec("sysctl -a | grep temperature | cut -d ':' -f 1", $sensors, $code); + if ($code != 0) { + echo ""; + return; + } else { + foreach ($sensors as $sensor) { + $json_string .= '{"{#SENSORID}":"' . $sensor . '"'; + $json_string .= '},'; + } + } + + $json_string = rtrim($json_string,","); + $json_string .= "]}"; + + echo $json_string; + +} + +// Temperature sensor get value +function pfz_get_temperature($sensorid){ + + exec("sysctl '$sensorid' | cut -d ':' -f 2", $value, $code); + if ($code != 0 or count($value)!=1) { + echo ""; + return; + } else { + echo trim($value[0]); + } + +} function pfz_carp_status($echo = true){ @@ -1069,6 +1109,29 @@ function pfz_get_smart_status(){ echo $status; } +// Certificats validity date +function pfz_get_cert_date($valuekey){ + global $config; + + $value = 0; + foreach (array("cert", "ca") as $cert_type) { + switch ($valuekey){ + case "validFrom.max": + foreach ($config[$cert_type] as $cert) { + $certinfo = openssl_x509_parse(base64_decode($cert[crt])); + if ($value == 0 or $value < $certinfo['validFrom_time_t']) $value = $certinfo['validFrom_time_t']; + } + break; + case "validTo.min": + foreach ($config[$cert_type] as $cert) { + $certinfo = openssl_x509_parse(base64_decode($cert[crt])); + if ($value == 0 or $value > $certinfo['validTo_time_t']) $value = $certinfo['validTo_time_t']; + } + break; + } + } + echo $value; +} // File is present function pfz_file_exists($filename) { @@ -1205,6 +1268,9 @@ function pfz_discovery($section){ case "dhcpfailover": pfz_dhcpfailover_discovery(); break; + case "temperature_sensors": + pfz_temperature_sensors_discovery(); + break; } } @@ -1269,6 +1335,12 @@ switch (strtolower($argv[1])){ case "smart_status": pfz_get_smart_status(); break; + case "cert_date": + pfz_get_cert_date($argv[2]); + break; + case "temperature": + pfz_get_temperature($argv[2]); + break; default: pfz_test(); } diff --git a/template_pfsense_active.xml b/template_pfsense_active.xml index 00f0c47..9a8d79e 100644 --- a/template_pfsense_active.xml +++ b/template_pfsense_active.xml @@ -21,6 +21,9 @@ https://github.com/rbicelli/pfsense-zabbix-template + + Certificate Manager + CPU @@ -37,7 +40,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Memory - Network interfaces + Network Interfaces Network Limits @@ -66,8 +69,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Maximum number of opened files ZABBIX_ACTIVE kernel.maxfiles - 3600 - 27d + 1h It could be increased by using sysctrl utility or modifying file /etc/sysctl.conf. @@ -86,8 +88,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Maximum number of processes ZABBIX_ACTIVE kernel.maxproc - 3600 - 27d + 1h It could be increased by using sysctrl utility or modifying file /etc/sysctl.conf. @@ -106,8 +107,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Used memory (calc) CALCULATED kt.mem.used - 60 - 28d B last(vm.memory.size[total]) - last(vm.memory.size[available]) @@ -136,8 +135,6 @@ https://github.com/rbicelli/pfsense-zabbix-template MBUF Cache ZABBIX_ACTIVE pfsense.mbuf.cache - 60 - 27d Network Limits @@ -148,8 +145,6 @@ https://github.com/rbicelli/pfsense-zabbix-template MBUF Current ZABBIX_ACTIVE pfsense.mbuf.current - 60 - 27d Network Limits @@ -160,8 +155,7 @@ https://github.com/rbicelli/pfsense-zabbix-template MBUF Max ZABBIX_ACTIVE pfsense.mbuf.max - 600 - 27d + 10m Network Limits @@ -172,8 +166,6 @@ https://github.com/rbicelli/pfsense-zabbix-template MBUF Total Used (percent) CALCULATED pfsense.mbuf.ptotal - 60 - 28d FLOAT % ((last(pfsense.mbuf.current) + last(pfsense.mbuf.cache)) * 100) / last(pfsense.mbuf.max) @@ -199,8 +191,6 @@ https://github.com/rbicelli/pfsense-zabbix-template States Table Current ZABBIX_ACTIVE pfsense.states.current - 60 - 27d Network Limits @@ -211,8 +201,7 @@ https://github.com/rbicelli/pfsense-zabbix-template States Table Max ZABBIX_ACTIVE pfsense.states.max - 600 - 27d + 10m Network Limits @@ -223,8 +212,6 @@ https://github.com/rbicelli/pfsense-zabbix-template States Table Current (percent) CALCULATED pfsense.states.pused - 60 - 28d FLOAT % (last(pfsense.states.current) * 100) / last(pfsense.states.max) @@ -263,7 +250,7 @@ https://github.com/rbicelli/pfsense-zabbix-template {last()}>2 - CARP Problems on {HOST.NAME} + CARP Problems on {HOST.NAME} HIGH CARP Problems @@ -276,11 +263,92 @@ https://github.com/rbicelli/pfsense-zabbix-template + + Certificates Manager: latest "validFrom" + ZABBIX_ACTIVE + pfsense.value[cert_date,validFrom.max] + unixtime + This item will return will return the latest date "validFrom" from all the certificates (including CA). This is used to find new/renewed certificates. + + + Certificate Manager + + + + + DISCARD_UNCHANGED_HEARTBEAT + 1d + + + + + ({now()}-{last()})<1d + One or more certificates have been renewed in the past 24h + Latest "Valid From": {ITEM.LASTVALUE1} + INFO + YES + + + + + Certificates Manager: earliest "validTo" + ZABBIX_ACTIVE + pfsense.value[cert_date,validTo.min] + unixtime + This item will return will return the earliest date "validTo" from all the certificates (including CA). This is used to find expiring certificates. + + + Certificate Manager + + + + + DISCARD_UNCHANGED_HEARTBEAT + 1d + + + + + {last()}<{now()} + One or more certificates are expired + Earliest "Valid To": {ITEM.LASTVALUE1} + HIGH + + + ({last()}-{now()})<{$PFSENSE_CERT_EXPIRATION.AVERAGE} + One or more certificates are expiring less than {$PFSENSE_CERT_EXPIRATION.AVERAGE} + Earliest "Valid To": {ITEM.LASTVALUE1} + AVERAGE + + + One or more certificates are expired + {Template pfSense Active:pfsense.value[cert_date,validTo.min].last()}<{Template pfSense Active:pfsense.value[cert_date,validTo.min].now()} + + + + + ({last()}-{now()})<{$PFSENSE_CERT_EXPIRATION.WARN} + One or more certificates are expiring less than {$PFSENSE_CERT_EXPIRATION.WARN} + Earliest "Valid To": {ITEM.LASTVALUE1} + WARNING + + + One or more certificates are expired + {Template pfSense Active:pfsense.value[cert_date,validTo.min].last()}<{Template pfSense Active:pfsense.value[cert_date,validTo.min].now()} + + + One or more certificates are expiring less than {$PFSENSE_CERT_EXPIRATION.AVERAGE} + ({Template pfSense Active:pfsense.value[cert_date,validTo.min].last()}-{Template pfSense Active:pfsense.value[cert_date,validTo.min].now()})<{$PFSENSE_CERT_EXPIRATION.AVERAGE} + + + + + DHCP Failover Pool Problems ZABBIX_ACTIVE pfsense.value[dhcp,failover] - 120s + 2m This value indicates, in a HA scenario, if DHCP failover pool partners are out of sync. @@ -292,7 +360,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Gateway Status Raw ZABBIX_ACTIVE pfsense.value[gw_status] - 60s 0 TEXT Gateway Status Raw @@ -317,7 +384,7 @@ https://github.com/rbicelli/pfsense-zabbix-template SMART Status ZABBIX_ACTIVE pfsense.value[smart_status] - 1800s + 30m pfSense SMART Status @@ -387,6 +454,7 @@ https://github.com/rbicelli/pfsense-zabbix-template {last()}>0 Packages Update Available on {HOST.NAME} + {ITEM.LASTVALUE} INFO New version of packages are available @@ -409,8 +477,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Number of running processes ZABBIX_ACTIVE proc.num[,,run] - 60 - 27d Number of processes in running state. @@ -429,8 +495,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Number of processes ZABBIX_ACTIVE proc.num[] - 60 - 27d Total number of processes in any state. @@ -449,8 +513,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Host boot time ZABBIX_ACTIVE system.boottime - 600 - 27d + 10m unixtime @@ -462,8 +525,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Interrupts per second ZABBIX_ACTIVE system.cpu.intr - 60 - 27d ips @@ -481,8 +542,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Processor load (1min/core) ZABBIX_ACTIVE system.cpu.load[percpu,avg1] - 60 - 27d FLOAT The processor load is calculated as system CPU load divided by number of CPU cores. @@ -502,8 +561,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Processor load (5min/core) ZABBIX_ACTIVE system.cpu.load[percpu,avg5] - 60 - 27d FLOAT The processor load is calculated as system CPU load divided by number of CPU cores. @@ -516,8 +573,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Processor load (15min/core) ZABBIX_ACTIVE system.cpu.load[percpu,avg15] - 60 - 27d FLOAT The processor load is calculated as system CPU load divided by number of CPU cores. @@ -530,8 +585,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Context switches per second ZABBIX_ACTIVE system.cpu.switches - 60 - 27d sps @@ -549,8 +602,6 @@ https://github.com/rbicelli/pfsense-zabbix-template CPU $2 time ZABBIX_ACTIVE system.cpu.util[,idle] - 60 - 27d FLOAT % The time the CPU has spent doing nothing. @@ -564,8 +615,6 @@ https://github.com/rbicelli/pfsense-zabbix-template CPU $2 time ZABBIX_ACTIVE system.cpu.util[,interrupt] - 60 - 27d FLOAT % The amount of time the CPU has been servicing hardware interrupts. @@ -579,8 +628,6 @@ https://github.com/rbicelli/pfsense-zabbix-template CPU $2 time ZABBIX_ACTIVE system.cpu.util[,nice] - 60 - 27d FLOAT % The time the CPU has spent running users' processes that have been niced. @@ -594,8 +641,6 @@ https://github.com/rbicelli/pfsense-zabbix-template CPU $2 time ZABBIX_ACTIVE system.cpu.util[,system] - 60 - 27d FLOAT % The time the CPU has spent running the kernel and its processes. @@ -609,8 +654,6 @@ https://github.com/rbicelli/pfsense-zabbix-template CPU $2 time ZABBIX_ACTIVE system.cpu.util[,user] - 60 - 27d FLOAT % The time the CPU has spent running users' processes that are not niced. @@ -624,8 +667,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Host name ZABBIX_ACTIVE system.hostname - 3600 - 27d + 1h 0 CHAR System host name. @@ -647,8 +689,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Host local time ZABBIX_ACTIVE system.localtime - 60 - 27d unixtime @@ -660,8 +700,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Free swap space ZABBIX_ACTIVE system.swap.size[,free] - 60 - 27d B @@ -673,8 +711,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Free swap space in % ZABBIX_ACTIVE system.swap.size[,pfree] - 60 - 27d FLOAT % @@ -695,8 +731,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Total swap space ZABBIX_ACTIVE system.swap.size[,total] - 3600 - 27d + 1h B @@ -708,8 +743,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Used swap space ZABBIX_ACTIVE system.swap.size[,used] - 60 - 27d B @@ -721,8 +754,7 @@ https://github.com/rbicelli/pfsense-zabbix-template System information ZABBIX_ACTIVE system.uname - 3600 - 27d + 1h 0 CHAR The information as normally returned by 'uname -a'. @@ -744,8 +776,7 @@ https://github.com/rbicelli/pfsense-zabbix-template System uptime ZABBIX_ACTIVE system.uptime - 600 - 27d + 10m uptime @@ -764,8 +795,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Number of logged in users ZABBIX_ACTIVE system.users.num - 60 - 27d Number of users who are currently logged in. @@ -777,8 +806,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Checksum of $1 ZABBIX_ACTIVE vfs.file.cksum[/etc/passwd] - 3600 - 27d + 1h OS @@ -796,8 +824,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Active memory ZABBIX_ACTIVE vm.memory.size[active] - 60 - 28d B Memory used by processes @@ -810,8 +836,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Available memory ZABBIX_ACTIVE vm.memory.size[available] - 60 - 27d B Available memory is defined as free+cached+buffers memory. @@ -831,8 +855,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Buffered memory ZABBIX_ACTIVE vm.memory.size[buffers] - 60 - 28d DISABLED B Cache d'entrées des IO disque. @@ -848,8 +870,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Cached memory ZABBIX_ACTIVE vm.memory.size[cached] - 60 - 28d B amount of memory used to cache data @@ -862,8 +882,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Free memory ZABBIX_ACTIVE vm.memory.size[free] - 60 - 28d B amount of memory completely free and ready to be used directly. @@ -876,8 +894,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Inactive memory ZABBIX_ACTIVE vm.memory.size[inactive] - 60 - 28d B amount of memory that contains data that is no longer used (can be directly freed if needed) @@ -890,8 +906,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Available memory (percent) ZABBIX_ACTIVE vm.memory.size[pavailable] - 60 - 28d FLOAT % Available memory is defined as free+cached+buffers memory. @@ -911,8 +925,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Shared memory ZABBIX_ACTIVE vm.memory.size[shared] - 60 - 28d DISABLED B quantité de mémoire partagée entre plusieurs processus @@ -928,8 +940,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Total memory ZABBIX_ACTIVE vm.memory.size[total] - 3600 - 27d + 1h B quantité de mémoire totale @@ -942,8 +953,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Used memory ZABBIX_ACTIVE vm.memory.size[used] - 60 - 28d DISABLED B Item désactivé car non utilisé @@ -957,8 +966,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Wired memory ZABBIX_ACTIVE vm.memory.size[wired] - 60 - 28d B amount of memory used by the kernel, can neither be unloaded in swap, nor compressed. @@ -973,7 +980,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Gateways Discovery ZABBIX_ACTIVE pfsense.discovery[gw] - 300s + 5m Gateway Discovery @@ -1125,7 +1132,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Network interface discovery ZABBIX_ACTIVE pfsense.discovery[interfaces] - 3600s + 1h @@ -1142,11 +1149,10 @@ https://github.com/rbicelli/pfsense-zabbix-template Incoming Errors on {#IFDESCR} ZABBIX_ACTIVE net.if.in[{#IFNAME},errors] - 60 7d - Network interfaces + Network Interfaces @@ -1154,12 +1160,11 @@ https://github.com/rbicelli/pfsense-zabbix-template Incoming network traffic on {#IFDESCR} ZABBIX_ACTIVE net.if.in[{#IFNAME}] - 60 7d bps - Network interfaces + Network Interfaces @@ -1177,11 +1182,10 @@ https://github.com/rbicelli/pfsense-zabbix-template Outgoing errors on {#IFDESCR} ZABBIX_ACTIVE net.if.out[{#IFNAME},errors] - 60 7d - Network interfaces + Network Interfaces @@ -1189,12 +1193,11 @@ https://github.com/rbicelli/pfsense-zabbix-template Outgoing network traffic on {#IFDESCR} ZABBIX_ACTIVE net.if.out[{#IFNAME}] - 60 7d bps - Network interfaces + Network Interfaces @@ -1241,14 +1244,13 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Client Discovery ZABBIX_ACTIVE pfsense.discovery[openvpn_client] - 300s + 5m OpenVPN Client Discovery OpenVPN Client {#NAME} Tunnel Status ZABBIX_ACTIVE pfsense.value[openvpn_clientvalue,{#CLIENT},status] - 60s OpenVPN Client @@ -1272,13 +1274,12 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server Discovery ZABBIX_ACTIVE pfsense.discovery[openvpn_server] - 300s + 5m OpenVPN Server {#NAME} Clients Connected ZABBIX_ACTIVE pfsense.value[openvpn_servervalue,{#SERVER},conns] - 60s OpenVPN Server @@ -1289,7 +1290,7 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#NAME} Mode ZABBIX_ACTIVE pfsense.value[openvpn_servervalue,{#SERVER},mode] - 300s + 5m OpenVPN Server @@ -1303,7 +1304,7 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#NAME} Port ZABBIX_ACTIVE pfsense.value[openvpn_servervalue,{#SERVER},port] - 300s + 5m OpenVPN Server @@ -1314,8 +1315,7 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#NAME} Tunnel Status ZABBIX_ACTIVE pfsense.value[openvpn_servervalue,{#SERVER},status] - 60s - + OpenVPN Server @@ -1338,22 +1338,13 @@ https://github.com/rbicelli/pfsense-zabbix-template Services Discovery ZABBIX_ACTIVE pfsense.discovery[services] - 300s - - - - {#SERVICE} - @pfSense service names for discovery - A - - - + 5m - Service {#DESCRIPTION} enabled on CARP Slave + Service {#DESCRIPTION} enabled on CARP Slave ZABBIX_ACTIVE pfsense.value[service_value,{#SERVICE},run_on_carp_slave] - 600s + 10m Services @@ -1367,7 +1358,6 @@ https://github.com/rbicelli/pfsense-zabbix-template Service {#DESCRIPTION} Status ZABBIX_ACTIVE pfsense.value[service_value,{#SERVICE},status] - 60s Services @@ -1380,7 +1370,8 @@ https://github.com/rbicelli/pfsense-zabbix-template - {Template pfSense Active:pfsense.value[service_value,{#SERVICE},status].last()}=0 and ( + {Template pfSense Active:pfsense.value[service_value,{#SERVICE},status].last()}=0 +and {$PFSENSE_SRVC_MONITORING:"{#SERVICE}"}=1 and ( ({Template pfSense Active:pfsense.value[service_value,{#SERVICE},run_on_carp_slave].last()}=1 and {Template pfSense Active:pfsense.value[carp_status].last()}=2) @@ -1395,7 +1386,26 @@ or ) Service {#DESCRIPTION} is not running HIGH - Service is not running + Service is not running + +If you want to skip the trigger for this service, add the macro $PFSENSE_SRVC_MONITORING:"{#SERVICE}"=0 + +0 = Service monitoring disabled +1 = Service monitoring check if running +2 = Service monitoring check if not running + + + {Template pfSense Active:pfsense.value[service_value,{#SERVICE},status].last()}=1 and {$PFSENSE_SRVC_MONITORING:"{#SERVICE}"}=2 and (({Template pfSense Active:pfsense.value[service_value,{#SERVICE},run_on_carp_slave].last()}=1 and {Template pfSense Active:pfsense.value[carp_status].last()}=2) or {Template pfSense Active:pfsense.value[carp_status].last()}=1 or {Template pfSense Active:pfsense.value[carp_status].last()}=0) + Service {#DESCRIPTION} is running + HIGH + Service is running + +If you want to skip the trigger for this service, remove the macro $PFSENSE_SRVC_MONITORING:"{#SERVICE}"=2 +Alternatively you can also set the macro to 1 or 0. + +0 = Service monitoring disabled +1 = Service monitoring check if running +2 = Service monitoring check if not running @@ -1403,7 +1413,7 @@ or Mounted filesystem discovery ZABBIX_ACTIVE vfs.fs.discovery - 3600 + 1h @@ -1420,7 +1430,6 @@ or Free inodes on $1 (percentage) ZABBIX_ACTIVE vfs.fs.inode[{#FSNAME},pfree] - 60 7d FLOAT % @@ -1441,7 +1450,6 @@ or Free disk space on $1 ZABBIX_ACTIVE vfs.fs.size[{#FSNAME},free] - 60 7d B @@ -1454,7 +1462,6 @@ or Free disk space on $1 (percentage) ZABBIX_ACTIVE vfs.fs.size[{#FSNAME},pfree] - 60 7d FLOAT % @@ -1475,7 +1482,7 @@ or Total disk space on $1 ZABBIX_ACTIVE vfs.fs.size[{#FSNAME},total] - 3600 + 1h 7d B @@ -1488,7 +1495,6 @@ or Used disk space on $1 ZABBIX_ACTIVE vfs.fs.size[{#FSNAME},used] - 60 7d B @@ -1555,6 +1561,29 @@ or {$EXPECTED_CARP_STATUS} 0 + + {$PFSENSE_CERT_EXPIRATION.AVERAGE} + 48h + + + {$PFSENSE_CERT_EXPIRATION.WARN} + 10d + + + {$PFSENSE_SRVC_MONITORING} + 1 + Enable monitoring of Services + + + {$PFSENSE_SRVC_MONITORING:"iperf"} + 0 + Disable monitoring of Service iperf Network Performance Testing Daemon/Client + + + {$PFSENSE_SRVC_MONITORING:"pcscd"} + 2 + Enable monitoring of PC/SC Smart Card Daemon (check if NOT running) https://redmine.pfsense.org/issues/12095 + @@ -1666,7 +1695,7 @@ or ({Template pfSense Active:pfsense.value[system,version].last()}<>{Template pfSense Active:pfsense.value[system,installed_version].last()})=1 New Version Available on {HOST.NAME} INFO - Noify of new version of pfsense available + Notify of new version of pfsense available diff --git a/template_pfsense_active_ipsec.xml b/template_pfsense_active_ipsec.xml index 094d9da..ae17b1b 100644 --- a/template_pfsense_active_ipsec.xml +++ b/template_pfsense_active_ipsec.xml @@ -33,14 +33,14 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Phase 1 Discovery ZABBIX_ACTIVE pfsense.discovery[ipsec_ph1] - 1200s + 20m Discovery of IPsec Phase 1 IPsec Tunnel {#IKEID} {#NAME} Tunnel Enabled ZABBIX_ACTIVE pfsense.value[ipsec_ph1,{#IKEID},disabled] - 120s + 2m IPsec Phase 1 Tunnel Mode @@ -55,7 +55,7 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID} {#NAME} IKE Type ZABBIX_ACTIVE pfsense.value[ipsec_ph1,{#IKEID},iketype] - 600s + 10m IPsec Phase 1 IKE Type @@ -70,7 +70,7 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID} {#NAME} Tunnel Mode ZABBIX_ACTIVE pfsense.value[ipsec_ph1,{#IKEID},mode] - 600s + 10m IPsec Phase 1 Tunnel Mode @@ -85,7 +85,7 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID} {#NAME} Protocol ZABBIX_ACTIVE pfsense.value[ipsec_ph1,{#IKEID},protocol] - 600s + 10m IPsec Phase 1 Protocol @@ -100,7 +100,7 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID} {#NAME} Remote Gateway ZABBIX_ACTIVE pfsense.value[ipsec_ph1,{#IKEID},remote-gateway] - 600s + 10m 0 TEXT IPsec Phase 1 Remote Gateway @@ -114,7 +114,6 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID} {#NAME} Phase 1 Status ZABBIX_ACTIVE pfsense.value[ipsec_ph1,{#IKEID},status] - 60s IPsec Phase 1 Tunnel Mode @@ -139,14 +138,14 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Phase 2 Discovery ZABBIX_ACTIVE pfsense.discovery[ipsec_ph2] - 1200s + 20m Discovery of IPsec Phase 2 IPsec Tunnel {#IKEID}.{#REQID} {#NAME} Phase 2 Enabled ZABBIX_ACTIVE pfsense.value[ipsec_ph2,{#UNIQID},disabled] - 120s + 2m IPsec Tunnel Phase 2 Protocol @@ -161,7 +160,7 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID}.{#REQID} {#NAME} Phase 2 Life Time ZABBIX_ACTIVE pfsense.value[ipsec_ph2,{#UNIQID},lifetime] - 600s + 10m s IPsec Tunnel Phase 2 Life Time @@ -174,7 +173,7 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID}.{#REQID} {#NAME} Phase 2 Mode ZABBIX_ACTIVE pfsense.value[ipsec_ph2,{#UNIQID},mode] - 600s + 10m IPsec Tunnel Phase 2 Mode @@ -186,7 +185,7 @@ https://github.com/rbicelli/pfsense-zabbix-template IPsec Tunnel {#IKEID}.{#REQID} {#NAME} Phase 2 Protocol ZABBIX_ACTIVE pfsense.value[ipsec_ph2,{#UNIQID},protocol] - 600s + 10m IPsec Tunnel Phase 2 Protocol diff --git a/template_pfsense_active_ovpn_user.xml b/template_pfsense_active_ovpn_user.xml index cc07a0f..70dd7eb 100644 --- a/template_pfsense_active_ovpn_user.xml +++ b/template_pfsense_active_ovpn_user.xml @@ -33,14 +33,12 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN User Auth Connected Clients Discovery ZABBIX_ACTIVE pfsense.discovery[openvpn_server_user] - 60s Discovery of clients connected to OpenVPN Server in User Auth Mode OpenVPN Server {#SERVERNAME}, Client {#USERID}: Bytes Received ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue,{#UNIQUEID},bytes_recv] - 60s 0 bytes Client Bytes Received @@ -54,7 +52,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: Bytes Sent ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue,{#UNIQUEID},bytes_sent] - 60s 0 bytes Client Bytes Sent @@ -68,7 +65,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: Connection Time ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue,{#UNIQUEID},connect_time_unix] - 60s 0 unixtime Client Connect Time @@ -82,7 +78,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: Remote Host ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue,{#UNIQUEID},remote_host] - 60s 0 TEXT Remote Host @@ -96,7 +91,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: User Name ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue,{#UNIQUEID},user_name] - 60s 0 TEXT Client User Name @@ -110,7 +104,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: Virtual IP Address (IPv6) ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue,{#UNIQUEID},virtual_addr6] - 60s 0 TEXT IPv6 Address assigned from OpenVPN Server @@ -124,7 +117,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: Virtual IP Address ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue,{#UNIQUEID},virtual_addr] - 60s 0 TEXT IP Address assigned from OpenVPN Server @@ -138,7 +130,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: Client ID ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue_numeric,{#UNIQUEID},client_id] - 60s 0 Client ID @@ -151,7 +142,6 @@ https://github.com/rbicelli/pfsense-zabbix-template OpenVPN Server {#SERVERNAME}, Client {#USERID}: Peer ID ZABBIX_ACTIVE pfsense.value[openvpn_server_uservalue_numeric,{#UNIQUEID},peer_id] - 60s 0 Peer ID diff --git a/template_pfsense_active_speedtest.xml b/template_pfsense_active_speedtest.xml index 45fb366..ae135c2 100644 --- a/template_pfsense_active_speedtest.xml +++ b/template_pfsense_active_speedtest.xml @@ -33,14 +33,14 @@ https://github.com/rbicelli/pfsense-zabbix-template WAN Interfaces ZABBIX_ACTIVE pfsense.discovery[wan] - 300s + 6h Discover WAN Interfaces Speedtest Download on {#IFDESCR} ZABBIX_ACTIVE pfsense.value[if_speedtest_value,{#IFNAME},download] - 3600s + 30m FLOAT bps Download speed determined by Ookla Speedtest package @@ -54,7 +54,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Speedtest Ping on {#IFDESCR} ZABBIX_ACTIVE pfsense.value[if_speedtest_value,{#IFNAME},ping] - 3600s + 30m FLOAT ms Ping determined by Ookla Speedtest package @@ -68,7 +68,7 @@ https://github.com/rbicelli/pfsense-zabbix-template Speedtest Upload on {#IFDESCR} ZABBIX_ACTIVE pfsense.value[if_speedtest_value,{#IFNAME},upload] - 3600s + 30m FLOAT bps Ping determined by Ookla Speedtest package diff --git a/zabbix6/template_pfsense_active.xml b/zabbix6/template_pfsense_active.xml new file mode 100644 index 0000000..750958a --- /dev/null +++ b/zabbix6/template_pfsense_active.xml @@ -0,0 +1,2493 @@ + + + 6.0 + 2022-04-22T10:24:33Z + + + 4918b88734c54bd094cff7585b5d71fc + Templates/Network Devices + + + + + + + + ba26b37d090c439faf2ed71f0e8b2be3 + last(/Template pfSense Active/pfsense.expected_carp_status)<>0 and last(/Template pfSense Active/pfsense.value[carp_status])<>{$EXPECTED_CARP_STATUS} + CARP Status not Expected on {HOST.NAME} + HIGH + pfSense CARP is not in the state Expected. This means that a failover could be in process. + + + 23b24281dd5d47c58be38ecb2333b8de + (last(/Template pfSense Active/pfsense.value[system,version])<>last(/Template pfSense Active/pfsense.value[system,installed_version]))=1 + New Version Available on {HOST.NAME} + INFO + Notify of new version of pfsense available + + + + + 499d867c58974a8e914b0423bdbf3d01 + Active Connections + NO + FIXED + ITEM + + Template pfSense Active + pfsense.states.max + + + + GRADIENT_LINE + FF2C27 + + Template pfSense Active + pfsense.states.current + + + + + + 6cd23b5084844a2481beb5c34f1e603a + Active Connections (pie) + 600 + 340 + 0 + NO + NO + PIE + + + 5B5B5B + GRAPH_SUM + + Template pfSense Active + pfsense.states.max + + + + 1 + GRADIENT_LINE + FF2C27 + + Template pfSense Active + pfsense.states.current + + + + + + 15db8adacf6e4b35ba5a6b36b2ddef1f + CPU jumps + + + GRADIENT_LINE + 009900 + + Template pfSense Active + system.cpu.switches + + + + 1 + GRADIENT_LINE + 000099 + + Template pfSense Active + system.cpu.intr + + + + + + c515614caf3445e6b28858907b1d1713 + CPU load + STACKED + FIXED + + + FFA619 + + Template pfSense Active + system.cpu.load[percpu,avg1] + + + + 1 + E86E30 + + Template pfSense Active + system.cpu.load[percpu,avg5] + + + + 2 + FF2F26 + + Template pfSense Active + system.cpu.load[percpu,avg15] + + + + + + aa694daef9004553952ec7cf3fa153b1 + CPU utilization (Line) + NO + FIXED + FIXED + + + GRADIENT_LINE + FFE819 + + Template pfSense Active + system.cpu.util[,interrupt] + + + + 1 + GRADIENT_LINE + E85D17 + + Template pfSense Active + system.cpu.util[,nice] + + + + 2 + GRADIENT_LINE + DF26FF + + Template pfSense Active + system.cpu.util[,system] + + + + 3 + GRADIENT_LINE + 1775E8 + + Template pfSense Active + system.cpu.util[,user] + + + + 4 + 03D933 + + Template pfSense Active + system.cpu.util[,idle] + + + + + + 61378e27951a4882b1f88d041922ad16 + Memory Available details (pie) + 600 + 340 + 0 + NO + NO + PIE + + + 003300 + GRAPH_SUM + + Template pfSense Active + vm.memory.size[available] + + + + 1 + 005500 + + Template pfSense Active + vm.memory.size[free] + + + + 2 + 007700 + + Template pfSense Active + vm.memory.size[cached] + + + + 3 + 009900 + + Template pfSense Active + vm.memory.size[inactive] + + + + + + 625d8fc33a5d410ab2229dd2e8e99762 + Memory usage + NO + STACKED + FIXED + ITEM + + Template pfSense Active + vm.memory.size[total] + + + + 00EE00 + + Template pfSense Active + vm.memory.size[wired] + + + + 1 + 00CC00 + + Template pfSense Active + vm.memory.size[active] + + + + 2 + 007700 + + Template pfSense Active + vm.memory.size[inactive] + + + + 3 + 005500 + + Template pfSense Active + vm.memory.size[cached] + + + + 4 + 003300 + + Template pfSense Active + vm.memory.size[free] + + + + + + eeb86545b71145949b241b7d89b3a79b + Memory Usage simple (pie) + 600 + 340 + 0 + NO + NO + PIE + + + 003300 + + Template pfSense Active + vm.memory.size[available] + + + + 1 + 00DD00 + + Template pfSense Active + kt.mem.used + + + + + + ab954e447cb14b10bb902e7c43a6d31a + Network Memory Buffer + NO + STACKED + FIXED + ITEM + + Template pfSense Active + pfsense.mbuf.max + + + + B26E16 + + Template pfSense Active + pfsense.mbuf.current + + + + 1 + FFCE8E + + Template pfSense Active + pfsense.mbuf.cache + + + + + + eab355b1ef2f450a938441c913b7631a + Network Memory Buffer (pie) + 600 + 340 + 0 + NO + NO + PIE + + + 5B5B5B + GRAPH_SUM + + Template pfSense Active + pfsense.mbuf.max + + + + 1 + FFCE8E + + Template pfSense Active + pfsense.mbuf.cache + + + + 2 + B26E16 + + Template pfSense Active + pfsense.mbuf.current + + + + + + 9522838e31244b6e88a9a020bdd07602 + Swap usage + 600 + 340 + 0 + NO + NO + PIE + YES + + + 5B5B5B + GRAPH_SUM + + Template pfSense Active + system.swap.size[,total] + + + + 1 + FFFF33 + + Template pfSense Active + system.swap.size[,used] + + + + + +