Ad Widget

Collapse

how can I make this query filter the values according to HOST ID or HOSTNAME?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Luis Henrique
    Junior Member
    • Oct 2019
    • 2

    #1

    how can I make this query filter the values according to HOST ID or HOSTNAME?

    I have the following QUERY for ZABBIX POSTGRES bank:

    Code:
    SELECT DISTINCT ON (date_trunc('hour', clock))
    value, date_trunc('hour', clock)
    FROM history
    WHERE date_trunc('day', clock) = current_date
    ORDER BY date_trunc('hour', clock), clock;
    It returns the history table values to me every 1 hour.

    My question is, how can I make this query filter the values according to HOST ID or HOSTNAME?
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    More important question is why you are trying to fiddle straight into the database?
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    Working...