File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 |
You can’t perform that action at this time.
0 commit comments