- On April 22, 2018
Nagios is a free, cross-platform, open source monitoring application for systems, networks & infrastructures. Nagios provides complete monitoring of Amazon Web Services.
Various Nagios plugins are available that can be used to monitor resources in AWS. They can be customized to suit your needs.
The article covers how to deploy a Nagios Virtual Appliance and how to add EC2 windows instance to Nagios for Monitoring. The process for adding other resources uses different wizards to guide you through the configuration purposes.
- Nagios server
- AWS windows EC2 instance. Click here to see instructions.
- vSphere client
Implementing effective Amazon Web Services monitoring with Nagios offers the following benefits:
- Increased server, services, and application availability
- Fast detection of network outages
- Fast detection of cloud computing environment problems
AWS monitoring with Nagios
Deploy Nagios appliance
Nagios can be deployed variously, build an AWS EC2 instance in Linux and install Nagios, Launch a Nagios customized instance and add hosts, install on your computer.
For this demonstration, a preconfigured Nagios Virtual appliance is used.It can be used with a VMware player or vSphere client.
Download the Nagios appliance from Nagios IX website
Login to vSPhere client. Go to File > Deploy OVF.
Select the location of the .ova file downloaded above. Click Next
Select the Name, Location of the Datastore and Network
To confirm status of the Nagios server deployment, Login to vSphere Client, navigate to console.
Details of the appliance are displayed on the screen.Take note of the IP address.
Access Nagios Web Interface
Open the Nagios Web interface on your browser at http://Your-server-IP-address/nagios with username as nagiosadmin and password as set while creating Nagios user.In our demonstration the IP is http://192.168.2.122/nagios
Adding monitoring hosts.
The configuration wizard allows set up for new hosts and services to be monitored.
On the Nagios web interface,
Navigate to; Configure Configuration Wizard
In this case, Public IP address of the Windows EC2 instance select the Operating System. Click Next to progress to step 2.
- Under Configuration Wizards, select Windows Server. This will open the Windows Server configuration wizard.
The name is defined in the host_name directive of the host object that is created by the wizard.
- Nagios resolves the IP to the server’s hostname.
- Under the Windows agent section, enter the Agent Password. This password will be used later to install NSClient++ on the Windows EC2 instance.
Select the metrics required to measure performance of the host.
Select the services that will be monitored; Windows IIS, MSSQLSERVER among other applications installed on the host.
Select the processes and the required performance counters.
Configure the monitoring check interval settings.Click Next
Selects the contact group to receive notifications.
Select the Hostgroup to add the server.
Download the NSClient++ depending on the windows version.Click Apply to complete the configuration.
The configuration s successful.
To view the newly added server, go to Home Host Detail and locate the server.
Install NSClient++ – 32 or 64
Connect to the EC2 instance through Remote desktop connection.See instructions here
- Download to your server NSClient++ – 32 or 64-bit version depending on your server configuration from the configuration wizard above.
- Run software package [please be logged as administrator or use Run as…].
- Check Accept End-User license and Click Next
- Click next on custom setup
- Click next on NSClient++ configuration
- Add local IP address of Localhost [127.0.0.1], Nagios server [192.168.2.122] as well as Public IP of Nagios server [X.X.X.X]
- Enable common check plugins
- Enable nsclient server (check_nt)
Uncheck rest of the boxes
Enter password for Nagios servers [can be found on Secret Server for IPD and US servers]
- Click Install
- Click Finish to complete installation – do NOT start the service yet
- Verify under services that NSClient++ is installed and set as automatic start under local system login
- Start Notepad++ as administrator and open file NSC.cfg located under C:Program Files\NSClient++
Uncomment Port line under NSClient section and save change
- Start NSClient++ service
It concludes NSClient++ set up on client side.The device can now be monitored using Nagios.
Nagios as a monitoring tool has graphs and reports that can be generated from time to time.On a dashboard, one can view the health of all the hosts monitored and take proactive measures.
Below are some of the graphs from the AWS host added for monitoring;
Performance graph of EC2 Windows instance.
Performance metrics graph.
The AWS windows EC2 instance was shut down as seen below and this was updated in the Nagios.
Host status on Nagios indicate that the host is not available.
Nagios is an excellent tool to monitor any infrastructure. Immediate notification of a service outage, before customers and end users experience any problems enables the IT team to respond to the issues and reduces the turn-around time to its resolution.
As much as a great tool it is, it requires many configurations as most of the functionalities come as plugins. This may scare some IT professionals from using it. However other free alternatives are available – e.g. our favorite Zabbix which we’ll write about in some of our next posts.