Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

alert mail send

Highlighted
rajesh73
Super Advisor

alert mail send

we need to send the alert mail,  when license down

 

normal license working

 

$tail -1 /home/raj/lic.txt

20 license in use

 

when license not working

$tail -1 /home/raj/lic.txt

unable to connect

 

i need to send the mail where the lic.txt file output comes unable to connect that time we need to send the mail

 

please share the procedure

1 REPLY
Dennis Handly
Acclaimed Contributor

Re: alert mail send

You could do something like the following and add to crontab:

tail -1 /home/raj/lic.txt | grep -q "unable to connect"

if [ $? -eq 0 ]; then

   echo "Got unable to connect from $(hostname)" | mailx -s "Unable to connect" send-location@foo.com

fi