Additional scripts for Zabbix agent on Linux to discover and monitor several services
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1563 lines
69 KiB

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>5.0</version>
<date>2021-06-19T12:17:25Z</date>
<groups>
<group>
<name>Modèles</name>
</group>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Template_OS_PfSense2</template>
<name>Template_OS_PfSense2</name>
<templates>
<template>
<name>Template_Ping</name>
</template>
</templates>
<groups>
<group>
<name>Modèles</name>
</group>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>Disks</name>
</application>
<application>
<name>Integrity</name>
</application>
<application>
<name>Memory</name>
</application>
<application>
<name>Network</name>
</application>
<application>
<name>Processor</name>
</application>
<application>
<name>Processus</name>
</application>
<application>
<name>System</name>
</application>
</applications>
<items>
<item>
<name>TCP ping of the agent</name>
<key>agent.ping</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<valuemap>
<name>Service state</name>
</valuemap>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{nodata({$ZBX_UNREACHABLE_TIMEOUT})}=1</expression>
<name>Unreachable Zabbix agent</name>
<priority>DISASTER</priority>
<dependencies>
<dependency>
<name>No ping response from {HOST.IP1}</name>
<expression>{Template_OS_PfSense2:icmpping[,2,,,2000].nodata(180,strict)}=0 and {Template_OS_PfSense2:icmpping[,2,,,2000].sum({$DOWN_CRITICAL})}=0 and {Template_OS_PfSense2:icmpping[,2,,,2000].dayofweek(0)}&gt;={$PING_ALERT_FROM_DAY} and {Template_OS_PfSense2:icmpping[,2,,,2000].dayofweek(0)}&lt;={$PING_ALERT_TO_DAY} and {Template_OS_PfSense2:icmpping[,2,,,2000].time(0)}&gt;={$PING_ALERT_FROM_HOUR} and {Template_OS_PfSense2:icmpping[,2,,,2000].time(0)}&lt;={$PING_ALERT_TO_HOUR}</expression>
<recovery_expression>{Template_OS_PfSense2:icmpping[,2,,,2000].sum(180)}&gt;3</recovery_expression>
</dependency>
</dependencies>
</trigger>
</triggers>
</item>
<item>
<name>Maximum number of opened files</name>
<key>kernel.maxfiles</key>
<delay>2h</delay>
<history>60d</history>
<trends>1825d</trends>
<description>It could be increased by using sysctrl utility or modifying file /etc/sysctl.conf.</description>
<applications>
<application>
<name>System</name>
</application>
</applications>
</item>
<item>
<name>Maximum number of processes</name>
<key>kernel.maxproc</key>
<delay>2h</delay>
<history>60d</history>
<trends>1825d</trends>
<description>It could be increased by using sysctrl utility or modifying file /etc/sysctl.conf.</description>
<applications>
<application>
<name>System</name>
</application>
</applications>
</item>
<item>
<name>DNS Resolution response for $2</name>
<key>net.dns.record[127.0.0.1,{$DNS_NAME_CHECK},A,,]</key>
<delay>5m</delay>
<history>15d</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>DNS resolution for $2 is working</name>
<key>net.dns[127.0.0.1,{$DNS_NAME_CHECK},A,,]</key>
<delay>5m</delay>
<history>15d</history>
<trends>0</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{max(5m)}&lt;1</expression>
<name>DNS resolution problem</name>
<priority>WARNING</priority>
</trigger>
</triggers>
</item>
<item>
<name>MBUF Cache</name>
<key>pfsense.mbuf.cache</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Memory</name>
</application>
<application>
<name>Network</name>
</application>
</applications>
</item>
<item>
<name>MBUF Current</name>
<key>pfsense.mbuf.current</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Memory</name>
</application>
<application>
<name>Network</name>
</application>
</applications>
</item>
<item>
<name>MBUF Max</name>
<key>pfsense.mbuf.max</key>
<delay>1h</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Memory</name>
</application>
<application>
<name>Network</name>
</application>
</applications>
</item>
<item>
<name>MBUF Total Used (percent)</name>
<type>CALCULATED</type>
<key>pfsense.mbuf.ptotal</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<params>((last(pfsense.mbuf.current) + last(pfsense.mbuf.cache)) * 100) / last(pfsense.mbuf.max)</params>
<applications>
<application>
<name>Memory</name>
</application>
<application>
<name>Network</name>
</application>
</applications>
<triggers>
<trigger>
<expression>{last()}&gt;80</expression>
<recovery_mode>RECOVERY_EXPRESSION</recovery_mode>
<recovery_expression>{last()}&lt;75</recovery_expression>
<name>MBUF used at {ITEM.LASTVALUE1}</name>
<priority>WARNING</priority>
<dependencies>
<dependency>
<name>MBUF used at {ITEM.LASTVALUE1}</name>
<expression>{Template_OS_PfSense2:pfsense.mbuf.ptotal.last()}&gt;90</expression>
<recovery_expression>{Template_OS_PfSense2:pfsense.mbuf.ptotal.last()}&lt;85</recovery_expression>
</dependency>
</dependencies>
</trigger>
<trigger>
<expression>{last()}&gt;90</expression>
<recovery_mode>RECOVERY_EXPRESSION</recovery_mode>
<recovery_expression>{last()}&lt;85</recovery_expression>
<name>MBUF used at {ITEM.LASTVALUE1}</name>
<priority>HIGH</priority>
</trigger>
</triggers>
</item>
<item>
<name>States Table Current</name>
<key>pfsense.states.current</key>
<delay>2m</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
</item>
<item>
<name>States Table Max</name>
<key>pfsense.states.max</key>
<delay>10m</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<preprocessing>
<step>
<type>DISCARD_UNCHANGED_HEARTBEAT</type>
<params>2h</params>
</step>
</preprocessing>
</item>
<item>
<name>States Table Current (percent)</name>
<type>CALCULATED</type>
<key>pfsense.states.pused</key>
<delay>2m</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<params>(last(pfsense.states.current) * 100) / last(pfsense.states.max)</params>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<triggers>
<trigger>
<expression>{last()}&gt;80</expression>
<recovery_mode>RECOVERY_EXPRESSION</recovery_mode>
<recovery_expression>{last()}&lt;75</recovery_expression>
<name>States table used at {ITEM.LASTVALUE1}</name>
<priority>WARNING</priority>
<dependencies>
<dependency>
<name>States table used at {ITEM.LASTVALUE1}</name>
<expression>{Template_OS_PfSense2:pfsense.states.pused.last()}&gt;90</expression>
<recovery_expression>{Template_OS_PfSense2:pfsense.states.pused.last()}&lt;85</recovery_expression>
</dependency>
</dependencies>
</trigger>
<trigger>
<expression>{last()}&gt;90</expression>
<recovery_mode>RECOVERY_EXPRESSION</recovery_mode>
<recovery_expression>{last()}&lt;85</recovery_expression>
<name>States table used at {ITEM.LASTVALUE1}</name>
<priority>HIGH</priority>
</trigger>
</triggers>
</item>
<item>
<name>pfSense Installed Version</name>
<key>pfsense.value[system,installed_version]</key>
<delay>1h</delay>
<history>60d</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<preprocessing>
<step>
<type>DISCARD_UNCHANGED_HEARTBEAT</type>
<params>1d</params>
</step>
</preprocessing>
</item>
<item>
<name>Number of active processes</name>
<key>proc.num[,,run]</key>
<delay>2m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>processus</units>
<applications>
<application>
<name>Processus</name>
</application>
</applications>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{last(0)}&gt;{$MAX_RUNNING_PROCESSES}</expression>
<name>Lots of active processes</name>
<priority>AVERAGE</priority>
</trigger>
</triggers>
</item>
<item>
<name>Number of sshd processes</name>
<key>proc.num[sshd]</key>
<delay>5m</delay>
<history>60d</history>
<trends>0</trends>
<applications>
<application>
<name>Processus</name>
</application>
</applications>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{last(0)}&lt;1</expression>
<name>sshd daemon isn't running</name>
<priority>AVERAGE</priority>
</trigger>
</triggers>
</item>
<item>
<name>Number of processes</name>
<key>proc.num[]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>processus</units>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{last(0)}&gt;{$MAX_PROCESSES}</expression>
<name>Lots of processes</name>
<priority>INFO</priority>
</trigger>
</triggers>
</item>
<item>
<name>CPU Load</name>
<key>system.cpu.load[,avg1]</key>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>CPU Load (5min)</name>
<key>system.cpu.load[,avg5]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>CPU Load (15min)</name>
<key>system.cpu.load[,avg15]</key>
<delay>15m</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Context switches per second</name>
<key>system.cpu.switches</key>
<delay>60</delay>
<history>60d</history>
<trends>1825d</trends>
<units>sps</units>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<preprocessing>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
</preprocessing>
</item>
<item>
<name>CPU usage: $2</name>
<key>system.cpu.util[,interrupt,avg1]</key>
<delay>45s</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>CPU usage: $2</name>
<key>system.cpu.util[,nice,avg1]</key>
<delay>45s</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>CPU usage: $2</name>
<key>system.cpu.util[,system,avg1]</key>
<delay>45s</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>CPU usage: $2</name>
<key>system.cpu.util[,user,avg1]</key>
<delay>45s</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<applications>
<application>
<name>Processor</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Swap: used</name>
<type>CALCULATED</type>
<key>system.swap.size.used</key>
<delay>10m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<params>last(&quot;system.swap.size[,total]&quot;)-last(&quot;system.swap.size[,free]&quot;)</params>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Swap: $2</name>
<key>system.swap.size[,free]</key>
<delay>10m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Free swap space in %</name>
<snmp_oid>interfaces.ifTable.ifEntry.ifInOctets.1</snmp_oid>
<key>system.swap.size[,pfree]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<request_method>POST</request_method>
</item>
<item>
<name>Swap: $2</name>
<key>system.swap.size[,pused]</key>
<delay>10m</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{last(0)}&gt;50</expression>
<name>High swap usage</name>
<priority>AVERAGE</priority>
</trigger>
</triggers>
</item>
<item>
<name>Swap: $2</name>
<key>system.swap.size[,total]</key>
<delay>1h</delay>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Uptime</name>
<key>system.uptime</key>
<delay>10m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>s</units>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>({last(0)}&lt;{$REBOOT_WARN_DAY} and ({time(0)}&gt;090000 and {time(0)}&lt;230000)) or ({last(0)}&lt;{$REBOOT_WARN_NIGHT} and ({time(0)}&gt;230000 or {time(0)}&lt;090000))</expression>
<name>System has rebooted</name>
<priority>INFO</priority>
</trigger>
</triggers>
</item>
<item>
<name>Connected users</name>
<key>system.users.num</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>System</name>
</application>
</applications>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{last(0)}&gt;{$MAX_USERS}</expression>
<name>Lots of connected users</name>
<priority>WARNING</priority>
</trigger>
</triggers>
</item>
<item>
<name>$1 hash</name>
<key>vfs.file.md5sum[/etc/passwd]</key>
<delay>1h</delay>
<history>30d</history>
<trends>0</trends>
<value_type>CHAR</value_type>
<applications>
<application>
<name>Integrity</name>
</application>
</applications>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{diff(0)}&gt;0</expression>
<name>/etc/passwd changed</name>
<priority>INFO</priority>
</trigger>
</triggers>
</item>
<item>
<name>$1 hash</name>
<key>vfs.file.md5sum[/etc/services]</key>
<delay>1h</delay>
<history>30d</history>
<trends>0</trends>
<value_type>CHAR</value_type>
<applications>
<application>
<name>Integrity</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>$1 hash</name>
<key>vfs.file.md5sum[/usr/sbin/sshd]</key>
<delay>1h</delay>
<history>30d</history>
<trends>0</trends>
<value_type>CHAR</value_type>
<applications>
<application>
<name>Integrity</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[active]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[buffers]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[cached]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[free]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[inactive]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<type>CALCULATED</type>
<key>vm.memory.size[pfree]</key>
<history>60d</history>
<trends>1825d</trends>
<units>%</units>
<params>100*last(&quot;vm.memory.size[free]&quot;)/last(&quot;vm.memory.size[total]&quot;)</params>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<type>CALCULATED</type>
<key>vm.memory.size[pused]</key>
<history>60d</history>
<trends>1825d</trends>
<units>%</units>
<params>100*last(&quot;vm.memory.size[used]&quot;)/last(&quot;vm.memory.size[total]&quot;)</params>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[shared]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[total]</key>
<delay>1h</delay>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[used]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
<item>
<name>Memory: $1</name>
<key>vm.memory.size[wired]</key>
<history>60d</history>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Memory</name>
</application>
</applications>
<request_method>POST</request_method>
</item>
</items>
<discovery_rules>
<discovery_rule>
<name>Gateway discovery</name>
<key>pfsense.discovery[gw]</key>
<delay>1h</delay>
<lifetime>1d</lifetime>
<item_prototypes>
<item_prototype>
<name>Gateway $2 RTT</name>
<key>pfsense.value[gw_value,{#GATEWAY},delay]</key>
<delay>3m</delay>
<history>30d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>s</units>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<preprocessing>
<step>
<type>RTRIM</type>
<params>ms</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.001</params>
</step>
</preprocessing>
</item_prototype>
<item_prototype>
<name>Gateway $2 Packet Loss</name>
<key>pfsense.value[gw_value,{#GATEWAY},loss]</key>
<delay>3m</delay>
<history>60d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<preprocessing>
<step>
<type>RTRIM</type>
<params>%</params>
</step>
</preprocessing>
</item_prototype>
<item_prototype>
<name>Gateway $2 Status</name>
<key>pfsense.value[gw_value,{#GATEWAY},status]</key>
<delay>3m</delay>
<history>30d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<trigger_prototypes>
<trigger_prototype>
<expression>{$PFS_MONITOR_GW}=1 and {last()}=5 and {last(#2)}=5</expression>
<name>Gateway {#GATEWAY} is down</name>
<priority>HIGH</priority>
<manual_close>YES</manual_close>
</trigger_prototype>
<trigger_prototype>
<expression>{$PFS_MONITOR_GW}=1 and {last()}=2 and {last(#2)}=2</expression>
<name>High Delay on gateway {#GATEWAY}</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger_prototype>
<trigger_prototype>
<expression>{$PFS_MONITOR_GW}=1 and {last()}=3 and {last(#2)}=3</expression>
<name>High packet loss on {#GATEWAY}</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
<item_prototype>
<name>Gateway $2 RTT Std Deviation</name>
<key>pfsense.value[gw_value,{#GATEWAY},stddev]</key>
<delay>3m</delay>
<history>30d</history>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>s</units>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<preprocessing>
<step>
<type>RTRIM</type>
<params>ms</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.001</params>
</step>
</preprocessing>
</item_prototype>
</item_prototypes>
</discovery_rule>
<discovery_rule>
<name>Network interface discovery</name>
<key>pfsense.discovery[interfaces]</key>
<delay>1h</delay>
<filter>
<conditions>
<condition>
<macro>{#IFNAME}</macro>
<value>@decouverte_interfaces_rzo</value>
<formulaid>A</formulaid>
</condition>
</conditions>
</filter>
<lifetime>10d</lifetime>
<item_prototypes>
<item_prototype>
<name>Inbound trafic on {#IFDESCR} ({#IFNAME})</name>
<key>net.if.in[{#IFNAME},bytes]</key>
<delay>45s</delay>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>bps</units>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<preprocessing>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
<step>
<type>MULTIPLIER</type>
<params>8</params>
</step>
</preprocessing>
<request_method>POST</request_method>
</item_prototype>
<item_prototype>
<name>Errors on inbound trafic for {#IFDESCR} ({#IFNAME})</name>
<key>net.if.in[{#IFNAME},errors]</key>
<delay>15m</delay>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>erreurs</units>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<preprocessing>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item_prototype>
<item_prototype>
<name>Outbound trafic on {#IFDESCR} ({#IFNAME})</name>
<key>net.if.out[{#IFNAME},bytes]</key>
<delay>45s</delay>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>bps</units>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<preprocessing>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
<step>
<type>MULTIPLIER</type>
<params>-8</params>
</step>
</preprocessing>
<request_method>POST</request_method>
</item_prototype>
<item_prototype>
<name>Errors on outbound trafic for {#IFDESCR} ({#IFNAME})</name>
<key>net.if.out[{#IFNAME},errors]</key>
<delay>15m</delay>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>erreurs</units>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<preprocessing>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item_prototype>
</item_prototypes>
<graph_prototypes>
<graph_prototype>
<name>Network: trafic: {#IFDESCR} ({#IFNAME})</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<drawtype>FILLED_REGION</drawtype>
<color>009900</color>
<item>
<host>Template_OS_PfSense2</host>
<key>net.if.in[{#IFNAME},bytes]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<drawtype>FILLED_REGION</drawtype>
<color>FF6666</color>
<item>
<host>Template_OS_PfSense2</host>
<key>net.if.out[{#IFNAME},bytes]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<drawtype>BOLD_LINE</drawtype>
<color>EE00EE</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template_OS_PfSense2</host>
<key>net.if.in[{#IFNAME},errors]</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<drawtype>BOLD_LINE</drawtype>
<color>EE00EE</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template_OS_PfSense2</host>
<key>net.if.out[{#IFNAME},errors]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
</graph_prototypes>
<request_method>POST</request_method>
</discovery_rule>
<discovery_rule>
<name>IPsec Phase 1 Discovery</name>
<key>pfsense.discovery[ipsec_ph1]</key>
<delay>2h</delay>
<item_prototypes>
<item_prototype>
<name>IPsec Tunnel {#IKEID} {#NAME} Tunnel Disabled</name>
<key>pfsense.value[ipsec_ph1,{#IKEID},disabled]</key>
<delay>1h</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
</item_prototype>
<item_prototype>
<name>IPsec Tunnel {#IKEID} {#NAME} Phase 1 Status</name>
<key>pfsense.value[ipsec_ph1,{#IKEID},status]</key>
<delay>3m</delay>
<history>30d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
</item_prototype>
</item_prototypes>
<trigger_prototypes>
<trigger_prototype>
<expression>{Template_OS_PfSense2:pfsense.value[ipsec_ph1,{#IKEID},disabled].last()}&lt;&gt;1 and {Template_OS_PfSense2:pfsense.value[ipsec_ph1,{#IKEID},status].last()}&lt;&gt;1 and {Template_OS_PfSense2:pfsense.value[ipsec_ph1,{#IKEID},status].last(#2)}&lt;&gt;1</expression>
<name>IPsec Tunnel {#IKEID} ({#NAME}) Not Connected</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger_prototype>
</trigger_prototypes>
</discovery_rule>
<discovery_rule>
<name>OpenVPN Client Discovery</name>
<key>pfsense.discovery[openvpn_client]</key>
<delay>1h</delay>
<item_prototypes>
<item_prototype>
<name>OpenVPN Client {#NAME} Tunnel Status</name>
<key>pfsense.value[openvpn_clientvalue,{#CLIENT},status]</key>
<delay>3m</delay>
<history>30d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<trigger_prototypes>
<trigger_prototype>
<expression>{last()}=0 and {last(#2)}=0</expression>
<name>OpenVPN Client {#NAME} Tunnel is Down</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
</item_prototypes>
</discovery_rule>
<discovery_rule>
<name>OpenVPN Server Discovery</name>
<key>pfsense.discovery[openvpn_server]</key>
<delay>1h</delay>
<item_prototypes>
<item_prototype>
<name>OpenVPN Server {#NAME} Clients Connected</name>
<key>pfsense.value[openvpn_servervalue,{#SERVER},conns]</key>
<delay>3m</delay>
<history>60d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
</item_prototype>
<item_prototype>
<name>OpenVPN Server {#NAME} Tunnel Status</name>
<key>pfsense.value[openvpn_servervalue,{#SERVER},status]</key>
<delay>3m</delay>
<history>30d</history>
<trends>1825d</trends>
<applications>
<application>
<name>Network</name>
</application>
</applications>
<trigger_prototypes>
<trigger_prototype>
<expression>{last()}=0 and {last(#2)}=0</expression>
<name>OpenVPN Server {#NAME} is Down</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
</item_prototypes>
<graph_prototypes>
<graph_prototype>
<name>Network: OpenVPN {#NAME} connections</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<drawtype>GRADIENT_LINE</drawtype>
<color>FFD54F</color>
<item>
<host>Template_OS_PfSense2</host>
<key>pfsense.value[openvpn_servervalue,{#SERVER},conns]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
</graph_prototypes>
</discovery_rule>
<discovery_rule>
<name>Services Discovery</name>
<key>pfsense.discovery[services]</key>
<delay>1h</delay>
<filter>
<conditions>
<condition>
<macro>{#SERVICE}</macro>
<value>^openvpn</value>
<operator>NOT_MATCHES_REGEX</operator>
<formulaid>A</formulaid>
</condition>
<condition>
<macro>{#SERVICE}</macro>
<value>^iperf</value>
<operator>NOT_MATCHES_REGEX</operator>
<formulaid>B</formulaid>
</condition>
</conditions>
</filter>
<item_prototypes>
<item_prototype>
<name>Service {#DESCRIPTION} Status</name>
<key>pfsense.value[service_value,{#SERVICE},status]</key>
<delay>5m</delay>
<history>30d</history>
<trends>0</trends>
<applications>
<application>
<name>Processus</name>
</application>
<application>
<name>System</name>
</application>
</applications>
<trigger_prototypes>
<trigger_prototype>
<expression>{last()}=0</expression>
<name>Service {#DESCRIPTION} is not running</name>
<priority>AVERAGE</priority>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
</item_prototypes>
</discovery_rule>
<discovery_rule>
<name>Filesystem discovery</name>
<key>vfs.fs.discovery</key>
<delay>2h</delay>
<filter>
<conditions>
<condition>
<macro>{#FSTYPE}</macro>
<value>@decouverte_fs</value>
<formulaid>A</formulaid>
</condition>
</conditions>
</filter>
<lifetime>10d</lifetime>
<item_prototypes>
<item_prototype>
<name>Free space on {#FSNAME}</name>
<key>vfs.fs.size[{#FSNAME},free]</key>
<delay>10m</delay>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Disks</name>
</application>
</applications>
<request_method>POST</request_method>
</item_prototype>
<item_prototype>
<name>Used space on {#FSNAME} (%)</name>
<key>vfs.fs.size[{#FSNAME},pused]</key>
<delay>10m</delay>
<trends>1825d</trends>
<value_type>FLOAT</value_type>
<units>%</units>
<applications>
<application>
<name>Disks</name>
</application>
</applications>
<request_method>POST</request_method>
<trigger_prototypes>
<trigger_prototype>
<expression>{last(0)}&gt;{$DF_CRITICAL}</expression>
<recovery_mode>RECOVERY_EXPRESSION</recovery_mode>
<recovery_expression>{last(0)}&lt;({$DF_WARN}-2)</recovery_expression>
<name>{#FSNAME} is {ITEM.LASTVALUE1} full</name>
<priority>AVERAGE</priority>
</trigger_prototype>
<trigger_prototype>
<expression>{last(0)}&gt;{$DF_WARN}</expression>
<recovery_mode>RECOVERY_EXPRESSION</recovery_mode>
<recovery_expression>{last(0)}&lt;({$DF_WARN}-2)</recovery_expression>
<name>{#FSNAME} is {ITEM.LASTVALUE1} full</name>
<priority>WARNING</priority>
<dependencies>
<dependency>
<name>{#FSNAME} is {ITEM.LASTVALUE1} full</name>
<expression>{Template_OS_PfSense2:vfs.fs.size[{#FSNAME},pused].last(0)}&gt;{$DF_CRITICAL}</expression>
<recovery_expression>{Template_OS_PfSense2:vfs.fs.size[{#FSNAME},pused].last(0)}&lt;({$DF_WARN}-2)</recovery_expression>
</dependency>
</dependencies>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
<item_prototype>
<name>Used space on {#FSNAME}</name>
<key>vfs.fs.size[{#FSNAME},used]</key>
<delay>10m</delay>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>Disks</name>
</application>
</applications>
<request_method>POST</request_method>
</item_prototype>
</item_prototypes>
<request_method>POST</request_method>
</discovery_rule>
</discovery_rules>
<macros>
<macro>
<macro>{$DF_CRITICAL}</macro>
<value>90</value>
</macro>
<macro>
<macro>{$DF_WARN}</macro>
<value>80</value>
</macro>
<macro>
<macro>{$DNS_NAME_CHECK}</macro>
<value>zbx.fws.fr.</value>
</macro>
<macro>
<macro>{$MAX_FILES}</macro>
<value>12328</value>
</macro>
<macro>
<macro>{$MAX_PROCESSES}</macro>
<value>200</value>
</macro>
<macro>
<macro>{$MAX_RUNNING_PROCESSES}</macro>
<value>15</value>
</macro>
<macro>
<macro>{$MAX_USERS}</macro>
<value>5</value>
</macro>
<macro>
<macro>{$PFS_MONITOR_GW}</macro>
<value>1</value>
</macro>
<macro>
<macro>{$REBOOT_WARN_DAY}</macro>
<value>7200</value>
</macro>
<macro>
<macro>{$REBOOT_WARN_NIGHT}</macro>
<value>21600</value>
</macro>
<macro>
<macro>{$ZBX_UNREACHABLE_TIMEOUT}</macro>
<value>900</value>
</macro>
</macros>
</template>
</templates>
<graphs>
<graph>
<name>Network: Connection states</name>
<ymax_type_1>ITEM</ymax_type_1>
<ymax_item_1>
<host>Template_OS_PfSense2</host>
<key>pfsense.states.max</key>
</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<drawtype>GRADIENT_LINE</drawtype>
<color>B39DDB</color>
<item>
<host>Template_OS_PfSense2</host>
<key>pfsense.states.current</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>System: CPU: Load</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>009900</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.load[,avg1]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>FF0000</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.load[,avg15]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>CCCC00</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.load[,avg5]</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<color>0040FF</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.switches</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>System: CPU: Usage</name>
<type>STACKED</type>
<ymin_type_1>FIXED</ymin_type_1>
<ymax_type_1>FIXED</ymax_type_1>
<graph_items>
<graph_item>
<drawtype>FILLED_REGION</drawtype>
<color>DD00DD</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.util[,interrupt,avg1]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<drawtype>FILLED_REGION</drawtype>
<color>EEEE00</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.util[,user,avg1]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<drawtype>FILLED_REGION</drawtype>
<color>EE0000</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.util[,system,avg1]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<drawtype>FILLED_REGION</drawtype>
<color>0000DD</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.cpu.util[,nice,avg1]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>System: Mbuf usage</name>
<type>STACKED</type>
<ymax_type_1>ITEM</ymax_type_1>
<ymax_item_1>
<host>Template_OS_PfSense2</host>
<key>pfsense.mbuf.max</key>
</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>81C784</color>
<item>
<host>Template_OS_PfSense2</host>
<key>pfsense.mbuf.current</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>7986CB</color>
<item>
<host>Template_OS_PfSense2</host>
<key>pfsense.mbuf.cache</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>System: Memory</name>
<show_work_period>NO</show_work_period>
<show_triggers>NO</show_triggers>
<type>STACKED</type>
<graph_items>
<graph_item>
<color>0000CC</color>
<item>
<host>Template_OS_PfSense2</host>
<key>vm.memory.size[used]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>00BB00</color>
<item>
<host>Template_OS_PfSense2</host>
<key>vm.memory.size[inactive]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<drawtype>FILLED_REGION</drawtype>
<color>99FFFF</color>
<item>
<host>Template_OS_PfSense2</host>
<key>vm.memory.size[free]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>System: Processes</name>
<graph_items>
<graph_item>
<drawtype>FILLED_REGION</drawtype>
<color>EE0000</color>
<item>
<host>Template_OS_PfSense2</host>
<key>proc.num[,,run]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<drawtype>FILLED_REGION</drawtype>
<color>FFFF33</color>
<item>
<host>Template_OS_PfSense2</host>
<key>proc.num[]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>System: Uptime</name>
<graph_items>
<graph_item>
<drawtype>FILLED_REGION</drawtype>
<color>FF0000</color>
<item>
<host>Template_OS_PfSense2</host>
<key>system.uptime</key>
</item>
</graph_item>
</graph_items>
</graph>
</graphs>
<value_maps>
<value_map>
<name>Service state</name>
<mappings>
<mapping>
<value>0</value>
<newvalue>Down</newvalue>
</mapping>
<mapping>
<value>1</value>
<newvalue>Up</newvalue>
</mapping>
</mappings>
</value_map>
</value_maps>
</zabbix_export>