In one occasion, I try to access my Nagios monitoring server page and it is very tragic that I forgot the password to access it. Nagios installation itself by default has its primary username to be used for accessing Nagios monitoring server page. The username or the account is ‘nagiosadmin’ and I hardly remembered the password.
This is where the pop-up dialog box appears to ask for username and password to access Nagios monitoring server page where I edited the URL of Nagios monitoring server so it can be hidden :
Another image which is clearly shown the Nagios Administration authentication pop-up dialog box. I edited the image below so the URL of Nagios Administration monitoring server page didn’t shown up :
I remember clearly the username since I used the default username when I installed Nagios which is ‘nagiosadmin’. But the password of that username seems cannot be extracted out of my head.
Below is the prove of myself whom failed to access the Nagios Server Monitoring :
That is why I decided to reset the password. Below is the step I’ve done to achieve it :
1. Login to where your Nagios monitoring server has been installed.
2. Change or reset the password for nagiosadmin by executing the following command in bash prompt :
[username@hostname ]$ htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin htpasswd: cannot open file /usr/local/nagios/etc/htpasswd.users for read/write access [username@hostname ]$
3. Clearly I don’t have permission as standard user to execute the command which actually will modify htpasswd.users. So, I switch to another user whom has higher privilege, ‘root’ in this context :
[username@hostname ]$ sudo su - [sudo] password for username: Last login: Thu Aug 11 23:37:36 xxx 2016 on pts/0 [root@hostname ~]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin New password: Re-type new password: htpasswd: password verification error [root@hostname ~]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin New password: Re-type new password: Adding password for user nagiosadmin [root@hostname ~]# vim /usr/local/nagios/etc/htpasswd.users [root@hostname ~]#
4. The process has succeed and finally I can log in to Nagios monitoring server page.