Nagios Core Password Restore

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dhineshkumar
Posts: 22
Joined: Wed Jul 22, 2015 8:32 am

Nagios Core Password Restore

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core Password Restore

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
dhineshkumar
Posts: 22
Joined: Wed Jul 22, 2015 8:32 am

Re: Nagios Core Password Restore

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core Password Restore

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked