Ad Widget

Collapse

Monitoring a problem for Windows (vfs.fs.size[/,total])

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cherish2004
    Junior Member
    • Apr 2014
    • 7

    #1

    Monitoring a problem for Windows (vfs.fs.size[/,total])

    Hello, I know that monitoring a Windows disk command as below:
    Code:
    vfs.fs.size[D:/,total]
    Now, I want to get the size of all disks, that hard disk size, how do?

    Thank you and forgive my bad English please.
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    You can have an Item "Total Disk Size" as Calculated Item with formula:
    Code:
    last("vfs.fs.size[C:,total]")+last("vfs.fs.size[D:,total]")+
    last("vfs.fs.size[E:,total]")+last("vfs.fs.size[F:,total]")+
    last("vfs.fs.size[G:,total]")+last("vfs.fs.size[H:,total]")+
    last("vfs.fs.size[I:,total]")+last("vfs.fs.size[J:,total]")+
    last("vfs.fs.size[K:,total]")+last("vfs.fs.size[L:,total]")+
    last("vfs.fs.size[M:,total]")+last("vfs.fs.size[N:,total]")+
    last("vfs.fs.size[O:,total]")+last("vfs.fs.size[P:,total]")
    Unfortunately we still don't have any tools to create it automatically.
    Sincerely yours,
    Aleksey

    Comment

    • cherish2004
      Junior Member
      • Apr 2014
      • 7

      #3
      This would be a good solution

      Originally posted by aib
      You can have an Item "Total Disk Size" as Calculated Item with formula:
      Code:
      last("vfs.fs.size[C:,total]")+last("vfs.fs.size[D:,total]")+
      last("vfs.fs.size[E:,total]")+last("vfs.fs.size[F:,total]")+
      last("vfs.fs.size[G:,total]")+last("vfs.fs.size[H:,total]")+
      last("vfs.fs.size[I:,total]")+last("vfs.fs.size[J:,total]")+
      last("vfs.fs.size[K:,total]")+last("vfs.fs.size[L:,total]")+
      last("vfs.fs.size[M:,total]")+last("vfs.fs.size[N:,total]")+
      last("vfs.fs.size[O:,total]")+last("vfs.fs.size[P:,total]")
      Unfortunately we still don't have any tools to create it automatically.

      Thank you, this would be a good solution.

      Comment

      • ArtemK
        Senior Member
        • May 2013
        • 232

        #4
        With latest zabbix agent version it's possible to use wmi to get size of drives, i.e. I'm using this to check free space on partitions without own drive letter:

        Code:
        wmi.get[root\cimv2,select Capacity from win32_volume where DeviceID = "{#DEVICEID}"]
        #DEVICEID comes from discovery, which is performed by this powershell script on agent (remove Where-Object condition on first line to check all drives):
        Code:
        $volumes = Get-WmiObject win32_volume | Where-object {$_.DriveLetter -eq $null}
        
        $counter = 1
        write-host "{"
        write-host "`t`"data`":["
        foreach ($volume in $volumes) {
        	if ($volume.Label -Match "System Reserved") { $counter++; continue }
        	$devid = $volume.DeviceID.Replace('\','\\\\')
        	if ($counter -eq $volumes.Count) {
        		$line = "`t`t{ `"{#DEVICEID}`":`"" + $devid  + "`" , `"{#LABEL}`":`"" + $volume.Label + "`" }"
        	} else {
        		$line = "`t`t{ `"{#DEVICEID}`":`"" + $devid  + "`" , `"{#LABEL}`":`"" + $volume.Label + "`" },"
        		$counter++
        	}
        	write-host $line
        }
        # Close the JSON message
        write-host "`t]"
        write-host "}"
        Feel free to ask more, if something is not clear

        Update

        arghh, it will works for partitions only, sorry. But probably WMI can report data for physical disks also.

        Comment

        Working...