Answer the question
In order to leave comments, you need to log in
Simple local log monitoring + alerts for Ubuntu 12.04 LTS?
Dear Khabrovites!
Interested in installing and using a simple, lightweight tool for monitoring and sending alerts under Ubuntu 12.04 LTS.
You need to look through literally just a few local logs, if an event is found by regexp, send notifications via email.
I looked at ServerFault , but from all that came up - log2mail, and it is not available for my version of the OS.
Thanks in advance!
PS Do not offer Logstash and other centralized log collectors ;-)
Answer the question
In order to leave comments, you need to log in
logcheck worked :)
Related links:
askubuntu.com/questions/235868/how-can-i-monitor-syslog-and-send-notification-based-on-events
stackful-dev.com/keep-an-eye-on -your-linux-servers-with-logcheck
Found on the Internet.
#!/bin/sh
touch /var/log/messages.old
grep -v -f /var/log/messages.old /var/log/messages | grep PATTERN | mail -s "report" [email protected]
cp -p /var/log/messages /var/log/messages.old
tail -f logFileName | egrep "$errorList" | /usr/sbin/sendmail -s $EMAIL_SUBJECT $EMAIL_TO
Why not run a simple bash/python/ruby/php script that runs just fine on Ubuntu.
An endless loop with a slip and into a new thread. (or not in the new one. how does it run in the background?)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question