Page 3 of 3
Re: new Installation failed
Posted: Tue Jun 15, 2021 11:33 am
by vtrac
Hi,
How are you doing?
Do you have internet connection on your Nagios XI machine (server)?
Were you able to generate the "profile.zip" file?
If you're unable to generate the the profile through the web interface,
please try generating it from the command line by running these commands as root:
Code: Select all
rm -rf /usr/local/nagiosxi/var/components/profile*
/usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT
Best Regards,
Vinh
Re: new Installation failed
Posted: Fri Jun 25, 2021 2:03 am
by scharft
Hi
I'm doing good, thank you.
Yes the VM has connection to the internet but over a proxy because it's in DMZ network.
The profile is attached
best regards,
thomas
Re: new Installation failed
Posted: Fri Jun 25, 2021 10:39 am
by vtrac
Hi,
This is a NEW clean install, not sure why it caused so many issue.
I am still thinking that the install never finished or completed correctly.
Do you have the install log under "/tmp"?
Is your database local? .... meaning on the Nagios XI machine.
I looked inside the "profile.zip" and do not see the "database.log"
However, I noticed this error inside the "nagios.log" .... meaning your database is NOT running.
Code: Select all
[1624338363] NDO-3: Unable to prepare statement for query (21): Unknown MySQL error
[1624338363] NDO-3: Unable to prepare statement for query (22): Lost connection to MySQL server during query
[1624338363] NDO-3: Unable to prepare statement for query (23): MySQL server has gone away
[1624338363] NDO-3: Unable to prepare statement for query (24): MySQL server has gone away
[1624338363] NDO-3: Unable to prepare statement for query (25): MySQL server has gone away
[1624338363] NDO-3: Unable to prepare statement for query (26): MySQL server has gone away
[1624338363] NDO-3: Unable to prepare statement for query (27): MySQL server has gone away
[1624338363] NDO-3: mysql_ping: Unknown error. Is the database running?
[1624338363] Caught SIGSEGV, shutting down...
and also this error .... meaning you do not have enough session defined.
Code: Select all
Jun 25 08:48:01 itrinag001 crond[836525]: pam_systemd(crond:session): Failed to create session: Maximum number of sessions (8192) reached, refusing further sessions.
Jun 25 08:48:01 itrinag001 crond[836524]: pam_systemd(crond:session): Failed to create session: Maximum number of sessions (8192) reached, refusing further sessions.
Please make sure to include the followings inside the "/etc/security/limits.conf" files:
Code: Select all
* hard nofile 10000
* soft nofile 10000
root hard nofile 10000
root soft nofile 10000
Please remember to logout then log back in after making changes above.
Now, let try fixing your database, please run the below command:
Code: Select all
/usr/local/nagiosxi/scripts/repair_databases.sh
Now, restart nagios:
Please upload the database log:
Code: Select all
/var/log/mariadb/mariadb.log
or
/var/log/mysql/mysql.log
Also, please run this:
Code: Select all
grep nagios /etc/passwd
grep nag /etc/group
Please following the KB below and set the MAX connection for your database:
https://support.nagios.com/kb/article.php?id=513
Please upload ALL outputs (results) or screenshots to this ticket all of the command ran above.
Best Regards,
Vinh
Re: new Installation failed
Posted: Mon Jun 28, 2021 5:46 am
by scharft
Hi,
yes this is a new fresh install and i'm wondering why so much fails.
[root@itrinag001 tmp]# grep nagios /etc/passwd
nagios

987:984::/var/spool/nagios:/bin/bash
nagiosadmin

1002:666:Nagios ADM:/home/nagiosadmin:/bin/bash
[root@itrinag001 tmp]# grep nag /etc/group
nagios

984:nrpe,apache,nagios,snmptt
nagcmd

1000:apache,nagios
After checking the sql.log please provide available remote sessions to fix this together.
best thomas
Re: new Installation failed
Posted: Mon Jun 28, 2021 9:32 am
by vtrac
Hi,
How are you doing?
I looked at the mysqld.log, there is no error.
What issue are you having right now?
If you are still having issue, please use the below URL to open a support ticket:
Support Tickets
https://support.nagios.com/tickets/
Best Regards,
Vinh
Re: new Installation failed
Posted: Tue Jun 29, 2021 2:05 am
by scharft
Hey,
I'm fine thanks and you?
The error is that nagios doesn't save the configuration and stay on the verification screeen.
Re: new Installation failed
Posted: Tue Jun 29, 2021 9:32 am
by vtrac
Hi,
Hope you are doing good!! ...

I'm very sorry that you have to experience this.
Usually, the issue with apply config is mostly related to database issue and config files not correctly defined.
In this case, I think it is related to database since it is hanging when you do Apply Configuration.
Please make sure your database is running, I assumed that your DB is local on your Nagios XI.
To check if database is running:
Please also check the "/var/log/mariadb/mariadb.log" and see if there is any database issue.
Please run these commands on your Nagios XI machine as "root" to fix the database:
Code: Select all
/usr/local/nagiosxi/scripts/repair_databases.sh
rm -f /usr/local/nagiosxi/var/dbmaint.lock
php /usr/local/nagiosxi/cron/dbmaint.php
Now, we will try to fix the Apply Config issue:
Code: Select all
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
rm -f /usr/local/nagios/etc/import/*
Now, please open the Nagios XI GUI > Configure > Core Config Manager > Config File Management
Now, please click "Delete Files"
Please click "Write Configs"
Please click "Verify Files"
Now, please do "Apply Configure" at the upper left corner of the left panel.
Now, please try the Apply Configuration again.
Best Regards,
Vinh
Re: new Installation failed
Posted: Thu Jul 01, 2021 1:16 am
by scharft
Hey,
I'm doing good and you?
Strange, everything looks fine but when i try to apply the config, the same again:
[root@itrinag001 ~]# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
● mysqld.service - MySQL 8.0 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-07-01 07:41:45 CEST; 4s ago
Process: 379807 ExecStopPost=/usr/libexec/mysql-wait-stop (code=exited, status=0/SUCCESS)
Process: 379954 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 379870 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
Process: 379846 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 379908 (mysqld)
Status: "Server is operational"
Tasks: 40 (limit: 101125)
Memory: 355.7M
CGroup: /system.slice/mysqld.service
└─379908 /usr/libexec/mysqld --basedir=/usr
[root@itrinag001 ~]# /usr/local/nagiosxi/scripts/repair_databases.sh
===============
REPAIR COMPLETE
===============
DATABASE: nagiosql
TABLE:
/var/lib/mysql/nagiosql ~
DATABASE: nagiosxi
TABLE:
/var/lib/mysql/nagiosxi ~
=======================
nagios database repair succeeded
[root@itrinag001 ~]# php /usr/local/nagiosxi/cron/dbmaint.php
Repair Complete: Removing Lock File
[root@itrinag001 ~]# /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
> Return Code: 0
best thomas
Re: new Installation failed
Posted: Thu Jul 01, 2021 10:39 am
by vtrac
Hi,
I noticed that you already has Support Ticket open (below). We should close this forum ticket.
https://support.nagios.com/tickets/scp/ ... p?id=14785
From the outputs of your replied in that ticket:
[root@itrinag001 ~]# grep nag /etc/passwd /etc/group
/etc/passwd:nagios

987:984::/var/spool/nagios:/bin/bash
/etc/passwd:nagiosadmin

1002:666:Nagios ADM:/home/nagiosadmin:/bin/bash
/etc/group:nagios

984:nrpe,apache,nagios,snmptt
/etc/group:nagcmd

1000:apache,Nagios
Looks like the Nagios's home is defined as "/var/spool/nagios", which is wrong.
Please edit the "/etc/passwd" as "root"
Change:
Code: Select all
nagios:x:987:984::/var/spool/nagios:/bin/bash
To:
Code: Select all
nagios:x:987:984::/home/nagios:/bin/bash
Now, make sure "/home/nagios" folder is created, as "root" please run the below commands:
Code: Select all
mkdir -p /home/nagios
chmod 700 /home/nagios
chown nagios.nagios /home/nagios
Now, restart Nagios:
Now, please try Apply Configuration again.
Regards,
Vinh
Re: new Installation failed
Posted: Thu Jul 01, 2021 10:43 am
by vtrac
NOTE: locking thread, since Support Ticket has already been opened:
https://support.nagios.com/tickets/scp/ ... p?id=14785
Vinh