Ad Widget

Collapse

Smtip

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Joseph.Bauer
    Junior Member
    • Jul 2007
    • 14

    #1

    Smtip

    HI,

    Is there a way to change the smtp port that zabbix uses? If there is not then is there a work around so I can use another port with zabbix?
  • amcorreia
    Member
    • Mar 2006
    • 73

    #2
    Originally posted by Joseph.Bauer
    HI,

    Is there a way to change the smtp port that zabbix uses? If there is not then is there a work around so I can use another port with zabbix?
    Hi,

    You can use nbstmp.

    See: http://www.zabbix.com/forum/showthre...highlight=smtp

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      Originally posted by Joseph.Bauer
      HI,

      Is there a way to change the smtp port that zabbix uses? If there is not then is there a work around so I can use another port with zabbix?
      Hmm, it seems that you're right, the SMTP port is hard-coded.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • Joseph.Bauer
        Junior Member
        • Jul 2007
        • 14

        #4
        I seem not to get nbsmtp to work. I could not download nbsmtp from the web so I apt-get it - I am using Ubuntu 6.10. I followed the instruction but I still cannot get it to work. Please help.

        Comment

        • Joseph.Bauer
          Junior Member
          • Jul 2007
          • 14

          #5
          Originally posted by amcorreia
          Can any please give a little more information on how to do this. The link is good but I not understanding. PLEASE HELP!!

          Comment

          • Joseph.Bauer
            Junior Member
            • Jul 2007
            • 14

            #6
            I got nbsmtp install with ssl and tested. I get an error in /var/log/mail.log saying Error in parse_mail. How do I fix this.

            Comment

            • amcorreia
              Member
              • Mar 2006
              • 73

              #7
              Originally posted by Joseph.Bauer
              I got nbsmtp install with ssl and tested. I get an error in /var/log/mail.log saying Error in parse_mail. How do I fix this.
              Hi,

              if you wish more help, please add more details.

              Send your script,
              Send output error,
              how about '-V' option from nbsmtp?
              What you don't understand?

              Comment

              • Joseph.Bauer
                Junior Member
                • Jul 2007
                • 14

                #8
                Originally posted by amcorreia
                Hi,

                if you wish more help, please add more details.

                Send your script,
                Send output error,
                how about '-V' option from nbsmtp?
                What you don't understand?
                Sorry about that, I am using nbSMTIP v 1.0
                Here is the script I have been using:
                #!/bin/bash

                export smtpemailfrom="joseph.bauer@meritelgroup"
                export zabbixemailto="joseph.bauer@meritelgroup"
                export zabbixsubject="TEST"
                export zabbixbody="THIS IS A TEST OF NBSMTP"
                export smtpdomain="MYDOMAIN.com"
                export smtpserver="10.10.10.3"
                export smtplogin="MYLOGIN"
                export smtppass="MYPASSWORD"

                echo "From: \"Zabbix Monitor\" <$smtpemailfrom>" > /tmp/mail
                echo "To: $zabbixemailto" > /tmp/mail
                echo "Subject: $zabbixsubject" > /tmp/mail
                echo " " > /tmp/mail
                echo "This is an automated alert from Zabbix Network Monitoring. The message is $zabbixbody" > /tmp/mail

                sudo nbsmtp -d $smtpdomain -f $smtpemailfrom -h $smtpserver -U $smtplogin -P $smtppass -S -n -D < /tmp/mail

                I seem to execute ok - it does not give any error when I run the script. I then check /var/log/mail.log and I get this:
                Jul 12 14:27:49 meritelzabbix01 nbSMTP[25242]: Error in parse_mail
                Jul 12 14:27:49 meritelzabbix01 nbSMTP[25242]: Mail NOT sent.
                Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Error in parse_mail
                Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Mail NOT sent.
                check syslog I get this:
                Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Error in parse_mail
                Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Mail NOT sent.
                Jul 13 17:39:01 meritelzabbix01 /USR/SBIN/CRON[6837]: (root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm)
                Jul 13 17:45:07 meritelzabbix01 nbSMTP[6894]: Setting auth_mech with a single character is discouraged and will be removed soon. Please take a look at nbsmtprc(5) to see the new format.

                I am not sure why the mail is not being sent, please help.

                Comment

                • amcorreia
                  Member
                  • Mar 2006
                  • 73

                  #9
                  Hi,

                  Originally posted by Joseph.Bauer
                  Sorry about that, I am using nbSMTIP v 1.0
                  Here is the script I have been using:
                  #!/bin/bash

                  export smtpemailfrom="joseph.bauer@meritelgroup"
                  export zabbixemailto="joseph.bauer@meritelgroup"
                  export zabbixsubject="TEST"
                  export zabbixbody="THIS IS A TEST OF NBSMTP"
                  export smtpdomain="MYDOMAIN.com"
                  export smtpserver="10.10.10.3"
                  export smtplogin="MYLOGIN"
                  export smtppass="MYPASSWORD"

                  echo "From: \"Zabbix Monitor\" <$smtpemailfrom>" > /tmp/mail
                  echo "To: $zabbixemailto" > /tmp/mail
                  echo "Subject: $zabbixsubject" > /tmp/mail
                  echo " " > /tmp/mail
                  echo "This is an automated alert from Zabbix Network Monitoring. The message is $zabbixbody" > /tmp/mail

                  sudo nbsmtp -d $smtpdomain -f $smtpemailfrom -h $smtpserver -U $smtplogin -P $smtppass -S -n -D < /tmp/mail

                  I seem to execute ok - it does not give any error when I run the script. I then check /var/log/mail.log and I get this:
                  Jul 12 14:27:49 meritelzabbix01 nbSMTP[25242]: Error in parse_mail
                  Jul 12 14:27:49 meritelzabbix01 nbSMTP[25242]: Mail NOT sent.
                  Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Error in parse_mail
                  Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Mail NOT sent.
                  check syslog I get this:
                  Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Error in parse_mail
                  Jul 13 17:34:39 meritelzabbix01 nbSMTP[6772]: Mail NOT sent.
                  Jul 13 17:39:01 meritelzabbix01 /USR/SBIN/CRON[6837]: (root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm)
                  Jul 13 17:45:07 meritelzabbix01 nbSMTP[6894]: Setting auth_mech with a single character is discouraged and will be removed soon. Please take a look at nbsmtprc(5) to see the new format.

                  I am not sure why the mail is not being sent, please help.

                  when you do
                  $ echo 'test' > file
                  is VERY different of
                  $ echo 'test' >> file

                  if you do an cat in your /tmp/mail, last thing you probably have is...

                  "This is an automated alert from Zabbix Network Monitoring. The message is (...)"

                  change your script for use '>>' instead of '>', which append things to end of file.

                  And, add the field Date:

                  data=$(date +"%a %b %d %T %Z %Y")
                  echo "Date: $data" >> /tmp/mail



                  Originally posted by Joseph.Bauer
                  #!/bin/bash

                  export smtpemailfrom="joseph.bauer@meritelgroup"
                  export zabbixemailto="joseph.bauer@meritelgroup"
                  export zabbixsubject="TEST"
                  export zabbixbody="THIS IS A TEST OF NBSMTP"
                  export smtpdomain="MYDOMAIN.com"
                  export smtpserver="10.10.10.3"
                  export smtplogin="MYLOGIN"
                  export smtppass="MYPASSWORD"
                  export data=$(date +"%a %b %d %T %Z %Y")

                  echo "From: \"Zabbix Monitor\" <$smtpemailfrom>" > /tmp/mail
                  echo "To: $zabbixemailto" >> /tmp/mail
                  echo "Date: $data" >> /tmp/mail
                  echo "Subject: $zabbixsubject" >> /tmp/mail
                  echo " " >> /tmp/mail
                  echo "This is an automated alert from Zabbix Network Monitoring. The message is $zabbixbody" >> /tmp/mail

                  nbsmtp -d $smtpdomain -f $smtpemailfrom -h $smtpserver -U $smtplogin -P $smtppass -S -n -D < /tmp/mail
                  I guess this work.

                  Comment

                  Working...