Hi Team,
We want to monitor a log file in a specific location. The script/plugin should search for word 'error' in the log file.
We are using Aix systems on which we have installed NRPE agent.
Thanks and regards
Prashanth Chenna
Find error word in log file
Find error word in log file
Thanks & Regards,
I2MP Team.
I2MP Team.
Re: Find error word in log file
Hello Prashanth Chenna,
Thanks for reaching out, appears that you have already installed NRPE agent on your AIX environment.
Here is an example script that you can work from:
Thanks,
Perry
Thanks for reaching out, appears that you have already installed NRPE agent on your AIX environment.
Here is an example script that you can work from:
This would be placed in the plugin directory.#!/bin/bash
countWarnings=$(grep 'yourword" /var/log/somelog | wc -l)
case $countWarnings in [0]*)
echo "OK - $countWarnings% of found in log file."
exit 0 ;;
[1-100]*)
echo "WARNING - $countWarnings% of found in log file."
exit 1 ;;
esac
Thanks,
Perry