Assume you already install Ubuntu 9.04 OS, now we can start install Nagios 3 software:
- Install Nagios version 3
# sudo apt-get install nagios3
- Create the web user password file after finished installation of Nagios 3
# sudo htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin
New password: xxxxxxxx
Re-type new password: xxxxxxxx
- Then you should already have a working Nagios!
Open a browser, and go to http://localhost/nagios3/
At the login prompt, login as:
Note: There was a problem with gvfs, you will see the following error message:
Nagios sent error message "DISK CRITIAL - /home/usr/.gvfs is not accessible:Permission denied"
This problem is due to very special permissions set by fuse on the .gvfs directory. The workaround for this problem is here:
>> modify /etc/nagios/conf.d/localhost_nagios2.cfg as follows:
command_line /usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -u GB -A -i .gvfs
service_description Disk Space
# sudo /etc/init.d/nagios3 restart
- If you would like to add a new host for monitoring, then you should add the configuration file for it.
alias server one at lab
address -------- [server1's IP address here]
- Let's create a new hostgroup for occasion, and add new hosts to it.
Edit the file hostgroups_nagios2.cfg and add a new group:
alias Lab Servers
- Now let's associate some services to that host
# vi services_nagios2.cfg
- find the section called "check that ping-only hosts are up", and change the line:
- Verify that your configuration file is ok:
# nagios3 -v /etc/nagios3/nagios.cfg
... You should get:
Total warnings: 0
Total errors: 0
Things look okay - No serious problems are detected during the check.
- Reload/Restart Nagios Services
# /etc/init.d/nagios3 restart
- Go to the web intergace (http://localhost/nagios3) and check the host that you just added.
Once the new host can be monitored from above URL, you are ready to add all your Servers/PCs/Routers/Network Equipments that would like to monitor.
- This requires a bit of planning, but you should have all the elements for doing this...
- Think well about the logical structure of the files - it should be possible for you to do without doing too much work!