Ad Widget

Collapse

how to attach piece of log in email alert ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gandhamnagar
    Junior Member
    • Aug 2018
    • 2

    #1

    how to attach piece of log in email alert ?

    I have a custom script which will trigger an alert when a particular log is stuck for half an hour. But I want to attach (tail log) i.e. Last 10 lines of log in email. Can someone please help me out ?
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    Lots of assumptions; talking linux servers, ssh key access is setup, sudo rights setup, but just do something like this in your mail script:

    ssh host-owning-log-file-dns sudo tail -n 10 /var/log/messages

    /var/log/messages is just the sample log file name

    Comment

    • gandhamnagar
      Junior Member
      • Aug 2018
      • 2

      #3
      I get email alert via media type that when alert is triggered when some value is greater than 0, which is an item.
      I want to action in email to attach log file when alert itself is triggered.

      Comment

      Working...