Table of Contents

How to Setup Nagios Log Server with Windows Server

Picture of Salamon Anzel
Salamon Anzel

Collecting logs from Windows Server is crucial for monitoring system health and security. Integrating these logs with Nagios Log Server allows for centralized analysis, real-time alerts, and efficient troubleshooting. This article covers the setup process, from configuring Windows Event Log forwarding to analyzing logs in Nagios Log Server.

To see how this is done in Nagios Log Server, check out this tutorial:


Step 1: Add a Log Source in Nagios Log Server

1. Log in to your Nagios Log Server web interface.

2. On the Home page, locate the section for adding log sources.

image 132
add log source

3. Click the + Windows button to begin the configuration process. .

image 133
select windows

Step 2: Install NXLog CE on Windows Server

1. On the Nagios Log Server Windows Source page, find the Getting Started section and download NXLog CE from the provided link.

image 135
getting started

2. Run the installer on your Windows Server.

image 137
nxlog-ce-latest.msi

3. Click Next to the Welcome Screen.

image 138
welcome screen

3. Accept the License Agreement and click Next

image 139
license agreement

4. Pick the destination folder to install Nagios Log Server (Default C:\Program Files\nxlog\)

image 140
destination folder

5. Click Install:

image 141
read to install

5. Click Finish after a successful installation.

image 142
installation in progress
image 143
installation complete

Step 3: Configure NXLog CE

1. On the Nagios Log Server Windows Source page, locate the Configuration Setup section.

2. Copy the provided configuration code:

Right-click and select Copy.

Click the Select All button in the top-right of the code block.

image 144
configuration setup

3. On your Windows Server, open Notepad as an administrator.

image 145
notepad

4. Open the NXLog configuration file:

  • Navigate to C:\Program Files\nxlog\conf\
  • Select All Files (.) in the file type dropdown.
  • Open nxlog.conf.
image 146
nxlog.conf

5. Paste the copied configuration into the file.

6. Save and close Notepad.


Step 4: Confirm the NXLog Service is running

1. In the Windows Services App. Locate the nxlog service and confirm it’s Running.

image 147
nxlog services running

If not, you can manually start it by right-clicking on nxlog and select Starat:

image 151
starting nxlog service

2. You can also run sc query nxlog. Confirm the value of STATE is RUNNING

image 149
sc query nxlog output

If needed, you can manually start the service by running net start nxlog


Step 5: Verify Logs in Nagios Log Server

1. You can verify a successful connection by going back in the Nagios Log Server > Add Log Source > Windows. In the Verify Incoming Logs section. Add the IP Address of your Windows Server and click Verify

image 152
verify incoming logs

2. Now navigate to Home. Under Unique Hosts > select View

image 153
unique hosts

3. Select the IP Address/Hostname of your windows server.

4. Confirm Event logs are being received:

image 154
event logs in nagios log server

Troubleshooting

Check NXLog Configuration File

1. Open C:\Program Files\nxlog\conf\nxlog.conf in Notepad.

2. Ensure the configuration matches the one provided by Nagios Log Server.

3. Look for syntax errors: Run NXLog manually to check for issues:

"C:\Program Files (x86)\nxlog\nxlog.exe" -v


4. If any errors appear, correct them in nxlog.conf and restart the service.

Verify Firewall

If logs are not reaching Nagios Log Server, try:

1. On your Windows Server, confirm outbound port 3515 is open by running:

Get-NetFirewallRule -Direction Inbound, Outbound | Get-NetFirewallPortFilter | Where-Object { $_.LocalPort -eq 3515 }

2. To Allow traffic for NXLog on your windows server, which uses by default outbound port 3515:

netsh advfirewall firewall add rule name="Allow NXLog" dir=out action=allow protocol=tcp localport=3515

Enable Debugging in NXLog

If issues persist, enable debugging in NXLog:

1. Open C:\Program Files\nxlog\conf\nxlog.conf

2. Add:

LogLevel DEBUG

image 155
How to Setup Nagios Log Server with Windows Server 22

3. Restart NXLog:

image 156
restart nxlog

4. Check logs in: C:\Program Files\nxlog\data\nxlog.log


If you have additional questions or other support-related questions, please visit Nagios Support. The Nagios Support Knowledgebase is also a great support resource.

Share this post