Using icinga verison r2.10.3-1 on a linux/debian machine.
I am trying to add a mysql check for my localhost. In the /etc/icinga2/conf.d/services.conf I have added the following -
The check shows up on my icingweb2 but it gives an error “Access denied for user nagios@localhost Using password : NO” . When i run the command /usr/lib/nagios/plugins/check_mysql as root user the command executes properly. I was trying to get the icinga check to use the user i specified but since that wasn’t working I created the user and granted all privilege on all databases on my machine but still no luck. Any help would be appreciated.
I’ve replaced the variable with the one you suggested but i still receive the same error. In the /var/log/mysql/error.log it repeatedly sends the message “2021-03-18 11:57:50 4166 [Warning] Access denied for user ‘nagios’@‘localhost’ (using password: NO)”. The error is confusing as I’ve granted user nagios all privileges on all databases using the command - GRANT ALL PRIVILEGGES ON . TO ‘nagios’;
Okay, can you try to run the script as the icinga user? This should give you a hint of what is going wrong. sudo -u nagios /usr/lib/nagios/plugins/check_mysql -u user -p password