Nagios Server : Adding Windows host to Nagios server for monitoring

Hello Linux-fanatics, earlier we discussed “Installation & configuration of Nagios server” & now in this tutorial, we will learn to add windows host for monitoring on Nagios server.

To add a Windows host to Nagios server, we need a plugin called NSclient++. NSclient++ acts as a proxy or an intermediary between Nagios server & Windows machine. NSclient ++ communicates with the help check_nt plugin.

Now we will proceed with the steps required to adding Windows host to Nagios server…

(Recommended Read: Complete monitoring solution : Install OMD (Open Monitoring Distribution))

(Also Read: Monitoring network bandwidth with iftop command )

 

STEP 1 Downloading & installing NSclient++

We can download the latest version of NSclient++ from following link on the windows machine https://sourceforge.net/projects/nscplus/

Once you have downloaded the file which is a .msi file, double click on it to run the setup. Hit next on the setup screen, it will then ask you to accept the license agreement , accept & hit next again.

Then choose the typical setup & hit next again. You will be then asked if you would like to install some sample configurations file , leave it as it & hit next.

Now comes the main part of setup, here you will be asked to enter the IP of nagios server (refer to screenshot below)

nagios setup

Then click on next & then install to complete the setup. After installation is complete, we need to start NSclient++ by going into you r start menu & selecting “Start NSclient++” (see screenshot)

nsclient++ setup

Our installation on Windows hosts is now complete. We will configure our Nagios server for adding windows host.

STEP 2 Configuring Nagios server

Firstly, open nagios configuration file,

$ vi /usr/local/nagios/etc/nagios.cfg

&  uncomment the following line

# Definitions for monitoring a Windows machine
cfg_file=/usr/local/nagios/etc/objects/windows.cfg

/usr/local/nagios/etc/objects/windows.cfg  is the file where we will add information about our Windows hosts. Now we will edit the windows.cfg file

$ vi /usr/local/nagios/etc/objects/windows.cfg

A sample host definition is already present in the file, we can either copy it or edit it to point to our windows machine

nagios

And below Host Definition are some Service Definitions,  if you want to add more services this would be the place to do it. Otherwise just change the host name in these service definitions & you are done

nagios

Finally, we will verify the nagios configuration file

$ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Output should show no errors & warning found, & then we will restart nagios server for changes to take effect.

$ service nagios restart

STEP 3 Open Web-console

Now we will login to our nagios webcosole & goto services overview. We will now find that all the windows services are also being shown here along with our localhost services.

nagios services

That’s it guys your work is done. In next tutorial we will learn to add Linux machines on nagios server for monitoring.

Don’t forget to leave you valuable comments/queries below in our comment box.

 

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Become a Supporter – Donate us some of you hard earned money:

Linux TechLab is thankful for your continued support.

Shusain

Passionate about Linux & open source. Loves to learn, read & write about Linux as well as new technologies.

You may also like...

11 Responses

  1. rania says:

    hi!
    thanks for that tutorial
    i’ve followed all the steps but i have a error in all services

    C:\ Drive Space
    UNKNOWN 11-30-2017 09:08:25 0d 21h 18m 59s 3/3 NSClient – ERROR: No performance data from command: check_drivesize
    CPU Load
    UNKNOWN 11-30-2017 09:08:44 0d 21h 18m 0s 3/3 NSClient – ERROR: No performance data from command: check_cpu
    Load Average
    OK 11-30-2017 09:09:26 0d 0h 2m 36s 1/3 OK – Charge moyenne: 0.00, 0.01, 0.05
    Memory Usage
    UNKNOWN 11-30-2017 09:08:56 0d 21h 16m 3s 3/3 NSClient – ERROR: No performance data from command: check_memory
    NSClient++ Version
    OK 11-30-2017 09:10:27 0d 0h 58m 54s 1/3 NSClient++ 0.5.1.44 2017-08-30
    Uptime
    UNKNOWN 11-30-2017 09:09:07 0d 21h 14m 5s 3/3 NSClient – ERROR: No performance data from command: check_uptime

    in the nsclient.log i have

    2017-11-30 08:59:09: error:c:\source\master\service\NSClient++.cpp:814: Unknown command(s): check_uptime available commands: commands {, submit_nsca}, plugins {, 1}

    can you help

  2. thegeekaid says:

    problem in services
    CRITICAL – Socket timeout

  3. Sheikh Zulqarnain says:

    How you add tcp port monitoring for windows?

  4. Henry says:

    Hi i’m getting Socket timeout im monitoring windows server 2012
    any idea

  5. Henry says:

    For all here

  6. prabhu says:

    how to add multiple windows host in nagios ?

Leave a Reply

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