Cd nagios-plugins-2.1.1./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl make all make install Start Nagios If everything worked correctly prior to this, you will be able to start your Nagios Core service. Nagios Remote Plugin Executor (NRPE) is used to remotely execute Nagios plugins on Linux/Unix machines. This makes it easy to monitor remote machine metrics such as disk usage, CPU load, number of running processes, logged in users etc.
Following previous tutorials concerning Zabbix series, this article describes how to install and setup an instance of Zabbix agent to run as a service on Microsoft Windows systems in order to monitor your infrastructure windows environments, especially server machines.
Install Agent and Add Windows Host to Zabbix Monitoring
Requirements
Installing and Configuring Zabbix on Debian 8 and RHEL/CentOS 7 – Part 1
Related Guides
How to Configure ‘Zabbix Monitoring’ to Send Email Alerts to Gmail Account – Part 2
How to Install and Configure Zabbix Agents on Remote Linux Systems – Part 3
Step 1: Download and Install Zabbix Agent on Windows
1. The pre-compiled zip agents for Windows environments can be obtained from official Zabbix download page and manually installed and started on the system using windows Command Prompt as in the following example:
Example, suppose you’ve downloaded and extracted the Zabbix agent zip archive to D:Downloadszabbix_agents_2.4.4.win, run the following command to install the service:
Nagios Core For Windows
2. After the service has been installed on your windows host, open zabbix_agentd.win.conf file and manually edit the following parameters:
3. To start the service just type:
To stop the service run the same command as above with
--stop
argument and to uninstall the service use the --uninstall
argument.Configure Zabbix Windows Agent
4. A second and more convenient method to install and automatically configure Zabbix agent on Windows environments is by downloading Zabbix Agent installer msi package specific for your system architecture by visiting the link: http://www.suiviperf.com/zabbix/index.php.
5. Once the Zabbix agent msi file has been downloaded on your system, run it and supply the required information in order to configure and install the agent on the target monitored host as it follows:
Install Nagios Client On Windows 7
If you need to modify Zabbix configuration file with other custom values at a later date, the conf file can be found on %programfiles%Zabbix Agent path.
6. After you’ve finished the setup, open a windows Command Prompt with Administrator privileges, run services.msc command in order to open Windows Services utility and locate Zabbix Agent service to check if the service is running and automatically started after reboot.
From this console you can manage the service (start, stop, pause, resume, enable or disable).
Zabbix Agent Windows Service
Step 2: Configure Windows Firewall and Test Zabbix Agent
7. Almost all Windows based systems have Windows Firewall active and running, therefore zabbix agent port must be opened in firewall in order to communicate with zabbix server.
In order to open Zabbix agent port in windows firewall, open Control Panel -> System and Security – > Windows Firewall and hit on Allow an app through Windows Firewall.
8. Next, click on Allow another app button and a new window should open. Use the Browse button to navigate and add Zabbix agent executable file (usually found in %programfiles%Zabbix Agent if you installed it using msi program), then hit on Add button to add the service.
Add Zabbix Agent
9. Next, make sure you check and open the firewall rule on the network segment where zabbix server is located in your network and hit OK button to finish and apply configuration.
Allow Zabbix Agent on Windows Firewall
10. In order to test if Zabbix agent running on windows is reachable from Zabbix server side, use telnet or netcat command on zabbix server against windows agent IP-Port and a Connected message should appear. Hit Enter key to generate an error message and automatically disconnect from agent:
Step 3: Add Zabbix Agent Monitored Windows Host to Zabbix Server
![Nagios Nagios](/uploads/1/2/6/0/126081909/783862953.png)
11. Once the windows agent has been tested from command line and everything looks fine, go to Zabbix Server web interface, move to Configuration tab -> Hosts and hit on Create Host button in order to add the Windows monitored host.
Add Windows Host to Zabbix
12. On Host window add the FQDN of your windows agent machine in Host name filed, add an arbitrary name to Visible name filed in order to easily identify the monitored machine on Zabbix panel, make sure the host is included into a Group Servers and add the IP Address of your windows host in Agent interfaces filed. The Port value leave it unchanged.
13. Next, go to Template tab and hit on Select button. A new window with Zabbix Templates should appear. Navigate through this window, check Template OS Windows and hit on Select button to add the template.
Zabbix Template OS Windows
14. Once the Template OS Windows appears on Link new templates filed, hit on Add button in order to link this template to the windows host configuration.
Finally, after the Template OS Windows is visible in Linked Templates filed hit on below Add button to complete the process and add the entire Windows host configuration.
Zabbix Linked Windows Templates
15. After your monitored windows machine has been added return to Configuration -> Hosts and the windows Host should now be present in this window as illustrated on below screenshot.
Check Windows Host in Zabbix
That’s all! Just assure that your windows host Status is set to Enabled and wait a few minutes in order for Zabbix server to contact the windows agent side and process the received remote data.
As an example, to get a graphical inside of the CPU load on the monitored Windows machine go to Zabbix web console Monitoring tab -> Graphs, select the windows machine host name and CPU load Graph and all the collected data so far should be presented into a nice graphical chart.
Share
Learning has never been so easy!
NSClient++ is a windows service that allows performance metrics to be gathered by Nagios (and possibly other monitoring tools). It is an attempt to create a NSClient and NRPE compatible but yet extendable performance service for windows. This guide covers how to install and configure NSClient++ to work with a Nagios Server to collect these metrics.
10 Steps total
Step 1: Download Stable version of NSClient++
Download the Stable version of NSClient++ from http://www.nsclient.org/download/ . There is both a 32 bit and 64bit version so select the one that is right for the target PC.
Step 2: Run Installation binary
Run in Installation binary file just downloaded on the Windows PC. Click Next to start the installation process. Select Typical Installation.
Step 3: Accept the End-User License Agreement
Click the tick box to accept the terms of the agreement then click Next to continue.
Step 4: Choose the Setup Type
Select Typical at the Setup Type unless you have a reason to use one of the other choices.
Step 5: Set path for configuration file
Accept the default for the configuration file path, unless you have a requirement for it to be elsewhere.
Tick the box to install the sample configuration file. Leave the box clear allowing all users write access unless this is something you want to do.
Tick the box to install the sample configuration file. Leave the box clear allowing all users write access unless this is something you want to do.
Step 6: Set NSClient++ Configuration
In the next step you will need to configure the NSClient++ agent. These steps
are important! Make sure you:
• Enter the IP address of the Nagios XI or Nagios Core server in the
Allowed hosts box.
• Enter a password in the NSClient password box that will be required
for communication between the Nagios server and the Windows
machine.
• Check the following boxes in the Modules to load section:
◦ Enable common check plugins
◦ Enable nsclient server (check_nt)
Click Next to continue
are important! Make sure you:
• Enter the IP address of the Nagios XI or Nagios Core server in the
Allowed hosts box.
• Enter a password in the NSClient password box that will be required
for communication between the Nagios server and the Windows
machine.
• Check the following boxes in the Modules to load section:
◦ Enable common check plugins
◦ Enable nsclient server (check_nt)
Click Next to continue
Step 7: Begin Installation
Click the Install button on the next screen to begin the installation.
Step 8: Finish Installation
When the installation completes, click Finish to complete the setup.
The NSClient++ agent will now be running as a service, which means the
Windows machine is ready to be monitored with Nagios.
The NSClient++ agent will now be running as a service, which means the
Windows machine is ready to be monitored with Nagios.
Step 9: Configure check_nt on Nagios server
You'll need to modify the check_nt command definition to include the password. Open the commands.cfg file for editing.
vi /usr/local/nagios/etc/objects/commands.cfg
Change the definition of the check_nt command to include the '-s ' argument (where PASSWORD is the password you specified on the Windows machine) like this:
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v $ARG1$ $ARG2$
}
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v $ARG1$ $ARG2$
}
Save the file.
Step 10: Restart Nagios Service
To apply the changes you need to restart Nagios by running the following command;
service nagios restart
Assuming you use the same password for each windows machine you install on you should be now able to get Nagios to monitor that PC using the standard Windows test supplied in the sample config, plus any others you may want to create using the check_nt command. Refer to the Nagios documentation (http://nagios.sourceforge.net/docs/nagioscore/4/en/) for more information on how to configure these checks or for more details about Nagios.
References
- Monitoring Windows Machines
- Nagios XI – Installing The Windows Agent
1 Comment
- Ghost ChiliNick42 Aug 20, 2014 at 07:26amWell done howt-to. If I could offer up one thing, you might want to cover setting the port number on the client (just in case you need to use a different port), and modifying the Windows firewall if active. :)