GithubHelp home page GithubHelp logo

Comments (3)

kloczek avatar kloczek commented on May 27, 2024

Ha you just hit something which I forgot to document :/
Service MySQL template has macro:

{$MYSQL_CMD} => HOME=/var/lib/zabbix /usr/bin/mysql --login-path=monitoring -Nse

You need to create /var/lib/zabbix directory and using mysql_config_editor program store in it .mylogin.cnf file with details about username, password and address of the mysql server.

Just use command like below:

[root@domek ~]# HOME=/var/lib/zabbix mysql_config_editor set --user=monitoring --host=localhost --password
Enter password: 
[root@domek ~]# HOME=/var/lib/zabbix mysql_config_editor print
[client]
user = monitoring
password = *****
host = localhost

Than you need to change ownership of the /var/lib/zabbix
[root@domek ~]# chown -R zabbix:zabbix /var/lib/zabbix; chmod 700 /var/lib/zabbix; chmod 600 /var/lib/zabbix/.*

FYI I've started writing my own agent loadable module to provide template template items abstractions but this module is not finished yet. https://github.com/kloczek/zbx_mod_mysql
Whit this module will be not necessary to use external commands.

from zabbix-templates.

xainty avatar xainty commented on May 27, 2024

@kloczek after I do those steps I lost connection to my DB on zabbix, and coudn't open zabbix's website:

Error connecting to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111).

Any idea why this happened? And how can I avoid it?

from zabbix-templates.

kloczek avatar kloczek commented on May 27, 2024

First: are you able to connect to the mysql database using mysql client command?
I suppose that you not been able to do that :)

from zabbix-templates.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.