Page 2 of 2
Re: Network MAP drive monitoring
Posted: Thu Apr 14, 2016 3:52 pm
by rkennedy
WillemDH wrote:In my experience, monitoring remote shares can only be done properly by using a Windows gateway where NSClient runs as a user with permissions on the share. Configure the nscp service to run with this user and create the command which monitors the size.
This wil also only work with very recent NSClient versions, as in very early version, it was not possible to monitor remote shares, and a bit later, there was a bug. If it doesn't work with the version you are running now, try
https://github.com/mickem/nscp/releases/tag/0.5.0.43
Thanks for the addition Willem! I realized that in my test as well -
Code: Select all
[root@localhost libexec]# ./check_nrpe -H 192.168.5.47 -c check_drivesize -a drive=\\\\192.168.x.x\\install
Filter processing failed: Error: Failed to get size for: 5: Access is denied.
Re: Network MAP drive monitoring
Posted: Tue May 03, 2016 11:17 am
by Sandeep_Patil
I tried with vbs script on XP machine out put as below
[root@localhost libexec]# ./check_nrpe -H 10.x.x.x
I (0.3.9.327 2011-08-16) seem to be doing fine...
[root@localhost libexec]# ./check_nrpe -H 10.x.x.x -c check_map_drive
CHECK_NRPE: Socket timeout after 10 seconds.
[root@localhost libexec]#
Re: Network MAP drive monitoring
Posted: Tue May 03, 2016 12:46 pm
by WillemDH
check_map_drive? Where did you get that command / script from? Did you define it in your nsclient.ini? Can you post the external script directive from your nsclient here?
Re: Network MAP drive monitoring
Posted: Tue May 03, 2016 12:54 pm
by Sandeep_Patil
script created and stored in script directory.
[External Scripts]
;check_es_long=scripts\long.bat
;check_es_ok=scripts\ok.bat
;check_es_nok=scripts\nok.bat
;check_vbs_sample=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs
;check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -
check_map_drive=cscript.exe //T:60 //NoLogo scripts\networkmapdrive.vbs
Re: Network MAP drive monitoring
Posted: Tue May 03, 2016 12:58 pm
by rkennedy
Can you also post networkmapdrive.vbs? It doesn't look like you're specifying a drive anywhere.
Re: Network MAP drive monitoring
Posted: Tue May 03, 2016 1:03 pm
by Sandeep_Patil
script working fine and out put is mapped drive availability.
Re: Network MAP drive monitoring
Posted: Tue May 03, 2016 1:13 pm
by rkennedy
Code: Select all
objShell.PopUp "Drive " & strDriveLetter & _
" is not connected."
It looks like your plugin indeed works. I haven't done much VBS scripting, but testing your vbs, I believe the issue is that it isn't outputting to Nagios properly. Here's how another plugin exits -
Code: Select all
' Set the msg output to be used (OK/WARNING/CRITICAL/UNKNOWN will be applied automaticly)
return_code = np.check_threshold(Args("arg"))
msg = "Testing " & Args.Item("host") & " " & np.get_threshold("warning") & " " & np.get_threshold("critical")
' Nice Exit with msg and exitcode
np.nagios_exit msg, return_code
Re: Network MAP drive monitoring
Posted: Tue May 03, 2016 7:14 pm
by Box293
Even with the changes
@rkennedy proposed, I don't think this script will work when NSClient++ uses it.
This is because NSClient++ is executing as the SYSTEM user account, not the user who is logged into the system. The SYSTEM account won't have the mapped drives that the user you are logged in and testing it as will.
Re: Network MAP drive monitoring
Posted: Wed May 18, 2016 1:18 pm
by Sandeep_Patil
Please close the case
Re: Network MAP drive monitoring
Posted: Wed May 18, 2016 4:48 pm
by bwallace
Closing thread now...