NRPE_NT Checks on Mapped Network Drive

Andy Shellam andy-lists at networkmail.eu
Tue Apr 14 19:41:23 CEST 2009


Hi Michael,

This is in no way related to NRPE or Nagios, but we had similar issues 
while trying to automatically grab files from a UNC path in a Windows 
scheduled task.

In the end we modified the batch script run by the scheduled task to 
automatically connect and authenticate to the share, grab the files 
needed, then disconnect.  Perhaps you need to modify your check script 
the same way?

The commands we used were:

REM Connect to the share
NET USE Z: \\computer\share /USER:domain\username password

REM Do stuff....

REM Disconnect
NET USE Z: /DELETE

I'm not sure if the /PERSISTENT flag would work here (see NET USE /?) - 
we never had the time to play around.

Hope this helps,
Andy

Michael McCoy wrote:
> The space after the g: is correct, the check then concatenates the 
> drive and the folder together.  I'm pretty sure the drives the mapped 
> as persistent (I didn't originally set them up so not 100%).  I tried 
> UNC pathing and again it works fine on the windows box itself but same 
> result as using normal absolute path.
>  
> I have noticed in the NRPE documentation (for UNIX) that it has you 
> add a nagios user to the remote host.  Being that there's not a whole 
> lot of official documentation for nrpe_nt itself is there something to 
> this affect that I have to do on the Windows machine?  Run the check 
> as a specific user?  I've tried running the nrpe_nt service as every 
> user on the windows box to no avail. 
>  
> I'm thinking it's some sort of permissions or "run as this specific 
> user so as to see network drives" issue, but my Windows knowledge in 
> terms of services, access rights, etc. is limited.  Thanks!
>
> >>> "James Pratt" <jpratt at norwich.edu> 4/9/2009 1:10 PM >>>
>
>
> > -----Original Message-----
> > From: Michael McCoy [mailto:mmccoy at cedarville.edu]
> > Sent: Thursday, April 09, 2009 12:21 PM
> > To: nagios-users at lists.sourceforge.net
> > Subject: [Nagios-users] NRPE_NT Checks on Mapped Network Drive
> >
> > For off let me say this is my first mailing list, so I'm new at this,
> so
> > please excuse any mailing list etiquette that I violate :-)
> >
> > I am attempting to monitor the file count of a directory on a remote
> > Windows XP machine.  I have installed NRPE_NT on the remote box and
> > check_nrpe on my Nagios machine.  The two are talking to one another
> fine.
> > The problem is that the directory that I need to monitor is on a
> mapped
> > network drives.  Here is the command I am running...
> >
> > command[directory_file_count]=c:\WINDOWS\system32\cscript.exe //NoLogo
> > //T:30 c:\temp\nagioschecks\file_count.wsf g: \folder1\folder2\ 0 10
> >
> > Basically if run this command from the DOS command line on the XP
> machine
> > it works fine.  Once I try to run the command from check_nrpe on the
> > Nagios host it gives me the following error...
> >
> > c:\temp\nagioschecks\file_count.wsf(123, 2) Microsoft VBScript runtime
> > error: Path not found
> >
>
> Hello Michael - Just a quick stab in the dark here, but in your command
> def above, you have a space character after your g: - is that correct,
> or could it be causing your issue?
>
> Also, are your drives mapped as persistent, as I'm not positive the user
> running the script would see them either way if not "logged on
> interactively".
>
> Can you use UNC pathing instead? Ie \\machine\share$ ? That should work
> if the user has rights, and you won't have to deal with the mapped drive
> issue(s) .
>
> HTH,
>
> Regards,
> jamie
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list