Network MAP drive monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Network MAP drive monitoring

Post 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.
Former Nagios Employee
Sandeep_Patil
Posts: 39
Joined: Tue Dec 22, 2015 2:32 am

Re: Network MAP drive monitoring

Post 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]#
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Network MAP drive monitoring

Post 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?
Nagios XI 5.8.1
https://outsideit.net
Sandeep_Patil
Posts: 39
Joined: Tue Dec 22, 2015 2:32 am

Re: Network MAP drive monitoring

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Network MAP drive monitoring

Post by rkennedy »

Can you also post networkmapdrive.vbs? It doesn't look like you're specifying a drive anywhere.
Former Nagios Employee
Sandeep_Patil
Posts: 39
Joined: Tue Dec 22, 2015 2:32 am

Re: Network MAP drive monitoring

Post by Sandeep_Patil »

script working fine and out put is mapped drive availability.
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Network MAP drive monitoring

Post 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
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Network MAP drive monitoring

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Sandeep_Patil
Posts: 39
Joined: Tue Dec 22, 2015 2:32 am

Re: Network MAP drive monitoring

Post by Sandeep_Patil »

Please close the case
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Network MAP drive monitoring

Post by bwallace »

Closing thread now...
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked