Ad Widget

Collapse

Media Type : Script have send e-mail as attachment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • natpavin
    Junior Member
    • Oct 2016
    • 2

    #1

    Media Type : Script have send e-mail as attachment

    Alert Script is work but I have some problem about Body of e-mail

    The e-mail is always send text message as attachment. How can i fix it

  • Linwood
    Senior Member
    • Dec 2013
    • 398

    #2
    A picture of the resulting email isn't going to help anyone debug your script for you, unless I am missing something about what was attached.

    If there's an attachment it's from what you are sending. The alert script (assuming it is a script that takes over the email function) is all under your control, zabbix is not then doing any of the email function. Test your script in isolation from zabbix.

    Comment

    • natpavin
      Junior Member
      • Oct 2016
      • 2

      #3
      this script as below

      #!/bin/bash

      echo "$3" | /usr/bin/mail -s "$2" $1

      I used this script before I found the problem, but my brother have resolve with sed command to cut something (^M is appear at last character every line)

      I need to know why script have a problem

      Comment

      • Linwood
        Senior Member
        • Dec 2013
        • 398

        #4
        I did a brief experiment and didn't get an attachment. It could also relate in some fashion to your receiving email system, or to precisely how the text is delimited or characters it contains I guess.

        But if that's all you are doing in the script -- why bother? Just use the zabbix email, it would appear to do identically the same thing. Does it give you an extra attachment?

        You might also look at your email on your linux, see if you can get a transcript of the transmitted message outbound, and see if it actually contains an attachment or if your receiving system is the one generating the attachment. If you don't see a way to do that easily just run tcpdump or wireshark on the smtp session outbound and look at the contents.

        Comment

        Working...