Page 1 of 1
Nagios Core Password Restore
Posted: Tue Apr 23, 2019 8:56 am
by dhineshkumar
Hi Team,
The password file htpasswd.users is corrupted, due to which Nagios core login is failing though able to login to NagiosXI. Is there any way to restore the password for all the users from NagiosXI to htpasswd.users file.
Thanks in Advance.
Re: Nagios Core Password Restore
Posted: Tue Apr 23, 2019 1:27 pm
by lmiltchev
You can grab the htpasswd.users file from one of your backups in /store/backups/nagiosxi directory.
Code: Select all
cd /store/backups/nagiosxi
tar xvf xxx.tar.gz
cd xxx
tar xvf nagiosxi.tar.gz usr/local/nagiosxi/etc/htpasswd.users
cd usr/local/nagiosxi/etc/
cp htpasswd.users /usr/local/nagiosxi/etc/
where "xxx.tar.gz" would be the name of your backup, "xxx" would be the name of the directory (after extraction).
You said the file was corrupted, but save a copy of it (just in case), before replacing it with the one from the backup.
Re: Nagios Core Password Restore
Posted: Wed Apr 24, 2019 10:08 am
by dhineshkumar
Thanks for your reply. Unfortunately my backup is also corrupted. Is it possible to restore the password file from the NagiosXI / NagiosSQL MySQL database.
Re: Nagios Core Password Restore
Posted: Wed Apr 24, 2019 10:58 am
by lmiltchev
It is not going to be possible to restore password from the database. If you don't have "good" backups, then the only option would be to clear the contents of the htpasswd.users file:
Code: Select all
cat /dev/null > /usr/local/nagiosxi/etc/htpasswd.users
After clearing the file, log in Nagios XI and change passwords of users. This way, they will be re-added to the htpasswd.users file.