Ad Widget

Collapse

have server load template or macros from file (possibly instead of from DB)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bchill
    Junior Member
    • Jul 2024
    • 5

    #1

    have server load template or macros from file (possibly instead of from DB)

    Hello,

    I would like to be able to have the server load templates or at least macros from a file as opposed to having to go through the UI. The other option would be to tell the server to defer all macros to the clients.

    For example, to use to monitor mysql via Active Agent 2, I was able to set the mysql login and password in the agent config file:

    /etc/zabbix/zabbix_agent2.d/plugins.d/mysql.conf:

    Plugins.Mysql.Default.User=someuser
    Plugins.Mysql.Default.Password=xxxxx

    ... but setting this made no difference:

    Plugins.Mysql.Default.Uri=unix:/var/lib/mysql/mysql.sock

    I had to actually edit the template via the server UI:

    Click image for larger version  Name:	image.png Views:	0 Size:	5.1 KB ID:	490989
    The monitor would not work without explicitly setting this macro.

    I am sure this will come up for other services as well.

    Is there any way around these point-and-click steps that are wholly unscalable, preferably via a basic config file?

    Brian
    Last edited by bchill; 09-09-2024, 22:55.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    All the docs say, it should be possible via conf file..
    Have you tried with "session" parameters in conf file? https://git.zabbix.com/projects/ZBX/...ysql/README.md
    Code:
    Plugins.Mysql.Sessions.<Name>.Uri=unix:/var/lib/mysql/mysql.sock
    Plugins.Mysql.Sessions.<Name>.User=Someuser
    Plugins.Mysql.Sessions.<Name>.Password=xxxxxxx
    and then referring to session <Name> only?

    Comment

    Working...