|
| 1 | +**Prerequisite** |
| 2 | + |
| 3 | +Create a test server for running the Nagios_Server playbook on and a windows server VM using [this instruction.](https://github.com/adoptium/infrastructure/blob/master/ansible/README.md#can-i-have-multiple-vms-on-different-oss) |
| 4 | + |
| 5 | +**Adding windows machine to nagios monitoring** |
| 6 | + |
| 7 | +To add a Windows host to a Nagios Server, we require NSClient++ plugin. |
| 8 | + |
| 9 | +The plugin acts as an intermediate between Nagios and Windows server. |
| 10 | + |
| 11 | +Thus, to add Windows host, install NSClient++ plugin in the Windows machine first and then make changes in the Nagios configuration file. |
| 12 | + |
| 13 | + Steps you need to follow in order to monitor a new Windows machine: |
| 14 | + |
| 15 | +1). Perform first-time prerequisites |
| 16 | + |
| 17 | +2). Install a monitoring agent on the Windows machine |
| 18 | + |
| 19 | +3). Create new host and service definitions for monitoring the Windows machine |
| 20 | + |
| 21 | +4). Restart the Nagios daemon |
| 22 | + |
| 23 | +**Changes in Windows server** |
| 24 | + |
| 25 | +1). Login as an administrator to the Windows server. |
| 26 | + |
| 27 | +2). Download and install the [NSclient package](https://www.nsclient.org/download/0.5.1/#0.5.1.45) based on the architecture. |
| 28 | + |
| 29 | +3). After downloading the file, double-click on the .msi file, to begin with, the installation and click on run. |
| 30 | + |
| 31 | +4). A Welcome screen appears, click on Next. Now check "I accept the terms in the License Agreement". |
| 32 | + |
| 33 | +5). Choose Setup type as Typical and click on Next. In the next window, leave the default settings and click Next. |
| 34 | + |
| 35 | +6). Enter the Nagios Server IP in Allowed hosts and check all the modules and click Next then complete the install. |
| 36 | + |
| 37 | + 7). From the start Menu, Start NSClient++ |
| 38 | + |
| 39 | +**Changes In Nagios server** |
| 40 | + |
| 41 | +1). Login to the server where Nagios is installed. |
| 42 | + |
| 43 | +Edit the file windows.cfg using the command. |
| 44 | +```bash |
| 45 | +nano /usr/local/nagios/etc/objects/windows.cfg |
| 46 | +``` |
| 47 | +In the configuration file, enter the details of the Windows server. In host_name, enter the hostname of the Windows server. In the address,specify the IP address of the Windows server. |
| 48 | + |
| 49 | +2). open the Nagios configuration file using the command , |
| 50 | +```bash |
| 51 | +nano /usr/local/nagios/etc/nagios.cfg |
| 52 | +``` |
| 53 | + uncomment the changes below and save. |
| 54 | + |
| 55 | +```bash |
| 56 | +cfg_file=/usr/local/nagios/etc/objects/windows.cfg |
| 57 | +``` |
| 58 | + |
| 59 | +Run a sanity check on the configuration files by running Nagios with the -v command line option: |
| 60 | +```bash |
| 61 | +/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
| 62 | +``` |
| 63 | +Restart nagios |
| 64 | + |
| 65 | +Now browse the Nagios GUI. Windows host is present on the dashboard. |
0 commit comments