Monitors the amount of space remaining on a disk, generating an alert if the amount of space used exceeds a given percentage.
| Rating: |
You must have a Scout Account to vote.
|
| Installs: | 274 |
| Tested On: | linux macosx |
| Source: |
View Source
All plugins listed in the directory are open source.
|
Using on Solaris.
Doesn’t quite work on Linux systems. Capacity is not a field header in df output on Linux. Am updating to include the Use% field if Capacity is not found.
—- disk_usage_orig.rb 2008-09-09 11:35:30.000000000 -0700
+ disk_usage_test.rb 2008-09-09 11:50:19.000000000 -0700
@ -60,10 +60,16 @max = @options[“max_capacity”].to_i
- if max > 0 and report[:report][:capacity].to_i > max
-
- report[:alerts] << { :subject => "Maximum Capacity Exceeded " +
+ if report[:report][:capacity].nil?
+ if max > 0 and report[:report][:“use%”].to_i > max
+ report[:alerts] << { :subject => "Maximum Capacity Exceeded " +
+ “(#{report[:report][:”use%“]})” }
+ end
+ else
+ if max > 0 and report[:report][:capacity].to_i > max
+ report[:alerts] << { :subject => "Maximum Capacity Exceeded " +
“(#{report[:report][:capacity]})” }
+ end
end
report
rescue
Hrm, that didn’t post correctly. How about this instead:
http://github.com/ivanheroku/scout-plugins/tree/master/disk_usage.rb
Modified lines 63- 72