How to do auto alert email?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • priyankapendkar
    New Member
    • Apr 2011
    • 9

    How to do auto alert email?

    Hi!


    I need to check everyday log file if anything “error” message on it? If answer yes I like to receive auto email. Please let me know how to write shell script for this auto alert email.plz help me as early as possible.

    Thanks and regards
    Priyanka
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    1. Create perl script to scan log file from the given time it was last run
    2. If error detected, use MIME::Lite to send email
    3. Create cron job to run this perl script once a day.


    Good luck,
    - Miller
    Last edited by miller; Apr 14 '11, 06:18 AM.

    Comment

    • priyankapendkar
      New Member
      • Apr 2011
      • 9

      #3
      Can u give me a simple example.
      Actully i am new to Auto Email, so want to know each step in detail

      Comment

      • miller
        Recognized Expert Top Contributor
        • Oct 2006
        • 1086

        #4
        Just read the examples in MIME::Lite for sending an email.

        - M

        Comment

        • priyankapendkar
          New Member
          • Apr 2011
          • 9

          #5
          I have run the following command and I am getting the correct output means getting an mail on my email-id with subject “hi”

          mailx -s hi abc.xyz@companm .com



          --------------------------------------------------------------------------------------------------------




          If I want to use the same command in shellscript its not generating the mail

          Ex:-

          If mail.sh contains:

          #! /bin/bash

          mailx -s hi abc.xyz@companm .com

          can you please tell me in detail how to use mailx command in shellscript, I am new to this ?

          Comment

          • miller
            Recognized Expert Top Contributor
            • Oct 2006
            • 1086

            #6
            mailx is a lunix utility program, so once again mate, this is not a perl issue.

            Please just do the research on your own with google's help, or find a more appropriate forum for your questions.

            Regards,
            - Miller

            Comment

            Working...