You must have an existing Nagios Network Analyzer installation using default passwords. This document assumes you have not already changed any of the passwords.
All of these password changes are completely optional, however it is typically a good idea to change default password settings for any software package. This will help secure your Nagios Network Analyzer software from security threats and network compromises.
For every example throughout this document you are setting the password to NewPassword which represents the password you will be changing the defaults to. When updating files on the Linux server or running commands replace NewPassword with the password of your choice.
MySQL is the database used by Nagios Network Analyzer in RHEL / CentOS 6.x, however in RHEL / CentOS 7.x onwards MariaDB is used instead of MySQL. MariaDB is simply a fork of the MySQL database, the commands issued in this documentation will work with either product. If there are any differences they will be clearly identified.
In many steps of this documentation you will be required to edit files. This documentation will use the vi text editor. When using the vi editor:
To make changes press i on the keyboard first to enter insert mode
Press Esc to exit insert mode
When you have finished, save the changes in vi by typing :wq and press Enter
Start by logging into the Linux server as the root user. Run the passwd command from the Linux command line with no arguments.
Changing password for user root.
New UNIX password: NewPassword
Retype new UNIX password: NewPassword
There are two important accounts for the MySQL database in a Nagios Network Analyzer installation: root and nagiosna. Each must be changed individually and in several places. This will by done from the Linux command line as the root user.
First you will change the password for the root user in the MySQL database. To do so you will use the mysqladmin command and enter a new password, replace your new password in the command for NewPassword. Note the old password is welcome.
mysqladmin -u root password NewPassword
Next you will need to alter the files where the password for the root user is referenced. Locate the old password and replace it with your NewPassword.
Replace mysqlpass="nagiosna" with mysqlpass="NewPassword"
Altering users passwords with MySQL requires a few different commands and different files will need to be modified. The following commands will be used to alter the fusion user account for the MySQL database.
After executing this command you will be prompted for the MySQL root password.
mysql -u root -p
You are now logged into the mysql command interface, this is indicated by the mysql> OR MariaDB [(none0]> prompt. Type each command as follows:
set password for 'nagiosna'@localhost= password('NewPassword');
Next you need to alter the files where the password for the nagiosna user is referenced.
Replace $config['db']['password'] = 'nagiosna' with 'NewPassword'
Save the file, you have finished making changes.
Article ID: 913
Created On: Thu, Nov 11, 2021 at 11:11 AM
Last Updated On: Thu, Nov 11, 2021 at 11:11 AM
Authored by: rspielman
Online URL: https://support.nagios.com/kb/article/changing-default-passwords-in-nagios-network-analyzer-913.html