Ad Widget

Collapse

Zabbix Elasticsearch Integration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yarden
    Junior Member
    • Mar 2015
    • 2

    #1

    Zabbix Elasticsearch Integration

    Hi all,
    We're evaluating several monitoring systems(Icinga2/Bosun and Zabbix).

    Our basic requirement, aside from the obvious machine monitoring, is as follows:
    We have a Elasticsearch cluster with a lot of data points.
    We'd like to enable our dev team with a GUI to add/remove monitoring/alerts/etc but on elasticsearch query evaluation.

    I know that all monitoring systems enable running external scripts but I'm trying to avoid that because the overhead for dev teams to write these scripts.

    Can zabbix generate checks/alerts on a elasticsearch query via API call (e.g. /_search?fields=response:404) ?

    Any other ideas?

    Thanks,
    Yarden
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Originally posted by yarden
    Can zabbix generate checks/alerts on a elasticsearch query via API call (e.g. /_search?fields=response:404) ?
    Yarden
    If you will start storing values read from such url on top of such metric/item you can build what ever you want from point of view possible alarms using triggers. None of the "integrations" is needed here to organize such monitoring.
    On reading values from exact URLs possibly you can use build in agent items like web.page.get[] or web.page.regexp[] so in case some simple metrics probably you will not need even some backend scripts to read data from ES.
    Last edited by kloczek; 26-03-2015, 15:15.
    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

    • yarden
      Junior Member
      • Mar 2015
      • 2

      #3
      Storig Values

      Hi kloczek,

      Can you help me with an example?

      How to configure such check?

      How to configure the request to elasticsearch?

      Thanks,
      Yarden

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by yarden
        Hi kloczek,

        Can you help me with an example?

        How to configure such check?

        How to configure the request to elasticsearch?

        Thanks,
        Yarden
        OK .. lets use my own apache template as kind of example.
        In my template I'm parsing mod_status URL which is usually is localhost/server-status?auto. Orn this URL you can find output like:

        HTML Code:
        $ curl -s localhost/server-status?auto
        Total Accesses: 25569
        Total kBytes: 10860
        CPULoad: .00168426
        Uptime: 387707
        ReqPerSec: .0659493
        BytesPerSec: 28.6831
        BytesPerReq: 434.927
        BusyWorkers: 1
        IdleWorkers: 6
        Scoreboard: W___.___........................................................................................................................................................................................................................................................
        To extract exact values from above I'm using keys like:

        Code:
        web.page.regexp[localhost,server-status?auto,80,"Total Accesses: ([0-9]+)",,\1]
        web.page.regexp[localhost,server-status?auto,80,"Uptime: ([0-9]+)",,\1]
        web.page.regexp[localhost,server-status?auto,80,"BusyWorkers: ([0-9]+)",,\1]
        web.page.regexp[localhost,server-status?auto,80,"IdleWorkers: ([0-9]+)",,\1]
        To test this on host with running apache I can use zabbix_agentd binary:

        Code:
        # /usr/sbin/zabbix_agentd -t 'web.page.regexp[localhost,server-status?auto,80,"Total Accesses: ([0-9]+)",,\1]'
        web.page.regexp[localhost,server-status?auto,80,"Total Accesses: ([0-9]+)",,\1] [s|25583]
        So as you see I can use above key to store monitoring data in unsigned int metric.
        Last edited by kloczek; 26-03-2015, 17:55.
        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...