What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

set WMI Free Disk Space sensor Drive property in poweshell

Votes:

0

I have to add 100s of disk space sensors from a powershell script that identifies all the varying number of disks on each server. Each time I clone ones of these sensors, how can I set it to the relevant drive letter to check against (F:, G:, H:, etc)?

There doesnt appear to be any way of setting the Drive?

I've also tried with raw properties, and it looks like it is stored in primarychannel_, but can't seem to set this either.

Is there a way in PS to set the drive each time I clone one?

drive powershell wmi-free-disk-sensor

Created on Sep 21, 2020 5:54:25 PM



Best Answer

Accepted Answer

Votes:

1

I did find a workaround to doing it, in case anyone else has the same issue.

To my clone device I added a set of Disk Space sensors for drives F-Z. Then as I clone the device for each server I just remove the Disk Space sensors for which there isn't an actual disk.

I did this for other reasons (I have other sensors being created with the device), but of course, you could simply set up individual Disk Space sensors for drives C-Z, and just identify and clone the ones that match the disks on your server.

Mark

Created on Sep 25, 2020 8:25:16 AM



5 Replies

Votes:

0

Hello there,

Cloning a sensor will always copy all settings from the root sensors. Unfortunately, it is not possible to adjust the monitored partitions afterwards, since this information is gathered during the meta scan when adding the sensor. When cloning, this is not done.

Only way around this, would be using an auto discovery instead of cloning.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Sep 22, 2020 3:39:20 PM by  Birk Guttmann [Paessler Support]

Last change on Sep 24, 2020 10:12:39 AM by  Birk Guttmann [Paessler Support]



Votes:

0

Thank you for your reply. I'm not cloning a script, I'm cloning a basic Disk Space sensor where I need to set the Drive.

When you say "When cloning, this is not done.", are you saying the meta scan doesn't take place then? Which is good and should enable me to change the Drive?

So, is there any way to add Disk Space sensors from a PS script and set the drive as they are added? I have way too many to add manually, and they frequently change.

Created on Sep 23, 2020 1:21:04 PM



Votes:

0

Hi there,

Sorry, I accidentally wrote script instead of sensor and changed it accordingly in my last response.

The meta scan takes not place, which means that the cloned sensor does not know about the added drives and simply monitors the ones that were also monitored by the root sensor.

It is not possible to do this with a script. Also it won't work to have the flexibility in one sensor to change the available disks automatically. You can also choose singly partitions when adding the sensor, so you can keep the old sensor and still add new partitions.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Sep 24, 2020 10:19:25 AM by  Birk Guttmann [Paessler Support]



Accepted Answer

Votes:

1

I did find a workaround to doing it, in case anyone else has the same issue.

To my clone device I added a set of Disk Space sensors for drives F-Z. Then as I clone the device for each server I just remove the Disk Space sensors for which there isn't an actual disk.

I did this for other reasons (I have other sensors being created with the device), but of course, you could simply set up individual Disk Space sensors for drives C-Z, and just identify and clone the ones that match the disks on your server.

Mark

Created on Sep 25, 2020 8:25:16 AM



Votes:

0

Hi Mark,

Thanks for sharing your workaround.

Have a great day.

Created on Sep 25, 2020 2:17:17 PM by  Birk Guttmann [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.