MySQL Checks fail on localhost
Hi,
I'm new to Opsview, but so far it looks very promising. :)
After the installation I stumbled upon my first problem, which is that I have 3 check "critical" on localhost: MySQL DB Connections, MySQL DB Performance and MySQL Status.
While Connections and Performance give me a "(Return code of 255 is out of bounds)", MySQL Status has this error message:
Access denied for user 'opsview'@'localhost' (using password: YES)
The password is correctly set in the opsview.conf and I'm able to login to MySQL with this password. I checked the service itself, which cnotains the following line:
-H $HOSTADDRESS$ -u opsview -p changeme -d opsview
Do I really have to replace "changeme" to the plain text password? Or can I use a variable? Why isn't this set be default at installation?
If I edit this service check, does that mean that every host needs to have the same password for the mysql user? I hope not...
I hope you can help me..
Cool thanks, with these it works fine :)
(I wonder why this fix will only be available from 3.9? I don't think I'm the only one with this problem...)
I wonder why this fix will only be available from 3.9?
Because I only committed it a week ago and 3.9 will be the next release :)
Duncs
Nuramon (and others)...
Quote "If I edit this service check, does that mean that every host needs to have the same password for the mysql user? I hope not"
Of course this is not needed, Opsview has a lovely feature called host-attributes to help you with this.
now lets say we have 3 DB's (DB-pre, DB-test, DB-production) and each db has a different user and different password and resides on different servers.
in the host-attributes (under advanced) create three new host-attributes (I use DBNAME, MYSQLUSER, MYSQLPASSWD).
go to your service check and make the following changes (leave out the quotation marks).
"-u opsview" becomes "-u %MYSQLUSER%"
"-p changeme" becomes "-p %MYSQLPASSWD%"
"-d opsview" becones "-d %DBNAME%"
Now in each host (pre,test and production) go to the attributes tab and add the attributes mentioned above.
so for test we would add DBNAME with the value "DB-test", MYSQLUSER with the value "test" and MYSQLPASSWD with the value "test" for instance (again leave out the quotation marks).
Now opsview will automagically fill in the values you added in the host-attributes into the service check for each host.
If all the DB's reside on the same server then your best of having a generic opsview mysqluser/password for all the DB's,
Hope this helps you and also shows that there's more to opsview than meets the eye....
sincerly,
Alan
Ahh...excellent. Thanks for the info, works great with the host attributes :)
(Maybe this should show up somewhere in the documentation/faq?)





This has been fixed and will be available from 3.9 - https://secure.opsera.com/wsvn/wsvn/opsview/trunk/?op=revision&rev=4744&... and http://docs.opsview.org/doku.php?id=opsview-community:upgrading#version_... (section 3.9) -
Download the two check_opsview_xxx files from the patch and drop into /usr/local/nagios/libexec, wait a few minutes, then amend the checks as per the second doc.
Duncs