diff --git a/lib/god/conditions/Shrtn.rb b/lib/god/conditions/Shrtn.rb new file mode 100644 index 00000000..523158ee --- /dev/null +++ b/lib/god/conditions/Shrtn.rb @@ -0,0 +1,24 @@ +module God + module Conditions + class Shrtn < PollCondition + attr_accessor :shellcmd + + def valid? + valid = true + valid &= complain("Attribute 'shellcmd' must be specified", self) if self.shellcmd.nil? + valid + end + + def test + system "#{shellcmd}" + if $? == 0 + self.info = "OK" + false + else + self.info = "Process has currently been found not running" + true + end + end + end + end +end