Monitor Window Network Drive

I want to monitor remote window server network drive, eg:) X drive, may I know anyone know how to achieve it. Thanks

You would use the NSClient++ and check_nt. Take a look at the Windows Monitoring documentation at nagios.sourceforge.net/docs/3_0/ … ndows.html

Thanks. I have tired NSClient++ before, however, it seems can monitor local drive only, it may have a problem to monitor network drive.

oh, wasn’t aware of that limitation with the network drives… if you are checking it’s availability on the network then check_disk_smb would probably help, but if you want to see whether it is attached locally then I don’t know of anything that will do that if check_nt wont. Maybe though it would not be too complicated to write a script that simply does a “dir x:” and then exit(2) if the response inludes “The system cannot find the path specified.” ??

Ok… I think that all newbies about scripting would ask … “HOW” ??
I am in the same situation : I need to check the presence of mapped drive X: on a monitored windows host. how should the little script look like ? Must be put in the nagios server or in the windows host ?
Thanks in advance for any reply
Regards

maybe this link can help you:
nagiosexchange.org/cgi-bin/p … 6.html;d=1

it’s a plugin that should check your disks (space available).
You have to install it on your windows server and must be called by NSC++

(I haven’t tried it, so I can’t tell you if it’s working properly)

Thanks, you are very kind.
But you also have to be patient…
I got that plugin and put it in the windows host and executed correctly.
But how can i call it from NSC++,so the result go back to the nagios process??
Thanks in advance if anyone can help
Regards

At it’s simplest you could not even worry about parsing the output, and probably do it in a 4 line batchfile…

@echo off @dir X:\ @if errorlevel 0 exit 0 @exit 2
(untested, just 5 minutes research on t’internet)

Using the NRPE listener is your best bet.

Read the NSClient++ documentation on using with nagios, particularly the bit about implementing NRPE, at trac.nakednuns.org/nscp/wiki/doc/usage/nagios

That should see you right.

HTH

/S

Ok, i documented about nrpe client on windows (nsclient++).
I post here the result : if i execute the script from windows prompt it ends correctly:

C:\Documents and Settings\Administrator.MYCOMPANY>cscript //Nologo c:\nsclient++\scripts\check_g.vbs /w:15 /c:5 /p /d:G

DISK OK - free space: G 169307MB (48%);

But executing it remotely from the Nagios server i got errors:

[root@srvocs nagios]# /usr/local/nagios/libexec/check_nrpe -H 10.0.0.16 -c check_hd
Input error : No file extensions in “c:\nsclient++\scripts\check_g.vbs \w:15 \c:5 \p \d:G”.

In nsc.ini the “interesting” part i added is:

check_hd=cscript //Nologo “c:\nsclient++\scripts\check_g.vbs /w:15 /c:5 /p /d:G”

If anyone has some suggestion …
Thanks to all
Regards

Try removing the quotes… I think maybe cscript cant spot the .vbs extension and is failing to work out what to do with it…
of course, no quotes might let it run, but break the check totally, in which case put the cscript line into a .bat file and put the .bat file in nsc.ini instead.

Removing the quotes i get:

c:\nsclient++\scripts\check_g.vbs(71, 4) Run-time error Microsoft VBScript: Permission Denied.

Putting the command into the .bat (without quotes) no reply when called:
[root@srvocs logos]# /usr/local/nagios/libexec/check_nrpe -H 10.0.0.16 -c check_hd

[root@srvocs logos]#

I think i give up, or maybe looking for other solutions, if any.
Thank anyway, very kind.
Regards.