This is the third part in a series on how to add Windows Host to Nagios Ubuntu Server. In this guide you will learn about some more advanced options for configuring your server, such as customizing Samba and using Iptables.
In this article, we will learn how to add a Linux host to Nagios Ubuntu Server. In the previous article, we learned how to install and configure Nagios on Ubuntu Server. We also installed NRPE plugin which allows us to monitor our Linux hosts with Nagios. This article is continued from the last article where we learned how to add a Windows host using the same process.
We learned how to install Nagios on an Ubuntu server and add a remote Linux host to the Nagios server for convenient monitoring of its specified services in Parts 1 and 2 of this Nagios server article series. The third and last installment of this article series will demonstrate how to add a remote Windows host to the Nagios server.
The Windows operating system design is similar to that of the Linux operating system, and it includes crucial OS services that are vital to your machine’s performance. Memory consumption, disk use, and CPU load are among them.
To monitor Windows OS services remotely from an Ubuntu-hosted Nagios server, the Windows machine must first install the NSClient++ addon, which functions as a Windows-to-Nagios proxy, allowing Nagios and Windows to interact through the checknt plugin from the Nagios Monitoring Server.
The following is a list of the procedures required to remotely add and monitor a Windows host using a Nagios server:
- On the Windows host, install the NSClient++ extension.
- Adding monitoring setups for Windows hosts to the Nagios server.
- Windows host and service definitions are added to the Nagios server.
- The Nagios service daemon is being restarted/reloaded.
NSClient++ Agent Installation on a Windows Host
To get a stable copy of the NSClient++ agent program, go to the NSClient download page from your Windows host system.
Then, open the msi installer’s installation wizard and follow the installation instructions to complete the needed installation setup.
Install NSClient in Windows
Choose NSClient Setup in Windows
Configure NSClient in Windows
Include your Ubuntu Nagios server’s IP address.
Configure the IP address of the Nagios server in NSClient.
It should take less than a minute to finish the installation.
Installing NSClient on Windows
Adding a Windows Host to an Ubuntu Server with Nagios
Return to the Nagios server in Ubuntu and open the windows.cfg configuration file.
$ sudo nano /usr/local/nagios/etc/objects/windows.cfg $ sudo nano /usr/local/nagios/etc/objects/windows.cfg
Make care to adjust the host name and alias values in the following host definition item. In addition, the address parameter should refer to your Windows host’s IP address.
Windows Server address 192.168.100.7; IP address of Windows host configure host using windows-server host name LinuxShellTips winserver alias LinuxShellTips
There are also certain services that have already been activated and will be watched by the Ubuntu Nagios server. However, you are free to add additional. These service definitions’ host name component should match the host name portion of the host you specified.
Configuration of Nagios for Windows
Save and close the file when you’re finished.
Open the primary configuration file, nagios.cfg.
nano /usr/local/nagios/etc/nagios.cfg $ sudo nano /usr/local/nagios/etc/nagios.cfg
As seen below, trace and uncomment the windows.cfg file. This change allows the Nagios server to monitor the Windows machine and its related services.
In Nagios, enable Windows Configuration.
The file should be saved and closed.
Make sure there are no problems in your Nagios setup.
$ sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg Verify Nagios Configuration
Finally, the Nagios service should be restarted.
$ sudo nagios service restart
Refresh the web interface for Nagios Monitoring. All stated system services should be monitored by the remote Windows host.
In Nagios, keep an eye on the Windows Host.
The services that are monitored and specified by the file /usr/local/nagios/etc/objects/windows.cfg are also shown, as seen below.
Nagios may be used to keep track of Windows services.
We’ve successfully installed the Nagios server on Ubuntu and showed how to add both Linux and Windows host systems for continuous monitoring of their related services and host status in this last part of the three-part Nagios essay series.
In the previous article, we have installed Nagios on Ubuntu. In this tutorial, we will configure the nagios server and client to communicate with each other. Reference: nagios server and client configuration step by step.
Frequently Asked Questions
How do I add a Windows host to Nagios monitoring server?
A:
If you are running Windows, you will be able to add a new host through the traditional way of Active Directory. This can also be done by editing the hosts file but this is not recommended as it may cause some issues beyond your control. For example, if there is already an entry for localhost in the hosts file and another one with a similar IP address like 192.168.1.10 then they both would send notifications when something happens on their respective network segment
How do I add a host to Nagios monitoring?
A: Nagios uses a client-server architecture and has an external process, the nagios server, which monitors host resources. The only way to add hosts is through this external process.
How do I add a Windows host to Nagios monitoring server using Nrpe plugin?
A: There are many ways to do this. One way is by installing the nrpe plugin, then by creating a command file that all your hosts will run, and adding them as cron jobs on your servers control panel. Another way would be through SSH, which you can try with ssh -C [your-ssh-username]@[your-ip].
Related Tags
- how to add multiple host in nagios core
- how to add host in nagios for monitoring ubuntu
- how to add host in nagios for monitoring centos 7
- nagios monitor remote server
- nagios windows monitoring