Nagios excels at monitoring a variety of operating systems. Adding a Windows host to the Nagios monitoring server might be challenging for newcomers. Integrating a Windows host into our Nagios environment, on the other hand, may be a simple procedure with the correct steps and advice.
We will discuss how to add a Windows host to our Nagios monitor server in this article. We will go over the prerequisites, configuration stages, and troubleshooting techniques that are required to ensure a successful integration. By following these rules, we will be able to fully utilize Nagios’s capabilities to monitor and manage our Windows systems.
NSClient++ Agent Installation on a Windows Machine
First, download the current stable version NSClient++ addon source files from the following URL:
After downloading, simply start installing it. After completing the whole installation process, start NSClient ++.
Now, select the “Start NSClient ++” option from the “Start” menu to launch the NSClient service.
Press “Windows Key + R”, type “services.msc”, then press ENTER to verify that the service is truly functioning. Make sure that the NSClient service is running by scrolling and searching for it.
Go to the next step if it is running properly.
Setting Up the Nagios Server and Adding the Windows Hosts
Now, log in to Nagios Server and add some object definitions to the Nagios configuration files in order to monitor the new Windows computer. Open the “windows.cfg” file in the Vi editor to make changes.
A sample Windows host definition is already defined for the windows computer. Simply replace the host definition’s host_name, alias, and address columns to the appropriate values for our Windows system.
use windows-server
host_name winserver
alias My Windows Server
address 192.31.21.23
}
The following services are already added and activated in the “windows.cfg” file. If we want to monitor the other service definitions, simply add them to the same configuration file. Be careful to replace the host_name for all services with the host_name that is defined in the preceding step.
use generic-service
host_name winserver
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}
define service {
use generic-service
host_name winserver
service_description Uptime
check_command check_nt!UPTIME
}
define service {
use generic-service
host_name winserver
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}
define service {
use generic-service
host_name winserver
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}
define service {
use generic-service
host_name winserver
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}
define service {
use generic-service
host_name winserver
service_description W3SVC
check_command
}
Finally, remove the comment from the “windows.cfg” file in /usr/local/nagios/etc/nagios.cfg.
cfg_file=/usr/local/nagios/etc/objects/windows.cfg
Finally, look for any error in the Nagios configuration files.
/usr/local/nagios/bin/nagios: This defines the location of the Nagios executable file. It may differ based on where Nagios is installed on our system. It is the main Nagios binary that is in charge of running the monitoring server.
-v: This is a command-line option that stands for “validate” or “verify.” It prompts Nagios to do a configuration validation check instead of starting the server. It guarantees that the Nagios configuration files are correctly formatted and error-free.
/usr/local/nagios/etc/nagios.cfg: This defines the location of the main Nagios configuration file. Again, depending on our system configuration, the real path may differ. The “nagios.cfg” file provides the configuration directives that specify how Nagios works such as host and service definitions, contact information, and various parameters.
Restart the Nagios service once the faults are resolved.
Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.
That’s all. Make sure that the remote Windows host is added and is being watched.
Conclusion
Integrating Windows hosts with a Nagios monitoring server provides the managers with a unified picture of their network environment which allows for proactive management and quick issue resolution. We can smoothly add the Windows hosts to our Nagios monitoring infrastructure by following the methods that are provided in this article.