Log parser

Hi

Requirements

  • self custom python script
  • Add a short revision version e.g. v0.1
  • Tested with specific versions
  • Icinga 2 v2.8.x
  • Icinga Web 2 v2.5.x
  • English only

Introduction

python script to parse the logs and alert for a given string as input with a given log file. The script is Configured and it is working fine in identifying critical and warning parsing for the strings in the log file but color code is not working with the alert. it shows the critical alert in green color and not turning to RED.

Requirements

  • Icinga 2 v2.8.x
  • Icinga Web 2 v2.5.x

Linux

centos 7

And when you execute the script on CLI and type echo $? directly after the script, it says what?

when the /te.log last line is ts-have-problem it alerts critical and when the last line is TS-Complete then is saying ok

/usr/lib64/nagios/plugins/check_log.py --file=/home/ts/te.log --errorMsg=“ts-have-problem” --successMsg=“TS-Complete”
ALERT: CRITICAL

/usr/lib64/nagios/plugins//check_log.py --file=/home/ts/te.log --errorMsg=“ts-have-problem” --successMsg=“TS-Complete”
ALERT: OK