Recurring Database Connection Error
-
venturegardengroup
- Posts: 62
- Joined: Tue Jun 28, 2016 10:11 am
Recurring Database Connection Error
Hello Support,
I have been getting a recurring database connection error issue on my Nagios XI for over 2 weeks now. The frequency is about once in 2 days. Currently even when I run the repair command on the CLI, nothing seems to happen. How can you be of help?
See screenshot attached.
Regards,
I have been getting a recurring database connection error issue on my Nagios XI for over 2 weeks now. The frequency is about once in 2 days. Currently even when I run the repair command on the CLI, nothing seems to happen. How can you be of help?
See screenshot attached.
Regards,
You do not have the required permissions to view the files attached to this post.
Re: Recurring Database Connection Error
My immediate reaction is that almost 50,000 failed logins in as root in three days is a serious issue that needs to be addressed. Use a non-standard port, set up firewalls, activate fail2ban, and audit accounting output to make sure someone hasn't managed to guess your root password. That's pretty insane; you're averaging one failed login every six seconds, continuously.
My second reaction is to issue this command first:
Before executing:
Some of the XI scripts are funny and need to be run from the directory, not just called by name.
My second reaction is to issue this command first:
Code: Select all
cd /usr/local/nagiosxi/scripts
Code: Select all
./repair_databases.sh
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
-
kyang
Re: Recurring Database Connection Error
Thanks @eloyd!
@venturegardengroup, please cd into the scripts directory and then run the./repair_databasesh.sh just as eloyd mentions.
Let us know if this works or if you have any more questions.
@venturegardengroup, please cd into the scripts directory and then run the./repair_databasesh.sh just as eloyd mentions.
Let us know if this works or if you have any more questions.
-
venturegardengroup
- Posts: 62
- Joined: Tue Jun 28, 2016 10:11 am
Re: Recurring Database Connection Error
Thanks eloyd and Kyang,
I have done exactly as requested but it is still the same issue.
@eloyd: thanks for your observation and recommendation, we are getting that fixed.
I have done exactly as requested but it is still the same issue.
@eloyd: thanks for your observation and recommendation, we are getting that fixed.
-
kyang
Re: Recurring Database Connection Error
Can you tell us what version of XI you have, and run this command to tell us the database.
Code: Select all
grep dbtype /usr/local/nagiosxi/html/config.inc.php-
venturegardengroup
- Posts: 62
- Joined: Tue Jun 28, 2016 10:11 am
Re: Recurring Database Connection Error
Hello Kyang,
I cant seem to get the version of nagios xi since I cant log into the UI. However here is the output of the command:
[root@localhost ~]# grep dbtype /usr/local/nagiosxi/html/config.inc.php
$cfg['dbtype'] = ''; // this setting is no longer used - use settings below
"dbtype" => 'mysql',
"dbtype" => 'mysql',
"dbtype" => 'mysql',
[root@localhost ~]#
I cant seem to get the version of nagios xi since I cant log into the UI. However here is the output of the command:
[root@localhost ~]# grep dbtype /usr/local/nagiosxi/html/config.inc.php
$cfg['dbtype'] = ''; // this setting is no longer used - use settings below
"dbtype" => 'mysql',
"dbtype" => 'mysql',
"dbtype" => 'mysql',
[root@localhost ~]#
-
dwasswa
Re: Recurring Database Connection Error
Hi @venturegardengroup ,
If you cant login to the web UI please follow the steps below:
1.Open an SSH or direct console session to your Nagios XI host and execute the following command:
Note: If you would like to use special characters in your password, you should escape them with "\". For example, if you want to set your new password to be "$new password#", then you can run:
2.check if iptables is started, run:
To see if port 80 is open, run:
You should see something like this:
If the port is not open, you can open it by running:
If you cant login to the web UI please follow the steps below:
1.Open an SSH or direct console session to your Nagios XI host and execute the following command:
Code: Select all
/usr/local/nagiosxi/scripts/reset_nagiosadmin_password.php --password=newpasswordCode: Select all
/usr/local/nagiosxi/scripts/reset_nagiosadmin_password.php --password=\$new\ password\#2.check if iptables is started, run:
Code: Select all
service iptables statusTo see if port 80 is open, run:
Code: Select all
iptables -L -n | grep 80You should see something like this:
Code: Select all
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80 If the port is not open, you can open it by running:
Code: Select all
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
service iptables save
-
venturegardengroup
- Posts: 62
- Joined: Tue Jun 28, 2016 10:11 am
Re: Recurring Database Connection Error
Hello Dwasswa,
The issue is with the log in is DB error related rather than with the password. See output attached.
Regards,
The issue is with the log in is DB error related rather than with the password. See output attached.
Regards,
You do not have the required permissions to view the files attached to this post.
-
kyang
Re: Recurring Database Connection Error
Could you show us your mysql logs?
Code: Select all
tail /var/log/mysqld.log-
venturegardengroup
- Posts: 62
- Joined: Tue Jun 28, 2016 10:11 am
Re: Recurring Database Connection Error
Hello Kyang,
I couldn't find any log for mysql. See the attached output for the files and directories in /var/log.
Regards,
I couldn't find any log for mysql. See the attached output for the files and directories in /var/log.
Regards,
You do not have the required permissions to view the files attached to this post.