windows clustering - Powershell command to retrieve Failover Cluster Disk Size/Free Space? -


i'm using powershell , attempting retrieve size, , available space, of physical disk resource.

i want code run on 1 windows server 2008 r2 box (a monitoring server), , poll resources on 3 remote clusters on same domain. 2 of clusters running windows server 2008 r2, 1 running windows server 2012 (x64). returned data inserted database part of monitoring app.

currently code i'm using is:

$clusters = "cluster1.domain.local","cluster2.domain.local","cluster3.domain.local" foreach ( $cluster in $clusters) {     $resources = get-clusterresource -cluster $cluster | where-object {$_.resourcetype -match "physical disk"}     foreach ( $resource in $resources) {         $details = get-clusterresource -cluster $cluster -name $resource.name | fc *         <how disk size & space $details?>     } } 

the data returned "get-clusterresource | fc *" doesn't include physical disk size or free space, , cannot work out how derive information. returned information generic cluster resources - example can seen here (example 2). example 3 below helpful, not include disk size or free space.

i have checked this question answer uses wmi queries, , when try run sorts of security , compatibility issues. i'd prefer stick straightforwards powershell if possible, monitoring app using pure powershell check exchange mailbox sizes & dfs replication backlogs.

please note not trying query cluster shared volumes - have own, separate powershell functions , i've got working no problems. it's physical disk resources can't work.

i understand physical disks 1 of many resource types, , generic get-clusterresource command not return disk specific, hoping function call, passing in return value of get-clusterresource, retrieve disk space/free space

any assistance appreciated, thanks

sam


updates ansgar wiechers

  • what objective? specified, create series of 'data collector' powershell scripts gather data multiple systems need monitoring, , inject data database provide alerts, retain history , enhance our monitoring abilities. our current suite of monitoring tools covers 90% of need, misses on few little things, hoping rectify using method

  • why need physical disk parameters instead of csv parameters? because csvs aren't type of disk used in cluster. example, have 2 server, 7-instance, 31-volume sql cluster. imperative free disk space on volumes monitored, reasons assume obvious. monitoring done manually, , lacks historical retention

  • of physical disks? whichever ones specify. ideal solution able monitor in-use (ie not 'available') cluster disk resource. not intend monitor 'useless' disks such dtc volume on our sql cluster, or quorum volumes, there's no reason should not able monitor these, if choose to

  • and why want information through cluster instead of monitoring physical disk information on cluster members whilst possible of information via snmp mibs, information more difficult obtain, interpret , translate. can go detail on this, detract focus question, suffice powershell preferred method

you can't obtain free space information on physical disk level. kind of information available on filesystem/volume level. monitoring purposes i'd a

$filter = 'drivetype=3 , driveletter not null'  gwmi win32_volume -filter $filter | select driveletter, capacity, freespace 

on each cluster node. give size , free space of "regular" volumes. can run remote wmi queries passing array of hostnames -computer option. in case i'd recommend including systemname property output:

$filter = 'drivetype=3 , driveletter not null' $nodes  = get-clusternode -cluster $cluster `             | ? { $_.state -eq 'up' } `             | % { $_.name }  gwmi win32_volume -computer $nodes -filter $filter |     select systemname, driveletter, capacity, freespace 

csvs can't monitored that, data must obtained this:

get-clustersharedvolume -cluster $cluster `   | select -expand sharedvolumeinfo `   | select friendlyvolumename, @{n="capacity";e={$_.partition.size}},       @{n="freespace";e={$_.partition.size - $_.partition.usedspace}} 

and i'd appreciate if used less condescending tone when answering questions. it's not have solve problems.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -