new Installation failed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: new Installation failed

Post 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
scharft
Posts: 112
Joined: Wed Jul 29, 2015 6:55 am

Re: new Installation failed

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: new Installation failed

Post 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:

Code: Select all

systemctl 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
scharft
Posts: 112
Joined: Wed Jul 29, 2015 6:55 am

Re: new Installation failed

Post 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:x:987:984::/var/spool/nagios:/bin/bash
nagiosadmin:x:1002:666:Nagios ADM:/home/nagiosadmin:/bin/bash
[root@itrinag001 tmp]# grep nag /etc/group
nagios:x:984:nrpe,apache,nagios,snmptt
nagcmd:x:1000:apache,nagios

After checking the sql.log please provide available remote sessions to fix this together.

best thomas
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: new Installation failed

Post 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
scharft
Posts: 112
Joined: Wed Jul 29, 2015 6:55 am

Re: new Installation failed

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: new Installation failed

Post 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:

Code: Select all

systemctl status mariadb
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
scharft
Posts: 112
Joined: Wed Jul 29, 2015 6:55 am

Re: new Installation failed

Post 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
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: new Installation failed

Post 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:x:987:984::/var/spool/nagios:/bin/bash
/etc/passwd:nagiosadmin:x:1002:666:Nagios ADM:/home/nagiosadmin:/bin/bash
/etc/group:nagios:x:984:nrpe,apache,nagios,snmptt
/etc/group:nagcmd:x: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:

Code: Select all

systemctl restart nagios
Now, please try Apply Configuration again.


Regards,
Vinh
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: new Installation failed

Post by vtrac »

NOTE: locking thread, since Support Ticket has already been opened:
https://support.nagios.com/tickets/scp/ ... p?id=14785


Vinh
Locked