Page 1 of 1
Error when trying to import Hosts
Posted: Mon Jan 09, 2017 3:52 pm
by nthaler
Hello!
I went to add some hosts to our Nagios-XI instance and am receiving and error when I use Import Config Files from the CCM.
I am able to add hosts through the UI.
I have previously added over 1000 hosts via the import tool.
The error I am receiving is;
Field 'name' doesn't have a default valueEntry host_name::drupal-dev-mysql01 inside tbl_host could not be inserted: Field 'name' doesn't have a default value
We offloaded the MySQL DB after out intial upload of Hosts and Services and I am wondering if that has something to do with the error?
Any ideas on what I need to change to fix this so I can import hosts again?
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 4:02 pm
by tgriep
Can you login to the XI server as root, run the following command and post the output? Replace xxx.xxx.xxx.xxx with the IP address of your MYSQL server.
Code: Select all
echo 'desc tbl_host;' | mysql -t -u nagiosql -pnagios --databases nagiosql -h xxx.xxx.xxx.xxx
We should be able to see if the database settings are correct for the remote MYSQL server.
Also, can you upload the host config file you are trying to import so we can view it?
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 4:04 pm
by tgriep
One more thing, can you post the /etc/my.cnf file and the files in this folder /etc/my.cnf.d folder from the MYSQL server?
Thanks
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 4:11 pm
by nthaler
When I run that I am getting the following
[root@nagios-02 ~]# echo 'desc tbl_host;' | mysql -t -u nagiosql -p nagios --databases nagiosql -h 10.220.50.1
mysql: unknown option '--databases'
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 4:15 pm
by dwhitfield
You might have PMed these, but can you post the /etc/my.cnf file and the files in this folder /etc/my.cnf.d folder from the MYSQL server?
If you did PM them, please update this thread so it will pop back up on our dashboard.
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 4:16 pm
by tgriep
Whoops, no "s" in that option, try this instead.
Code: Select all
echo 'desc tbl_host;' | mysql -t -u nagiosql -pnagios --databases nagiosql -h xxx.xxx.xxx.xxx
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 4:27 pm
by nthaler
I sent you the my.cnf
I don't see a difference in the 2 commands you asked me to run.
echo 'desc tbl_host;' | mysql -t -u nagiosql -pnagios --databases nagiosql -h xxx.xxx.xxx.xxx
echo 'desc tbl_host;' | mysql -t -u nagiosql -pnagios --databases nagiosql -h xxx.xxx.xxx.xxx
Host file I am trying to import.
define host {
use host
host_name drupal-dev-mysql01
alias drupal-dev-mysql01
address drupal-dev-mysql01.highwire.org
hostgroups dev-servers
}
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 4:46 pm
by tgriep
I took a look at the my.cnf file from your mysql server and the following needs to be changed.
Edit the /etc/my.cnf file and change the following from
Code: Select all
sql-mode='STRICT_TRANS_TABLES,STRICT_ALL_TABLES,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
to
Code: Select all
sql-mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
Save the file and restart the mysql server by running this command
The XI server cannot save entries in to the MYSQL server while it is setup in the STRICT mode.
Re: Error when trying to import Hosts
Posted: Mon Jan 09, 2017 6:14 pm
by nthaler
This looks to have fixed it.
Thank you!
Re: Error when trying to import Hosts
Posted: Tue Jan 10, 2017 9:23 am
by rkennedy
Awesome! Going to lock this one up and mark it resolved.