Page 2 of 2

Re: configure_nagios.sh seems to be stuck in a loop

Posted: Thu Apr 29, 2021 12:11 pm
by mccrakem
Hi Benjamin

Sorry to say that did not fix it I did have hopes there for a minute

I did the sudoers file from the steps provided but that still did not allow for the System Profile to be completed via the web page so I had to run the two commands and download the zip file

We have our systems configured by puppet so I had to reenable puppet and that put all the details back into the sudoers file
because of puppet we have the same contents in all the sudoers files on all of our Nagios servers

After running puppet I was tailing the cmdsubsys.log file and it looked good this is what I seen

RETURNCODE=0
.....................................................
PROCESSED 2 COMMANDS
............................................................
PROCESSED 0 COMMANDS
.........................................................
PROCESSED 0 COMMANDS
.........................................................................
PROCESSED 0 COMMANDS
...............................................
PROCESSED 0 COMMANDS
..............................................................
PROCESSED 0 COMMANDS
..........................................................
PROCESSED 0 COMMANDS
..........................................................


But as soon as I Applied the Configuration the system went back into its loop again just applying the config over and over again

See attached files

Re: configure_nagios.sh seems to be stuck in a loop

Posted: Thu Apr 29, 2021 6:18 pm
by ssax

Code: Select all

>>> /etc/sudoers: Alias "NAGIOSXI" already defined near line 116 <<<
>>> /etc/sudoers: Alias "NAGIOSXIWEB" already defined near line 117 <<<
sudo: parse error in /etc/sudoers near line 116
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Please attach your /etc/sudoers and any files in /etc/sudoers.d/.

Additionally, please send the output of these commands:
- NOTE: You may need to adjust the -h 127.0.0.1, the -uroot, and -pnagiosxi in the first command if your DB is offloaded to another server and/or you've changed the root mysql password

Code: Select all

echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -h 127.0.0.1 -uroot -pnagiosxi --table
This next command may fail, that's okay, not all systems run postgresql, send the output anyways:

Code: Select all

echo "SELECT relname as Table, pg_size_pretty(pg_total_relation_size(relid)) As Size, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as ExternalSize FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;" | psql nagiosxi nagiosxi

Re: configure_nagios.sh seems to be stuck in a loop

Posted: Fri Apr 30, 2021 2:41 am
by mccrakem
Please see attached files for files required and outpuut from commands
Thanks

Re: configure_nagios.sh seems to be stuck in a loop

Posted: Fri Apr 30, 2021 7:36 pm
by ssax
Here was the full sudoers error:

Code: Select all

>>> /etc/sudoers: Alias "NAGIOSXI" already defined near line 116 <<<
>>> /etc/sudoers: Alias "NAGIOSXIWEB" already defined near line 117 <<<
sudo: parse error in /etc/sudoers near line 116
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
But you must've fixed that issue because there are no duplicates in there now.

I think adding them to /etc/sudoers caused that since you already have them defined in /etc/sudoers.d/60_opngios.

Please try running these commands as root and let me know if it resolves the issue:

Code: Select all

systemctl stop httpd
systemctl stop crond
systemctl stop npcd
systemctl stop nagios
systemctl stop postgresql
pkill -9 -u nagios
pkill -9 -u apache
pkill -9 -u postgres
rm -f /usr/local/nagiosxi/var/dbmaint.lock
rm -f /usr/local/nagiosxi/var/event_handler.lock
rm -f /usr/local/nagiosxi/var/reconfigure_nagios.lock
rm -f /var/run/nagios/nagios.lock
rm -f /var/run/nagios.lock
rm -f /usr/local/nagios/var/nagios.lock
rm -f /var/run/httpd/httpd.pid
systemctl restart mariadb
systemctl start postgresql
sleep 3
echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | psql nagiosxi nagiosxi
systemctl start nagios
systemctl start npcd
systemctl start crond
systemctl start httpd
systemctl restart snmptt

Re: configure_nagios.sh seems to be stuck in a loop

Posted: Mon May 03, 2021 4:31 am
by mccrakem
Hi

I ran all the above mentioned commands but I'm sorry to say that the issue is still ongoing
The reconfigure script just keeps running constantly

Thanks

Re: configure_nagios.sh seems to be stuck in a loop

Posted: Mon May 03, 2021 12:37 pm
by ssax
Please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/

Thank you!

Re: configure_nagios.sh seems to be stuck in a loop

Posted: Tue May 04, 2021 6:19 pm
by ssax
Locking thread, ticket received, we will continue support through the ticket.

Thank you!