Ad Widget

Collapse

store Zabbix historical data to Elasticsearch

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ggggsc
    Junior Member
    • Feb 2019
    • 23

    #1

    store Zabbix historical data to Elasticsearch

    Hi there, I followed https://www.zabbix.com/documentation/4.0/……/elastic_search_setup to setup the relationship between my zabbix and elasticsearch,and there's a problem.
    In fact , I did everything the document said, zabbix_server.conf,zabbix.conf.php,create mapping, and finally, I can see data in my elasticsearch,but the web of zabbix doesn't work.(as attached)
    I know that Elasticsearch support is experimental, but I'm just confused.
    My zabbix edition is 4.0(Zabbix 4.0 Appliance,which everything is preconfigured), the menu says that this edition support elasticsearch.
    However, my elasticsearch edition is 6.5.4, which is out of Elasticsearch versions: 5.0.x –> 6.1.x which menual confirmed.
    Maybe this is the problem why my zabbix web cannot connect, maybe not, I have no idea.

    Ignoring this ,I still not understand how zabbix.conf.php works, this is exactly what I want to know. could you please kindly let me know? thanks!
    follow the menual,in conf/zabbix.conf.php,we need to add $HISTORY as well as follows:

    1. $HISTORY['url'] = 'http://test.elasticsearch.lan:9200'; $HISTORY['types'] = ['str', 'text', 'log','dbl','uint'];
    these tell zabbix how to read from elasticsearch. but what about mysql database?
    no change to these?
    1. $DB['TYPE'] = 'MYSQL';
    2. $DB['SERVER'] = 'localhost';
    3. $DB['PORT'] = '0';
    4. $DB['DATABASE'] = 'zabbix';
    when zabbix start, it will read codes above first because they are in the top of conf/zabbix.conf.php ,while codes about elasticsearch at the bottom.
    but even so ,it cannot explain why my zabbix cannot connect to mysql also,no change to the database at all (no new data to mysql, but it still works,right?)

    Here's my whole zabbix.conf.php,maybe help:
    more zabbix.conf.php
    <?php
    // Zabbix GUI configuration file.
    global $DB,$HISTORY;

    $DB['TYPE'] = 'MYSQL';

    $DB['SERVER'] = 'localhost';

    $DB['PORT'] = '0';

    $DB['DATABASE'] = 'zabbix';

    $DB['USER'] = 'zabbix';

    $DB['PASSWORD'] = '*****';
    // Schema name. Used for IBM DB2 and PostgreSQL.

    $DB['SCHEMA'] = '';



    $ZBX_SERVER = 'localhost';

    $ZBX_SERVER_PORT = '10051';

    $ZBX_SERVER_NAME = 'Zabbix Appliance';


    $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;



    // Elasticsearch url (can be string if same url is used for all types).

    $HISTORY['url'] = 'http://*******:9200';

    // Value types stored in Elasticsearch.

    $HISTORY['types'] = ['uint', 'text', 'log', 'str', 'dbl'];
    ?>
    Attached Files
  • ggggsc
    Junior Member
    • Feb 2019
    • 23

    #2
    update:
    I've set up a new zabbix4.0.4 based on centos7,and Elasticsearch6.5.4.
    This time zabbix web GUI works after configuration with elasticsearch.However, still no data on zabbix web GUI.
    I'm nearly surely that data from zabbix server are written into elasticsearch, but zabbix server cannot read data from elasticsearch.
    I'm wondering how to configure this, so that my zabbix server can draft data from elasticsearch?
    best regards!
    Attached Files

    Comment

    • isarib
      Junior Member
      • Feb 2019
      • 2

      #3
      This is exactly my problem when tested today, after defining history to ES, my main zabbix webui is showing no data or agent problems. I can see something going es, but nothing meaningful.

      I am going to revert my changes and leave it as is, and will dump zabbix(mysql) data to es periodically instead as it is easier to manage.

      Edited: I can confirm after reverting the changes, I can see the zabbix webui working as per normal, all agents responding fine.
      Last edited by isarib; 15-02-2019, 09:40.

      Comment

      Working...