check_mysql

Hello.

I’m pretty familiar with Nagios. Anyways, I’m checking a database with the check_mysql command. However, I have a database for the company I work for that has a password with a dollar sign $ and a exclamation point ! (i didn’t choose these passwords and I have no way of changing it)

./check_mysql -H host1 -u myweb -p 'byemY$h1t!' -d my_db
Uptime: 4870927  Threads: 97  Questions: 589839997  Slow queries: 7600  Opens: 15182  Flush tables: 7  Open tables: 256  Queries per second avg: 121.094

So my problem is this, Nagios is giving me an access denied error with the password. The password works with single quotes if I check the DB through the command line but it does not work in the commands.cfg file.

# 'check_mysql' command definition
define command{
        command_name    check_mysql
        command_line    $USER1$/check_mysql -H $HOSTADDRESS$ -u $ARG1$ -d $ARG2$ -p 'byemY$h1t!'
        }

I’ve tried everything:
'byemY$h1t!'
byemY$h1t!

Any help will greatly be appreciated it.

I would be inclined to escape the ! and also it appears that nagios likes you to double-escape the $…

byemY\$h1t!

As for qoutes or no quotes I think it’s trial and error…

HTH

/S

strides,

thanks for your suggestions. However i tried the double back slash before the dollar sign $ and one back slash before the exclamation point and did not get a successful check. I also checked the same parameters in the command line and did not get into the db.

No worries - \$ seems to have had some success in database names before and I hoped it’d be the answer for the password too, but alas not. Not sure what else to suggest, except maybe scripting the check_mysql externally and using nagios to call the new script instead…

Rgds

/S

That’s exactly what I did. I created a script and parsed the output from the working check_mysql command line into the script.