I’m trying to setup the check-log.rb from the sensu-community-plugins repo to do a simple regex pattern match on log files and then throw a warning/critical if found.
I’m manually testing the script on /var/log/messages looking for the word “interface” like this:
/opt/sensu/embedded/bin/ruby check-log.rb -F /var/log/messages -q ‘/interface/’
I get the output:
CheckLog OK: 0 warnings, 0 criticals for pattern /interface/.
I know the pattern matches with /interface/ because interface exists in the /var/log/messages file. So my question would be is how do I setup this script (what arguments to pass) for a warn and critical event to be triggered?
There’s not a lot of documentation and when I try doing -w 1 (expecting that a count of 1 for warning will trigger a warning), nothing happens, I get the same output: CheckLog OK: 0 warnings, 0 criticals for pattern /interface/.
Any thoughts on this?