Page 2 of 2
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 10:17 am
by tgriep
The nagios account has to be able to login to the system to run it's processes, apps, etc...
To fix this, edit the /etc/passwd file and change this line from
Code: Select all
nagios:x:994:992::/var/spool/nagios:/sbin/nologin
to
Code: Select all
nagios:x:994:992::/var/spool/nagios:/bin.bash
Save the file and see if you can import the files and run this on the system as the nagios user.
Code: Select all
cd /usr/local/nagiosxi/scripts
su nagios
./reconfigure_nagios.sh
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 10:26 am
by pratik.patel
same issue:
Code: Select all
1 items failed to import successfully Hide Details
Field 'name' doesn't have a default valueEntry timeperiod_name::24x7 inside tbl_timeperiod successfully inserted
Entry timeperiod_name::workhours inside tbl_timeperiod successfully inserted
Entry timeperiod_name::nonworkhours inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::08-24x7 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::08-20x7 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::08-18x5 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::08-17x5 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::07-18x5 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::06-23x7 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::07-23x7 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::09-10x7 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::08:30-22x5 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::09:00-22x2 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::BAA-workhours inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::holly_settled inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::08-22x7 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::08:30-22x5_09-22x2 inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Entry timeperiod_name::ntp_settled inside tbl_timeperiod could not be inserted: Field 'name' doesn't have a default value
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 10:29 am
by tgriep
Save the timeperiods.cfg file in the /usr/local/nagios/etc/import folder then run the following in a shell on the server and post the output.
Code: Select all
cd /usr/local/nagiosxi/scripts
su nagios
./reconfigure_nagios.sh
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 10:38 am
by pratik.patel
Code: Select all
[root@nagios import]# cd /usr/local/nagiosxi/scripts
[root@nagios scripts]# su nagios
bash-4.2$
bash-4.2$
bash-4.2$ ./reconfigure_nagios.sh
PHP Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50550 Library:100118 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
PHP Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50550 Library:100118 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
PHP Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50550 Library:100118 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=vTlQaPbjqFCS' -O nagiosql.login--2017-06-19 16:34:46-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’
[ <=> ] 36,398 --.-K/s in 0.05s
2017-06-19 16:34:47 (683 KB/s) - ‘nagiosql.login’ saved [36398]
LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
[0] => timeperiods.cfg
)
IMPORTING /usr/local/nagios/etc/import/timeperiods.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=admin&type=import&importsubmitted=true&chbOverwrite=1&subForm=Import&selImportFile[]=/usr/local/nagios/etc/import/timeperiods.cfg' -O nagiosql.import.monitoring
--2017-06-19 16:34:48-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.import.monitoring’
[ <=> ] 315,467 --.-K/s in 0.04s
2017-06-19 16:34:49 (7.71 MB/s) - ‘nagiosql.import.monitoring’ saved [315467]
RESETTING PERMS
PHP Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50550 Library:100118 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
PHP Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50550 Library:100118 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
PHP Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50550 Library:100118 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysqli.inc.php on line 125
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=vTlQaPbjqFCS' -O nagiosql.login--2017-06-19 16:34:49-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’
[ <=> ] 36,398 --.-K/s in 0.05s
2017-06-19 16:34:50 (785 KB/s) - ‘nagiosql.login’ saved [36398]
LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2017-06-19 16:34:50-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.export.monitoring’
[ <=> ] 21,804 --.-K/s in 0.02s
2017-06-19 16:34:53 (1.20 MB/s) - ‘nagiosql.export.monitoring’ saved [21804]
WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 12 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 363 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Note: my db is on different server
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 1:40 pm
by tgriep
It looks like there is a package conflict on the Nagios server and that could be another issue that is causing the import to fail.
Can you run the following on the Nagios server and post the output?
Code: Select all
uname -a
cat /etc/*release*
yum list installed |grep mysql
yum list installed |grep php
From the remote MYSQL server, can you post the /etc/my.cnf file and all of the files in the /etc/my.cnf.d folder if they exist?
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 3:48 pm
by pratik.patel
its just a warning. I was able to import using 5.4.4 version before. At that time also I was getting this warning.
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 3:56 pm
by tgriep
They maybe warning but after the upgrade, they could be the cause.
From the remote MYSQL server, can you post the /etc/my.cnf file and all of the files in the /etc/my.cnf.d folder if they exist?
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Mon Jun 19, 2017 4:51 pm
by pratik.patel
Code: Select all
[root@nagios scripts]# uname -a
Linux nagios.eckoh.com 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@nagios scripts]#
[root@nagios scripts]# cat /etc/*-release
CentOS Linux release 7.3.1611 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)
[root@nagios scripts]#
[root@nagios scripts]# yum list installed |grep mysql
php-mysql.x86_64 5.4.16-42.el7 @base
[root@nagios scripts]# yum list installed |grep php
php.x86_64 5.4.16-42.el7 @base
php-cli.x86_64 5.4.16-42.el7 @base
php-common.x86_64 5.4.16-42.el7 @base
php-gd.x86_64 5.4.16-42.el7 @base
php-ldap.x86_64 5.4.16-42.el7 @base
php-mbstring.x86_64 5.4.16-42.el7 @base
php-mcrypt.x86_64 5.4.16-7.el7 @epel
php-mssql.x86_64 5.4.16-7.el7 @epel
php-mysql.x86_64 5.4.16-42.el7 @base
php-pdo.x86_64 5.4.16-42.el7 @base
php-pear.noarch 1:1.9.4-21.el7 @base
php-pear-HTML-Template-IT.noarch 1.3.0-2.el5 installed
php-pecl-ssh2.x86_64 0.12-1.el7 @epel
php-pgsql.x86_64 5.4.16-42.el7 @base
php-process.x86_64 5.4.16-42.el7 @base
php-snmp.x86_64 5.4.16-42.el7 @base
php-xml.x86_64 5.4.16-42.el7 @base
[root@msql ~]# cat /etc/my.cnf
# Percona Server template configuration
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
bind-address = x.x.x.x //my ip address
port = 3306
local-infile = 0
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
no files in the /etc/my.cnf.d folder
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Tue Jun 20, 2017 8:41 am
by tgriep
The issue is the STRICT_TRANS_TABLES setting in the my.cnf file. It has to be removed so that Nagios can update the MYSQL tables.
Edit the my.cnf file on the remote server and change this line from
Code: Select all
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
to
Save the file and restart MYSQL by running
After that, Nagios will be able to update the tables without any errors.
Re: issue with importing config to nagios xi 5.4.5 version
Posted: Tue Jun 20, 2017 8:55 am
by pratik.patel
Working fine now.
Thanks!