Skip to content

Commit

Permalink
Merge pull request #307 from tbblake/main
Browse files Browse the repository at this point in the history
Added tags to the item prototypes for "Newreleases Name" and "Newrele…
  • Loading branch information
oscar120584 authored Feb 6, 2024
2 parents 496ad47 + a25ba51 commit f855f7e
Showing 1 changed file with 45 additions and 47 deletions.
92 changes: 45 additions & 47 deletions Applications/template_app_newreleases/Template_App_Newreleases.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
zabbix_export:
version: '6.4'
template_groups:
-
uuid: 7df96b18c230490a9a0a9e2307226338
- uuid: 7df96b18c230490a9a0a9e2307226338
name: Templates
templates:
-
uuid: 0921f1aab9ab4f6f942c3614303541b9
- uuid: 0921f1aab9ab4f6f942c3614303541b9
template: 'Template App Newreleases'
name: 'Template App Newreleases'
description: |
Expand All @@ -17,50 +15,44 @@ zabbix_export:
Generate an API key and copy it into the {$APIKEY} macro
Subscribe to software releases you're interested in on newreleases.io
groups:
-
name: Templates
- name: Templates
discovery_rules:
-
uuid: 6f597057be9646cc890a4d0be130e3b0
- uuid: 6f597057be9646cc890a4d0be130e3b0
name: 'Newreleases JSON'
type: HTTP_AGENT
key: newreleases.json
delay: 1d
lifetime: 7d
item_prototypes:
-
uuid: 3852288798224c388899b52acb2b5654
- uuid: 3852288798224c388899b52acb2b5654
name: 'Release Date for {#PROVIDER} {#NAME}'
type: DEPENDENT
key: 'newreleases.project.date[{#PROVIDER},{#NAME}]'
delay: '0'
history: 14d
units: unixtime
description: 'Release Date for {#PROVIDER} {#NAME}'
description: |
Release Date for {#PROVIDER} {#NAME}
URL: {#URL}
preprocessing:
-
type: JSONPATH
- type: JSONPATH
parameters:
- $.date
-
type: JAVASCRIPT
- type: JAVASCRIPT
parameters:
- |
return(new Date(value)/1000);
master_item:
key: 'newreleases.project.json[{#PROVIDER},{#NAME}]'
tags:
-
tag: Application
- tag: Application
value: Newreleases
trigger_prototypes:
-
uuid: d37728d19c5a4221947724adab9f825f
expression: 'fuzzytime(/Template App Newreleases/newreleases.project.date[{#PROVIDER},{#NAME}],86400)=1'
name: 'Recent release for {#PROVIDER} {#NAME}'
priority: INFO
-
uuid: a64942a8d4404fd29d69fec0704971a2
- tag: 'Newreleases Name'
value: '{#NAME}'
- tag: 'Newreleases Provider'
value: '{#PROVIDER}'
- uuid: a64942a8d4404fd29d69fec0704971a2
name: 'Release JSON for {#PROVIDER} {#NAME}'
type: HTTP_AGENT
key: 'newreleases.project.json[{#PROVIDER},{#NAME}]'
Expand All @@ -73,53 +65,59 @@ zabbix_export:
newreleases.io Project ID - {#ID}
url: 'https://api.newreleases.io/v1/projects/{#PROVIDER}/{#NAME}/latest-release'
headers:
-
name: X-Key
- name: X-Key
value: '{$APIKEY}'
tags:
-
tag: Application
- tag: Application
value: Newreleases
-
uuid: fda390c59cd84bc39d07cd1b2fdc3119
- tag: 'Newreleases Name'
value: '{#NAME}'
- tag: 'Newreleases Provider'
value: '{#PROVIDER}'
- uuid: fda390c59cd84bc39d07cd1b2fdc3119
name: 'Release Version for {#PROVIDER} {#NAME}'
type: DEPENDENT
key: 'newreleases.project.version[{#PROVIDER},{#NAME}]'
delay: '0'
history: 14d
trends: '0'
value_type: TEXT
description: |
Release Version for {#PROVIDER} {#NAME}
URL: {#URL}
preprocessing:
-
type: JSONPATH
- type: JSONPATH
parameters:
- $.version
master_item:
key: 'newreleases.project.json[{#PROVIDER},{#NAME}]'
tags:
-
tag: Application
- tag: Application
value: Newreleases
- tag: 'Newreleases Name'
value: '{#NAME}'
- tag: 'Newreleases Provider'
value: '{#PROVIDER}'
trigger_prototypes:
- uuid: d37728d19c5a4221947724adab9f825f
expression: 'fuzzytime(/Template App Newreleases/newreleases.project.date[{#PROVIDER},{#NAME}],86400)=1 and length(last(/Template App Newreleases/newreleases.project.version[{#PROVIDER},{#NAME}]))>0'
name: 'Recent release for {#PROVIDER} {#NAME}'
priority: INFO
manual_close: 'YES'
url: 'https://api.newreleases.io/v1/projects'
headers:
-
name: X-Key
- name: X-Key
value: '{$APIKEY}'
lld_macro_paths:
-
lld_macro: '{#ID}'
- lld_macro: '{#ID}'
path: $.id
-
lld_macro: '{#NAME}'
- lld_macro: '{#NAME}'
path: $.name
-
lld_macro: '{#PROVIDER}'
- lld_macro: '{#PROVIDER}'
path: $.provider
-
lld_macro: '{#URL}'
- lld_macro: '{#URL}'
path: $.url
preprocessing:
-
type: JSONPATH
- type: JSONPATH
parameters:
- $.projects

0 comments on commit f855f7e

Please sign in to comment.