Nagios Unable to connect to Database
-
- Posts: 5
- Joined: Thu Mar 26, 2020 7:48 am
Nagios Unable to connect to Database
Hey,
I have installed Nagios Network Analyzer on my Centos6.8 machine with Nagios Core running on it. Where as after typing <server_ip>/nagiosna. I get the Error saying -
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346
Also, when I run service nagiosna stop or start - I get the error message -
Error connecting to the database. (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
Can you help me?
I have installed Nagios Network Analyzer on my Centos6.8 machine with Nagios Core running on it. Where as after typing <server_ip>/nagiosna. I get the Error saying -
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346
Also, when I run service nagiosna stop or start - I get the error message -
Error connecting to the database. (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
Can you help me?
You do not have the required permissions to view the files attached to this post.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Unable to connect to Database
Can you show the output of the following from the CLI
Code: Select all
service mysqld status
-
- Posts: 5
- Joined: Thu Mar 26, 2020 7:48 am
Re: Nagios Unable to connect to Database
Output -
You do not have the required permissions to view the files attached to this post.
Re: Nagios Unable to connect to Database
You could try:
I just want to mention that you shouldn't be running two of our products on the same server. From our official documentation:
Code: Select all
service mysqld stop
rm -f /var/lib/mysql/mysql.sock
service mysqld start
https://assets.nagios.com/downloads/nag ... ctions.pdfImportant: Nagios Enterprises highly recommends and will only support installing Nagios Network Analyzer on a newly installed, "clean" system (a bare minimal install with nothing else installed or configured).
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 5
- Joined: Thu Mar 26, 2020 7:48 am
Re: Nagios Unable to connect to Database
Hey, I have installed Nagios NA on a new server with no other nagios software but still i'am getting the same error as stated above
Re: Nagios Unable to connect to Database
Did you see a "success" message at the end of your installation?
Can you run the following commands from the command line, and show the output?Nagios Network Analyzer Installation Success!
You can finish the final setup steps for Nagios Network Analyzer by visiting:
http://<server_ip_address>/nagiosna/
Code: Select all
cat /etc/*release
uname -a
mysql -V
ps -ef | grep mysql
php -v
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 5
- Joined: Thu Mar 26, 2020 7:48 am
Re: Nagios Unable to connect to Database
Yes I did recieve the 'Success Installation' prompt without any error.
Here are the outputs to your commands, Please find them attached.
Here are the outputs to your commands, Please find them attached.
You do not have the required permissions to view the files attached to this post.
Re: Nagios Unable to connect to Database
It seems that you are using a custom (newer than the "default") version of mysql... On my CentOS 6 (fully upgraded) system, I see:
Let's check a few more things:
1. Restart the mysqld service:
and check to see if it's running:
2. Upload you /var/log/messages and /var/log/mysqld.log files on the forum.
3. Run the commands below, and show the output:
4. Run the following command:
then post the list.txt file that was generated in the /tmp directory.
P.S.
I saw that you used "https" in the URL, when trying to access NNA. Did you configure NNA to work with SSL? If you did, is this the document that you followed - https://assets.nagios.com/downloads/nag ... alyzer.pdf?
Code: Select all
# mysql -V
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
Let's check a few more things:
1. Restart the mysqld service:
Code: Select all
service mysqld restart
Code: Select all
service mysqld status
3. Run the commands below, and show the output:
Code: Select all
iptables -L
echo 'SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE\G;' | mysql
cat /etc/my.cnf
Code: Select all
yum list installed > /tmp/list.txt
P.S.
I saw that you used "https" in the URL, when trying to access NNA. Did you configure NNA to work with SSL? If you did, is this the document that you followed - https://assets.nagios.com/downloads/nag ... alyzer.pdf?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 5
- Joined: Thu Mar 26, 2020 7:48 am
Re: Nagios Unable to connect to Database
Please go the google drive link for all the files, thankyou since they are not getting uploaded here
https://drive.google.com/drive/folders/ ... sp=sharing
https://drive.google.com/drive/folders/ ... sp=sharing
We have configured with our own organisation SSL certificatelmiltchev wrote:It seems that you are using a custom (newer than the "default") version of mysql... On my CentOS 6 (fully upgraded) system, I see:
Code: Select all
# mysql -V mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
Let's check a few more things:
1. Restart the mysqld service:and check to see if it's running:Code: Select all
service mysqld restart
Yes it's runningCode: Select all
service mysqld status
2. Upload you /var/log/messages and /var/log/mysqld.log files on the forum.
3. Run the commands below, and show the output:4. Run the following command:Code: Select all
iptables -L echo 'SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE\G;' | mysql cat /etc/my.cnf
then post the list.txt file that was generated in the /tmp directory.Code: Select all
yum list installed > /tmp/list.txt
Please find the attachment
P.S.
I saw that you used "https" in the URL, when trying to access NNA. Did you configure NNA to work with SSL? If you did, is this the document that you followed - https://assets.nagios.com/downloads/nag ... alyzer.pdf?
You do not have the required permissions to view the files attached to this post.
Re: Nagios Unable to connect to Database
The mysqld.log indicates an issue with the mysql connection. The my.cfg file that you are using is heavily customized. We don't support this kind of customization to the mysql db. Here's one (example) from a "vanilla" install:
If you wished to get Nagios Network Analyzer installed, up and running, run the installer on a CLEAN system, with nothing else installed on it, e.g. CentOS 7 MINIMAL install.
Note: You can customize your system if you wish, however this is not something that we would support. I would recommend that you try your customization in a test environment first before applying it in production.
Code: Select all
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Note: You can customize your system if you wish, however this is not something that we would support. I would recommend that you try your customization in a test environment first before applying it in production.
Be sure to check out our Knowledgebase for helpful articles and solutions!