How to monitor windows host from linux "by command line"?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
tejassawai
Posts: 5
Joined: Wed Apr 30, 2014 10:48 pm

How to monitor windows host from linux "by command line"?

Post by tejassawai »

I need help to monitor windows host using command line.
As we can monitor Remote Linux host using NRPE using command line as :
Eg.

Code: Select all

/usr/local/nagios/check_nrpe -H localhost -c somecommand -t 30
What is the command in Linux to monitor windows host using `check_nt` plugin? I can monitor successfully by graphical method given in : http://nagios.sourceforge.net/docs/3_0/ ... ndows.html, but I want to parse its output to some code for further processing.

Thanks, It will help me alot.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: How to monitor windows host from linux "by command line"

Post by slansing »

but I want to parse its output to some code for further processing.
We need details on this since this is really what your question is. What exactly are you trying to do here, do you have examples?
tejassawai
Posts: 5
Joined: Wed Apr 30, 2014 10:48 pm

Re: How to monitor windows host from linux "by command line"

Post by tejassawai »

Yes I can give an example with Remote Linux Monitoring.

I am monitoring Remote machine (say 192.168.3.100), by command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.3.100 -c check_cpu
. and its output is:

Code: Select all

OK: CPU Idle = 95.42% | CpuUser=3.33; CpuNice=0.00; CpuSystem=0.57; CpuIowait=0.69; CpuSteal=0.00; CpuIdle=95.42:20:10
I have written a simple shell script to monitor by nagios for those Linux systems.
Now I have given this script to the developer who can use this script in his QT C++ code and produced output in format suggested to him.
But now we can only monitor Linux systems as we haven't found any command yet :roll: to append in the script, so that we can process in our code to produce output as we want.

Thank You :)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: How to monitor windows host from linux "by command line"

Post by tmcdonald »

In order to monitor a Windows machine's CPU, memory, etc. you need to install an agent typically, something like NCPA or NSClient++. Do you have either of these running on the Windows machine? check_nt relies on that.
Former Nagios employee
tejassawai
Posts: 5
Joined: Wed Apr 30, 2014 10:48 pm

Re: How to monitor windows host from linux "by command line"

Post by tejassawai »

@tmcdonald, I already mentioned that No problem monitoring the system graphically using web based tool:

Anyways, after searching for long I found this solution:

Code: Select all

/usr/local/nagios/libexec/check_nt -H <host> -p <port> -v <command> -l <value>

So I have used this in my script as :

Code: Select all

/usr/local/nagios/libexec/check_nt -H $myHost -p 12489 -v CPULOAD -l 5,80,90,10,80,90
/usr/local/nagios/libexec/check_nt -H $myHost -p 12489 -v USEDDISKSPACE -l c
/usr/local/nagios/libexec/check_nt -H $myHost -p 12489 -v MEMUSE
Thanks All.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: How to monitor windows host from linux "by command line"

Post by tmcdonald »

I'm not sure what you mean by graphically in relation to NCPA or NSClient, but glad to see it is working now. I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked