zabbix_export: version: '6.0' date: '2021-11-21T21:44:26Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 name: Templates/Applications templates: - uuid: 42684372d5e6467c972745668389779a template: 'Auto fuzzytime trigger for Zabbix proxy' name: 'Auto fuzzytime trigger for Zabbix proxy' description: | ## Overview The solution is based on Zabbix API. And native HTTP agent will discover all proxies and create lastaccess item per each proxy + fuzzytime trigger. In order to run this solution, you have to have an active session-id in a global level. Please see: [https://share.zabbix.com/zabbix-tools-and-utilities/maintain-zabbix-api-session-id-in-a-global-level](zabbix-tools-and-utilities/maintain-zabbix-api-session-id-in-a-global-level) groups: - name: Templates/Applications discovery_rules: - uuid: 6cdda3bc5fbe41f3903d7ca69ecedc35 name: 'Discover all proxies' type: HTTP_AGENT key: get.proxy.list delay: 1h item_prototypes: - uuid: 6e4025c5679c491bad79552f1c37908c name: 'Last access for {#PROXYNAME}' type: INTERNAL key: 'zabbix[proxy,{#PROXYNAME},lastaccess]' tags: - tag: Application value: 'Proxy Last Access' trigger_prototypes: - uuid: 633757629d214c5db19c0f672c75adf2 expression: 'fuzzytime(/Auto fuzzytime trigger for Zabbix proxy/zabbix[proxy,{#PROXYNAME},lastaccess],{$PROXYFUZZYTIME})=0' name: '{#PROXYNAME} is not reachable for {$PROXYFUZZYTIME}' priority: HIGH tags: - tag: '{#PROXYNAME}' value: Down timeout: 8s url: '{$JSONRPC.PHP}' posts: | { "jsonrpc": "2.0", "method": "proxy.get", "params": { "output": "extend", "selectInterface": "extend" }, "auth": "{$APIKEY}", "id": 1 } follow_redirects: 'NO' post_type: JSON request_method: POST lld_macro_paths: - lld_macro: '{#PROXYNAME}' path: $.host preprocessing: - type: JSONPATH parameters: - '$.result[*]' macros: - macro: '{$PROXYFUZZYTIME}' value: 3m