lib/zabbix-ruby-client/plugins/disk.rb in zabbix-ruby-client-0.0.8 vs lib/zabbix-ruby-client/plugins/disk.rb in zabbix-ruby-client-0.0.9
- old
+ new
@@ -8,17 +8,18 @@
extend self
def collect(*args)
host = args[0]
dev = args[1]
+ mapped = args[2] || dev
diskinfo = `cat /proc/diskstats | grep " #{dev} "`
if $?.to_i == 0
_, _, _, _, read_ok, read_merged, read_sector, read_time, write_ok, write_merged, write_sector, write_time, io_current, io_time, io_weighted = diskinfo.split(/\s+/)
else
logger.warn "Please install sysstat."
return []
end
- diskspace = `df | grep "#{dev}"`
+ diskspace = `df | grep "#{mapped}"`
if $?.to_i == 0
_, size, used, available, percent_used, mount = diskspace.split(/\s+/)
else
logger.error "df is not working... ouchie."
return []