[SOLVED] NDOMOD problem (Can't connect to MySQL server ...)


#1

Hello everyone,

I’ve been wracking my brain for the past two days and I’ve finally got no idea what to do next. I had Nagios with NagVis installed and it worked just fine, until I realized the MySQL database wasn’t in the right place. I moved it to the /home/mysql/data directory (actually just wiped it out and reinstalled using the new directory) and it works OK. Nagios and NDOMOD write data to the database and I can access the database from the command prompt and poke around and check out the tables and whatnot.

The problem is when I try to navigate to nagiosserver/nagios/nagvis, I get this error message:

errorSelectingDb: NDOMy: Error selecting database (Backend ndomy_1) Error selecting the database. Maybe wrong database name or insufficient permissions. MySQL-Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

Now… here’s what I’ve done. First, I tried to get NDO to use the REAL socket at /var/run/mysql/mysql.sock, but it appears to only want to look in /var/lib, so I created a symbolic link to the real thing thinking that would be the cleanest solution. Didn’t actually solve the problem. I’ve gone up and down throughout all the directories, checking file permissions and everything looks OK. I went through the MySQL database adminstration GUI and created the user and assigned it the appropriate privileges (SELECT, INSERT, UPDATE, DELETE) on “localhost,” “%,” AND “127.0.0.1.” The user account appears to be able to access the database just fine, because as I said before, new data is coming in to the tables all the time. I’ve gone through the configs of ndomod, ndo2db, nagios, nagvis and mysql and everything appears to be in order. I’ve checked spelling, punctuation, hidden characters… everything.

/var/log/messages shows that ndo2db is successfully connecting and flushing data to the data sink, but the main nagvis page shows the above error. MySQL reports nothing out of the ordinary. Anyone have any ideas?


#2

Nevermind, I figured it out :slight_smile: )

Permissions on the folder /var/lib/mysql didn’t allow access to anybody but the mysql user and group. chmod 777 /var/lib/mysql cleared that right up. Still can’t figure out why it insists on looking there instead of /var/run/mysql for the socket. Must be hard coded somewhere.