Sha256: 720bb5f06dcdb09ec23aa3c7221fbd01e630aadb8701184dc2426f25e9b3c60d

Contents?: true

Size: 579 Bytes

Versions: 52

Compression:

Stored size: 579 Bytes

Contents

name "disk"
always_start true

collect :platform => 'windows' do
  disks = WMI::Win32_LogicalDisk.find(:all)
  disks.each do |disk|
    ld_info = {}
    disk.properties_.each do |p|
      ld_info[p.name.wmi_underscore.to_sym] = disk.send(p.name)
    end
    event(
      :service => "disk usage #{ld_info[:name]} #{ld_info[:volume_name]}",
      :metric => 100 * (1 - ld_info[:free_space].to_f / ld_info[:size].to_f),
      :desc => "Использование диска #{ld_info[:name]} (#{ld_info[:volume_name]})",
      :warning => 75,
      :critical => 80
    )
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
kurchatov-0.4.7 examples/disk_windows.rb
kurchatov-0.4.6 examples/disk_windows.rb
kurchatov-0.4.5 examples/disk_windows.rb
kurchatov-0.4.4 examples/disk_windows.rb
kurchatov-0.4.3 examples/disk_windows.rb
kurchatov-0.4.2 examples/disk_windows.rb
kurchatov-0.4.1 examples/disk_windows.rb
kurchatov-0.3.8 examples/disk_windows.rb
kurchatov-0.3.7 examples/disk_windows.rb
kurchatov-0.3.6 examples/disk_windows.rb
kurchatov-0.3.5 examples/disk_windows.rb
kurchatov-0.3.4 examples/disk_windows.rb
kurchatov-0.3.3 examples/disk_windows.rb
kurchatov-0.3.2 examples/disk_windows.rb
kurchatov-0.3.1 examples/disk_windows.rb
kurchatov-0.3.0 examples/disk_windows.rb
kurchatov-0.2.9 examples/disk_windows.rb
kurchatov-0.2.8 examples/disk_windows.rb
kurchatov-0.2.7 examples/disk_windows.rb
kurchatov-0.2.6 examples/disk_windows.rb