Page 1 of 1
How to monitor windows host from linux "by command line"?
Posted: Wed May 07, 2014 6:53 am
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.
Re: How to monitor windows host from linux "by command line"
Posted: Wed May 07, 2014 9:43 am
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?
Re: How to monitor windows host from linux "by command line"
Posted: Thu May 08, 2014 1:46 am
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

to append in the script, so that we can process in our code to produce output as we want.
Thank You

Re: How to monitor windows host from linux "by command line"
Posted: Thu May 08, 2014 11:39 am
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.
Re: How to monitor windows host from linux "by command line"
Posted: Fri May 09, 2014 1:19 am
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.
Re: How to monitor windows host from linux "by command line"
Posted: Fri May 09, 2014 9:28 am
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!