Guest User

Untitled

a guest
Jul 23rd, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. # Get capacity metrics from df
  2. `df -PT`.split("\n").drop(1).each do |line|
  3. begin
  4. timestamp = Time.now.to_i
  5. ===========
  6. metrics = {
  7. "#{mnt}.used" => used,
  8. "#{mnt}.avail" => avail,
  9. "#{mnt}.capacity" => capacity
  10. }
  11. iterate over metric key value
  12. send_data_to_sensu key, value, timestamp
  13. ========= vs
  14. =========
  15. ['used','avail','capacity'].each {|item|
  16. send_data_to_sensu item, '#{item}', timestamp
  17. =========
  18. end
  19. end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment