Ad Widget

Collapse

Edit template Item key from attached template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arktoday
    Junior Member
    • May 2023
    • 4

    #1

    Edit template Item key from attached template

    I have custom template with attached template PostgreSQL by Zabbix agent 2. There is an Item with key pgsql.custom.query. But I can't edit item key in new custom template.

    Click image for larger version

Name:	image.png
Views:	719
Size:	27.0 KB
ID:	464246
    Click image for larger version

Name:	image.png
Views:	653
Size:	55.5 KB
ID:	464247

    How can I edit it (item key) only for custom template? Or how to add new custom query?

    Thanks​
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    Open it from your parent template... on that second pic. click on "PostgreSQL by Zabbix Agent 2" and edit it...

    Linking templates does not make all items editable from same "level"... you still need to edit them in their own template. Linking basically means, that if you install one template, stuff from linked template will be added also.

    Comment


    • arktoday
      arktoday commented
      Editing a comment
      This means that I can't edit key as many times as I want for different uses? Maybe you know how can I use custom queries in different templates or hosts? Is the only way to make a full copy of original template?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #3
    I am not familiar with the template, but that items description says "Execute custom queries from file *.sql (check for option Plugins.Postgres.CustomQueriesPath at agent configuration)" So maybe you need to store your queries somewhere and then call for specific one with this item... There seems a 4th, empty, field in parameters (pgsql.custom.query["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DA TABASE}",""])... You probably need separate items for each query anyway. So clone the item, call for correct query in key parameters...

    Comment

    Working...