Page 2 of 2

Re: mysql.sock

Posted: Tue Mar 12, 2019 3:12 pm
by jatindeepsharma
lmiltchev wrote:Try:

Code: Select all

mysql -h 10.200.1.152 -u nagios -pnagios nagios -e 'TRUNCATE TABLE nagios_logentries'
from the Nagios XI server or ssh into the offloaded mysql server, and run the command locally:

Code: Select all

mysql -u nagios -pnagios nagios -e 'TRUNCATE TABLE nagios_logentries'

Hi still getting, Access denied

mysql -h 10.200.1.152 -u nagios -pnagios nagios -e 'TRUNCATE TABLE nagios_logentries'
ERROR 1045 (28000): Access denied for user 'nagios'@'10.200.1.152' (using password: YES)

Re: mysql.sock

Posted: Tue Mar 12, 2019 3:32 pm
by lmiltchev
Is your password "nagios"? You didn't actually show it, so I am not sure...
[root@NagiosXI nagiosxi]# grep ndoutils -5 /usr/local/nagiosxi/html/config.inc.php |grep pwd
"pwd" => 'xxxxxx',
You need to use the actual password as defined in the /usr/local/nagiosxi/html/config.inc.php file.

Run:

Code: Select all

mysql -h 10.200.1.152 -u nagios -pxxxxxx nagios -e 'TRUNCATE TABLE nagios_logentries'
substituting "xxxxxx" with your actual password. For example, if your password was "welcome", you would run:

Code: Select all

mysql -h 10.200.1.152 -u nagios -pwelcome nagios -e 'TRUNCATE TABLE nagios_logentries'
I also hope that you followed all of the steps, outlined in our document here: https://assets.nagios.com/downloads/nag ... Server.pdf, granting permissions, testing the connection, etc. I would recommend that you double check that.

Re: mysql.sock

Posted: Tue Mar 12, 2019 9:23 pm
by jatindeepsharma
My actual password is nagios

Re: mysql.sock

Posted: Tue Mar 12, 2019 9:37 pm
by jatindeepsharma
lmiltchev wrote:Is your password "nagios"? You didn't actually show it, so I am not sure...
[root@NagiosXI nagiosxi]# grep ndoutils -5 /usr/local/nagiosxi/html/config.inc.php |grep pwd
"pwd" => 'xxxxxx',
You need to use the actual password as defined in the /usr/local/nagiosxi/html/config.inc.php file.

Run:

Code: Select all

mysql -h 10.200.1.152 -u nagios -pxxxxxx nagios -e 'TRUNCATE TABLE nagios_logentries'
substituting "xxxxxx" with your actual password. For example, if your password was "welcome", you would run:

Code: Select all

mysql -h 10.200.1.152 -u nagios -pwelcome nagios -e 'TRUNCATE TABLE nagios_logentries'
I also hope that you followed all of the steps, outlined in our document here: https://assets.nagios.com/downloads/nag ... Server.pdf, granting permissions, testing the connection, etc. I would recommend that you double check that.


I have two servers, one is NagiosXI(10.200.1.150) & other is 10.200.1.152(nagiossql), I ran above command on nagios sql server but its providing me output as:

Re: mysql.sock

Posted: Tue Mar 12, 2019 10:45 pm
by jatindeepsharma
jatindeepsharma wrote:
lmiltchev wrote:Is your password "nagios"? You didn't actually show it, so I am not sure...
[root@NagiosXI nagiosxi]# grep ndoutils -5 /usr/local/nagiosxi/html/config.inc.php |grep pwd
"pwd" => 'xxxxxx',
You need to use the actual password as defined in the /usr/local/nagiosxi/html/config.inc.php file.

Run:

Code: Select all

mysql -h 10.200.1.152 -u nagios -pxxxxxx nagios -e 'TRUNCATE TABLE nagios_logentries'
substituting "xxxxxx" with your actual password. For example, if your password was "welcome", you would run:

Code: Select all

mysql -h 10.200.1.152 -u nagios -pwelcome nagios -e 'TRUNCATE TABLE nagios_logentries'
I also hope that you followed all of the steps, outlined in our document here: https://assets.nagios.com/downloads/nag ... Server.pdf, granting permissions, testing the connection, etc. I would recommend that you double check that.


I have two servers, one is NagiosXI(10.200.1.150) & other is 10.200.1.152(nagiossql), I ran above command on nagios sql server but its providing me output as:
Dear Team/lmiltchev,
mysql -h 10.200.1.152 -u nagios -pwelcome nagios -e 'TRUNCATE TABLE nagios_logentries' command worked for me & my server is working fine after repairing database. thank you so much guys for your cooperation 8-)

Re: mysql.sock

Posted: Wed Mar 13, 2019 9:04 am
by lmiltchev
I am glad I could help! I will be locking this topic now. If you have any further questions/issues, please start a new thread. Thank you!