Well at work I have been messing with a server application call Nagios. This app is used to monitor your servers for certain issues. It can monitor anything from file space to processes running. It will ping servers and you will be notified if it has gone down. Now at first this is a little tricky to setup but once you do it you will get use to it. Now I have this running on Ubuntu servers. I do have some Windows servers but monitoring on those are limited. I will be trying to do this on some other versions of linux like gentoo or red hat. So lets get into this. Before you start this you would want to make sure that you have a configured and working Apache/www server running. You will need this for the GUI interface.
First thing you need to do is find the server that is going to be the master server. The master server will hold the Nagios Server app. To install the server on Ubuntu do the follow:
1 2 | |
During install you will need to tell nagios how you want to setup a mail server. The choices are Internet Site, Internet with smarthost, Satellite system, and Local only. Now the Internet with smarthost will take you thru setting up to use sendmail to point to another mail server. Internet Site will setup sendmail to send mail to the internet by itself. I am going to choose Internet Site. It will ask you for the System mail name will be your domain name.
Now lets setup the nagios user. First thing you want to do is check the /etc/nagios3/cgi.cfg to see what user it is expecting. So open that file and look for this line
1
| |
If you are going to change the username for nagios to the username nagios then when you open the file, I would use vim and do the following command
1
| |
Now it might show you something like nagiosadmin. You are welcome to change this but you will have to change it in multiple places. You are welcome to do that. I changed mine to just nagios as you can see. So save the file and run the following commands
1 2 3 | |
bash
So that should be good for a start. Lets start Nagios or restart it.
1
| |
Now in your web browser go to http://ipaddress/nagios3
If something goes wrong or you get permissions error you might have to check the cgi.cfg to make sure your usernames match up. So now that you have a working install it is time to go over some configuration stuff. So lets check the first service that is setup in nagios. Open the localhost_nagios2.cfg in the /etc/nagios3/conf.d/
1 2 3 4 5 6 7 | |
This file does not require and editing really. One last thing we want to edit is the contacts.cfg All you have to edit here is the email line to match your email address.
Here below is a video of what I have done above: