[nos-bbs] Email Notification of Log Entries?

Niels PD9Q pd9q at packet-radio.net
Fri Apr 17 15:09:50 EDT 2020


Hi Charles,

I can get it done with Jnos, but linux can do the trick for you.
Maybe not once there is a log entry. But you can have the log scanned 
... We go back an hour and let the log scan for fwd errors. Now you 
always know within an hour if there is an fwd error.

# run this crontab entry every hour
0 */1 * * */home/pd9q/jnos/scripts/error-check.sh

error-check.sh

#!/bin/bash
# Fist set the current date for the right log file e.g 17Apr20
now=$(date +"%d%b%y")
# Now let`s have a look in the log at the past hour and find the 
'exception' and email it to me.
# mailx -E, if nothing found dont send a NULL body messages. So no empty 
messages.
grep "^$(date -d '-1 hour' +'%H')" /home/pd9q/jnos/logs/"$now" | grep -E 
"(fwd failed - Timeout errno 111)" \
| mailx -E -s "forward error" pd9q at pd9q.ampr.org

Hope that you find it useful. It is true, if you do not have a busy log, 
there is a chance that you will receive the same email for several 
hours. You can of course adjust the cronjob to several hours.

73 Niels PD9Q
https://packet-radio.net

Op 16-4-2020 om 19:39 schreef Charles J. Hargrove:
> fwd failed - Timeout errno 111



More information about the nos-bbs mailing list