Skip to content

Commit 87041a3

Browse files
committed
Merge remote-tracking branch 'origin/gsoc_2015' into gsoc_2015
2 parents ee9f6a2 + d9333e6 commit 87041a3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sensu/handlers/sysopia.rb

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class Sysopia < Sensu::Handler
2727
cpu_iowaiting: "cpu_wait",
2828
load_per_cpu_one_minute: "load_one",
2929
load_per_cpu_five_minutes: "load_five",
30-
load_per_cpu_fifteen_minutes: "load_fifteen"
30+
load_per_cpu_fifteen_minutes: "load_fifteen",
31+
disk_usage: "disk_usage"
3132
}
3233
# override filters from Sensu::Handler. not appropriate for metric handlers
3334
def filter; end

sensu/plugins/metrics-sysopia.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def initialize
3838
@memstat = convert_floats(`free|tail -n2|head -n1`.split(' '))
3939
@cpunum = `cat /proc/cpuinfo |grep processor|wc -l`.to_i
4040
@loadstat = `uptime`.strip.split(' ').map { |s| s.to_f }
41+
@diskusage = `df -lPT |awk '$2 !~ /Type|tmp/ { print $6 }'| sed 's/%//'| sort -n|tail -n1`.to_i
4142
end
4243

4344
def convert_floats(values)
@@ -89,7 +90,8 @@ def run
8990
one_minute: (@loadstat[-3]/@cpunum).round(2),
9091
five_minutes: (@loadstat[-2]/@cpunum).round(2),
9192
fifteen_minutes: (@loadstat[-1]/@cpunum).round(2)
92-
}
93+
},
94+
disk: { usage: @diskusage }
9395
}
9496
metrics.each do |parent, children|
9597
children.each do |child, value|

0 commit comments

Comments
 (0)