Mapped drives on servers

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ddedden
Posts: 3
Joined: Thu Apr 28, 2016 6:33 am

Mapped drives on servers

Post by ddedden »

Is it possible to write a script to see what drives are mapped on each server. Would I use a powershell script to do so? What would this script look like?

--David
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Mapped drives on servers

Post by hsmith »

Are you running something like NSClient on the remote machine? NSClient can execute just about any remote remote script, and send the result back to your Nagios server.

I do not have a powershell script handy to provide you with, but maybe these links can help out:

http://superuser.com/questions/782863/l ... ell-script
http://techibee.com/powershell/powershe ... rives/1156
https://community.spiceworks.com/topic/ ... k-computer

If you get one of those working, check out this document for how-to on running scripts using NSClient.
Former Nagios Employee.
me.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Mapped drives on servers

Post by Box293 »

This is quite a complicated topic.

Basically NSClient++ runs as the SYSTEM user.

Mapped drives are specific to the user that is logged on. Machines like Remote Desktop Session Hosts have many users logged in at any one time, all with their own mapped drives.

Can you explain perhaps why you want to see what drives are mapped, perhaps there is an easy solution once we know your end goal.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ddedden
Posts: 3
Joined: Thu Apr 28, 2016 6:33 am

Re: Mapped drives on servers

Post by ddedden »

We have certain systems that use particular drives on the servers. If at any point there is a server that is down do to maintenance or what have you, and the mapping is lost, we need to know about it.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Mapped drives on servers

Post by WillemDH »

This is a bit of a weird question. If the server is down to maintenance, you should know that with other checks? Do you mean a mapped network drive with "the mapping"? This would imply it is mapped with a user which is always logged in? Or you are using something like this? http://stackoverflow.com/questions/1827 ... 24#4763324
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Mapped drives on servers

Post by tmcdonald »

@ddedden please provide some clarification about the above points, thanks!
Former Nagios employee
ddedden
Posts: 3
Joined: Thu Apr 28, 2016 6:33 am

Re: Mapped drives on servers

Post by ddedden »

@tmcdonald the servers that we run are windows 2008 R2 and 2012R2. We have services that run on these servers as well as scheduled tasks. The drives are mapped on the server, but I do not think they are user specific. There are two drives that are heavily used. We have a server team that does maintenance on all the servers monthly. For some reason these drives are dropped. We actually have a task we can run after the fact that will map the required drives. What I am seeking is to have a script on the servers that Nagios can execute and spit back to the GUI what drives are mapped on these servers after the scheduled maintenance so I don't have to log into every server and manually check the mappings.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Mapped drives on servers

Post by hsmith »

Have you checked any of the links that have been posted here?
Former Nagios Employee.
me.
Locked