Notification from linux box

57 Views Asked by At

I m using putty on windows server to login into remote server. I need to monitor some jobs on that remote linux box. I need some script or binary file, that will send me notification on windows server/pc as soon as job fails on remote server.

Notify-send is not working there. I m using redhat linux.

1

There are 1 best solutions below

0
On

You can set a cron job in your Linux machine, which will will mail you if any failure occurs or any detail you needed. Example, I am using this service to monitor dump copy process.

This script will take backup and after completion notify me on my mail.

#!/bin/bash
date=`date -d '1 hour ago' "+%Y-%m-%d-%H"`

#/usr/bin/svnadmin dump /abc/xyz/ > /home/server1/backup/dump_$date.dump
/usr/bin/svnadmin dump /abc/xyz/ > /root/svn/dump_$date.dump    

mail -s "SVN DUMP" [email protected] < /opt/body.txt

Here, the body.txt file will contain the mail body.

cron will execute this file as below:
1 1 * * * sh dump.sh 

This may help.