Class: Macklog::Cli
- Inherits:
-
Thor
- Object
- Thor
- Macklog::Cli
- Defined in:
- lib/macklog/cli.rb
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/macklog/cli.rb', line 9 def check # exit code # 0:OK # 1:WARNING # 2:CRITICAL # 3:UNKNOWN file_path = File.([:file]) unless File.exist?(file_path) puts "#{file_path} not found!" exit_status 3 end result = log_search(file_path, [:word] , [:ignorecase]) if result && !notified?(file_path, result) exit_status 2 end end |