How to Configure Username& Password for mysql check?

This forum was archived to /woltlab and is now in read-only mode.
  • Hi all,


    I just setup Icinga2, Icingaweb2 and Icinga Directorfrom scratch.

    Now I am going to configure my hosts and services. Some hosts are configured an icinga2 now monitors them with the ping command.

    Same for ssh service.


    Now I wanted to check a MySQL server and configured the service mysql with the mysql script. As I have restricted access to this MySQL host I am always getting "Access denied for user 'icinga'@'icinga.....' (using password: NO)". Obviously, because for any login my MySQL server wants a password. Iwon't mind configuring a single monitoring user at the MySQL host. But how do I tell the Icinga through Director which username and password to use?


    I guess there is some documentation but I haven't found anything related.


    Thanks!


    Christian

  • The check honors the mysql_username and mysql_password variables, if you set them in the host or service object:

    https://docs.icinga.com/icinga…lugin-check-command-mysql


    At the director, you go to the checkcommand and add these fields as shown in the screenshot1.

    Then, go to the host, add service mysql and fill in the values as shown in screenshot2.

  • Perfect!

    Working like a charm now. I seriously had no clue where to look...


    Thanks!