Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Get capacity metrics from df
- `df -PT`.split("\n").drop(1).each do |line|
- begin
- timestamp = Time.now.to_i
- ===========
- metrics = {
- "#{mnt}.used" => used,
- "#{mnt}.avail" => avail,
- "#{mnt}.capacity" => capacity
- }
- iterate over metric key value
- send_data_to_sensu key, value, timestamp
- ========= vs
- =========
- ['used','avail','capacity'].each {|item|
- send_data_to_sensu item, '#{item}', timestamp
- =========
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment