Nagwin allows you to run Nagios, a popluar moniting software, on Windows hosts. In this guide we will install Nagwin on a Windows Server 2008 R2 host, configure the Nagios process by editing the config files, and monitor a Windows 2000 machine.
Contents
  1. Installing Nagwin
  2. Configuring the Nagios process
  3. Configuring Nagios to monitor a host
  4. Nagwin

Nagios is one of the most popular Open Source IT infrastructure monitoring tools available. Originally developed to monitor network hosts for uptime, latency, and health, Nagios has been extended to perform a variety of functions through its plugin interface. Though it is Open Source and generally intended for the Linux crowd, the folks at IteF!x have developed a port of Nagios for Windows - or Nagwin - to allow a Windows host to run the Nagios process.

Nagios for Windows - Nagwin

Nagwin - A complete Nagios implementation for Windows

Installing Nagwin

Nagwin uses several packages to acheive Nagios functionality on Windows, including lightweight versions of Cygwin (a Linux API for Windows), PHP, Perl, Blat (SMTP server), and Nginx (web server). Thankfully all of these are included in the download for Nagwin at SourceForge.

Once you download the installer, unzip and run the resultant Nagwin_1.2.0_Installer executable to get started. During the installation, you will be prompted for where you want to put the “ICW” folder (the cygwin root). I like to put this directly on the hard drive so it is easy to get to “C:\ICW,” but this is a matter of personal taste. Next, you will be prompted to enter a service account name and password. Accepting the defaults here is fine unless you would rather use an existing service account. The password that is prepopulated is randomly generated and if you accept defaults you should save this password somewhere safe. Click “Install” to proceed.

Configuring the Nagios process

Assuming you want Nagios to start automatically when your server starts, you should run the MMC console “services.msc” and scroll down to where all of the Nagwin services are. By default, these are manual startup services. If you go to Properties for each service you can configure them for an automatic startup. If they are running already, go ahead and stop them.

By default, the Nagios admin account (nagiosadmin) has the password “nagios” and that will not do, so let’s go ahead and change it. In a command prompt window, navigate to the ICW directory that you chose in the installation, then navigate to the “bin” folder. Now, run the command, replacing the italicized bit with your desired password:

htpasswd2 -b /etc/nginx/htpasswd nagiosadmin your_password_here

You can create additional accounts but that’s what we will use for now. You can also change the port that is used to access the web management interface. By default, this is port 80, but you will probably want to change it to a lesser known (and less likely to conflict) port. I chose port 81 but you can choose any TCP port that is not already in use. To do so, navigate to the folder “\etc\nginx\nginx.conf” under the ICW directory and find the “server” block. Now change the “listen” directive from 80 to whatever you desire.

Configuring Nagios to monitor a host

Now the real work begins. Let’s assume that our Nagios server is located at 10.1.1.14 in a 10.1.1.0/24 subnet, and that we want to monitor another Windows host located at 10.1.1.10 (called “fileserver”) on the same subnet. To monitor the host we simply define a new host in the file “\etc\nagios\nagwin\hosts.cfg” and restart (or start) the Nagios process. First, open the hosts.cfg file in your favorite text editor (if it does not exist, create the hosts.cfg file in the “\etc\nagios\nagwin” directory). Using our example above, the host configuration is as follows:

# Define a host for the local machine
define host{
use windows-server,host-pnp
host_name fileserver
alias fileserver
address 10.1.1.10
}

Note: alias is simply what Nagios calls the host, and in many cases it is appropriate to have the alias match the host_name. The important pieces here are the use, host_name, and address directives.

That’s it! Now we need to start all of our Nagwin services (there are four) in services.msc.

Once you have started these services, navigate to http://localhost:PORT_NUMBER and login using the username “nagiosadmin” and the password you defined earlier. Go to “Hosts” and voilà! Our newly defined host should appear along with “localhost” (where the Nagios process is located). You will notice that it provides detail regarding packet loss, latency (ping), and host uptime. Nagios saves this information in a repository that allows systems administrators to check the health of hosts as well as connectivity.
Nagios for Windows - Nagwin - Connectivity
Nagwin - Connectivity

In the next guide we will learn about Winrpe, a small daemon installed on Windows hosts to provide more detailed information about their health - CPU load, memory information, event logs and statuses - so that the Nagios process can probe these services and provide the administrator the information he or she needs to nip Windows host problems in the bud.

Nagwin

9 Comments
  1. Anon 12 years ago

    It looks as if the Nagwin project has been discontinued. Or at least the installers and the source forge project has been terminated. You might want to pull this article.

  2. Anon, the Nagwin project still exists. The tool isn’t just free anymore.

  3. John 12 years ago

    You may find it better off building a centos VMware to host the official nagios server platform and use the nt_nrpe service on the windows hosts. I can understand why IteF!x are now charging for their windows port.

    The beauty of Nagios is that you can write your own plug-in to monitoring anything – we have a library of custom plug-ins written in c++ doing the job of many engineers.

  4. Bill Campbell 12 years ago

    But no trial option? I’ve heard all about Nagios but always on Linux. We are a windows only shop and I would like to see it run from Windows in a trial before committing to it. We are currently comparing monitoring products and will be implementing something in the next 30-60 days.

  5. vgupta75atgmail 12 years ago

    Dear All,

    I could not find NAGWIN Installation files. Does anybody has an access to them. I am looking for a Windows based Nagios and I thing Nagwin is my solution. BUt don’t know where to get it from. I am ready to pay, but to whom?

    All help is highly appreciated..

  6. Itefix 11 years ago

    A free version of Nagwin with Nagios Core, PNP4Nagios and RRDTool is now available: https://www.itefix.no/i2/nagwin-get. Paid versions include additional software (like NetSNMP, Perl and Python) plus free support/upgrades for one year.

  7. Kent C. 10 years ago

    Excellent Guide! I have used this and was able to quickly get online and setup a basic SNMP using this for Windows.

    I’m using the free one and this worked pretty well, easy to follow. Keep up the great work.

  8. EPMD 8 years ago

    Hi;
    I’ve managed to add the “jmxeval.bat” for the jmx checks. But I am getting an exception when I run the plugin “check_jmxeval.bat”, I’ve copied the cmd output below.

    C:\Nagwin_x64\plugins>check_jmxeval.bat C:\Nagwin_x64\etc\jmxeval-threadcount.xm
    l
    Exception in thread “main” java.lang.ClassCastException: com.adahas.tools.jmxeva
    l.model.impl.Eval cannot be cast to com.adahas.tools.jmxeval.model.impl.JMXEval
    at com.adahas.tools.jmxeval.App.execute(App.java:50)
    at com.adahas.tools.jmxeval.App.main(App.java:110)

    If there is a better way to add the jmx checks to Nagwin please share.

    Thanks and regards.

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account