module ITrigga module Generator def self.std_alert(max_memory = 1000) "if totalmem is greater than #{max_memory} Mb for 5 cycles then alert if cpu is greater than 50% for 4 cycles then alert if cpu is greater than 80% for 6 cycles then restart if loadavg(5min) greater than 10 for 8 cycles then restart" end def self.disks @devices ||= `df | grep ^/dev/` disks = {} @devices.split("\n").each{ |l| cols = l.split("\s") # note: on mac, we can get spaces in filenames. Meh... disks[cols.first] = cols[5..(cols.size-1)].join(" ") } disks end end end