Ad Widget

Collapse

I am loosing hope

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kqfp31
    Member
    • Apr 2012
    • 48

    #1

    I am loosing hope

    Hi
    Since a few weeks I try to make ma Zabbix to send email or sms notification.
    There are some topics about this:


    I am new in Linux systems and I am loosing hope that it will work. Maybe any one can help me? Anything? I don't know why it don't working. I don't even know how to checks log for this.
    Please, help
  • lukeiam
    Member
    • Sep 2012
    • 38

    #2
    More info needed

    To help you, more info is needed.

    1. Zabbix sends email to the local port 25 (mail client like postfix/sendmail)

    -If this is the issue, check the zabbix logs on why. Zabbix > administration -> audit or check the actual zabbix logs.

    2. your mail client forwards it to a different server.

    -if you have ISP that blocks 25 out, you need to setup a relay server of your ISP in the postfix/sendmail.

    -if you have all ports open, check logs like /var/log/maillog if the mail was received locally and forwarded to a different server. The log will tell you which server it was forwarded to or if it's in the deffered queue.

    Regards,

    Luke

    Comment

    • kqfp31
      Member
      • Apr 2012
      • 48

      #3
      1) In dashboard and audits I have something like this:

      I don't see anything about sending emails.
      2)
      I have something like this:
      root@ht-50814ffc17b2c:/etc/zabbix/alert.d# sudo netstat -ntlp | grep :25
      tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 621/sendmail: MTA:
      Is this mean that 25 port is open?

      I don't have this location /var/log/maillog

      In var/log/ I have only:
      alternatives.log.1 dpkg.log mysql.err syslog.3.gz
      apache2 dpkg.log.1 mysql.log syslog.4.gz
      apt faillog mysql.log.1.gz syslog.5.gz
      auth.log fontconfig.log mysql.log.2.gz syslog.6.gz
      auth.log.0 fsck mysql.log.3.gz udev
      auth.log.1.gz kern.log mysql.log.4.gz upstart
      auth.log.2.gz lastlog mysql.log.5.gz user.log
      auth.log.3.gz lpr.log mysql.log.6.gz wtmp
      boot mail.err mysql.log.7.gz wtmp.1
      btmp mail.info news zabbix-agent
      btmp.1 mail.log samba zabbix-server
      daemon.log mail.warn syslog
      dbconfig-common messages syslog.0
      debug msmtp.log syslog.1.gz
      Last edited by kqfp31; 12-11-2012, 17:15.

      Comment

      • kqfp31
        Member
        • Apr 2012
        • 48

        #4
        In logs of Zabbix Server I find something like this:
        31980:20121112:185107.688 Sending list of active checks to [::1] failed: host [ht-50814ffc17b2c] not found
        31978:20121112:185307.750 Sending list of active checks to [::1] failed: host [ht-50814ffc17b2c] not found
        31983:20121112:185507.841 Sending list of active checks to [::1] failed: host [ht-50814ffc17b2c] not found
        31983:20121112:185707.941 Sending list of active checks to [::1] failed: host [ht-50814ffc17b2c] not found
        sh: 1: /etc/zabbix/alert.d//zext_msmtp.sh: Permission denied
        sh: 1: /etc/zabbix/alert.d//gmail.sh: Permission denied
        sh: 1: /etc/zabbix/alert.d//gmail.conf: Permission denied
        sh: 1: /etc/zabbix/alert.d//cli_sms_clickatell.php: Permission denied
        I used chmod 755 on this files. Is this case in this situation?

        Comment

        • lukeiam
          Member
          • Sep 2012
          • 38

          #5
          Which mail client is your Linux using?

          Regards,

          Luke

          Comment

          • kqfp31
            Member
            • Apr 2012
            • 48

            #6
            Originally posted by lukeiam
            Which mail client is your Linux using?

            Regards,

            Luke
            I try to used two clients. One is Msmtp and second is sendmail.

            Comment

            • tchjts1
              Senior Member
              • May 2008
              • 1605

              #7
              Originally posted by kqfp31
              In logs of Zabbix Server I find something like this:

              I used chmod 755 on this files. Is this case in this situation?
              I was going to mention on another post of yours that the scripts were owned by root. Why don't you chown them to zabbix.zabbix and see if that helps?

              Also, why is the log message showing double slashes?

              sh: 1: /etc/zabbix/alert.d//zext_msmtp.sh: Permission denied
              sh: 1: /etc/zabbix/alert.d//gmail.sh: Permission denied
              sh: 1: /etc/zabbix/alert.d//gmail.conf: Permission denied
              sh: 1: /etc/zabbix/alert.d//cli_sms_clickatell.php: Permission denied

              Comment

              • kqfp31
                Member
                • Apr 2012
                • 48

                #8
                Originally posted by tchjts1
                I was going to mention on another post of yours that the scripts were owned by root. Why don't you chown them to zabbix.zabbix and see if that helps?
                I am probably looking like a noob, but I don't know how to do that I don't know what You mean by that.

                Originally posted by tchjts1
                Also, why is the log message showing double slashes?

                sh: 1: /etc/zabbix/alert.d//zext_msmtp.sh: Permission denied
                sh: 1: /etc/zabbix/alert.d//gmail.sh: Permission denied
                sh: 1: /etc/zabbix/alert.d//gmail.conf: Permission denied
                sh: 1: /etc/zabbix/alert.d//cli_sms_clickatell.php: Permission denied
                Again, I don't know why. Wgat should I check?

                Comment

                • tchjts1
                  Senior Member
                  • May 2008
                  • 1605

                  #9
                  When you see "permission denied", it generally means that the user trying to execute the scripts, doesn't have permission, for whatever reason.

                  In your other post, I saw that the scripts were owned by user "root" and group "root". Probably your Zabbix server is running as user zabbix. You can tell this by running ps -ef|grep zabbix

                  But you also show that you chmod'd it to 755, meaning all users have permission to execute it. So I don't know where the permission denied is coming from.

                  Comment

                  • kqfp31
                    Member
                    • Apr 2012
                    • 48

                    #10
                    I have something like below. What this is mean. Is this mean that user Zabbix have only permission to this locations?
                    root@ht-50814ffc17b2c:~# ps -ef|grep zabbix
                    zabbix 544 1 0 Nov06 ? 00:00:00 /usr/sbin/zabbix_agentd
                    zabbix 546 544 0 Nov06 ? 00:01:29 /usr/sbin/zabbix_agentd
                    zabbix 547 544 0 Nov06 ? 00:00:00 /usr/sbin/zabbix_agentd
                    zabbix 548 544 0 Nov06 ? 00:00:00 /usr/sbin/zabbix_agentd
                    zabbix 550 544 0 Nov06 ? 00:00:00 /usr/sbin/zabbix_agentd
                    zabbix 551 544 0 Nov06 ? 00:00:18 /usr/sbin/zabbix_agentd
                    root 2508 2287 0 13:23 pts/0 00:00:00 grep --color=auto zabbix
                    zabbix 31966 1 0 Nov12 ? 00:00:00 /usr/sbin/zabbix_server
                    zabbix 31970 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    zabbix 31971 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    zabbix 31972 31966 0 Nov12 ? 00:00:01 /usr/sbin/zabbix_server
                    zabbix 31973 31966 0 Nov12 ? 00:00:01 /usr/sbin/zabbix_server
                    zabbix 31974 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    zabbix 31975 31966 0 Nov12 ? 00:00:01 /usr/sbin/zabbix_server
                    zabbix 31976 31966 0 Nov12 ? 00:00:01 /usr/sbin/zabbix_server
                    zabbix 31977 31966 0 Nov12 ? 00:00:01 /usr/sbin/zabbix_server
                    zabbix 31978 31966 0 Nov12 ? 00:00:00 /usr/sbin/zabbix_server
                    zabbix 31979 31966 0 Nov12 ? 00:00:00 /usr/sbin/zabbix_server
                    zabbix 31980 31966 0 Nov12 ? 00:00:00 /usr/sbin/zabbix_server
                    zabbix 31983 31966 0 Nov12 ? 00:00:00 /usr/sbin/zabbix_server
                    zabbix 31985 31966 0 Nov12 ? 00:00:00 /usr/sbin/zabbix_server
                    zabbix 31987 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    zabbix 31989 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    zabbix 31991 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    zabbix 31993 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    zabbix 31995 31966 1 Nov12 ? 00:16:51 /usr/sbin/zabbix_server
                    zabbix 31997 31966 0 Nov12 ? 00:00:01 /usr/sbin/zabbix_server
                    zabbix 31998 31966 0 Nov12 ? 00:00:05 /usr/sbin/zabbix_server
                    zabbix 32000 31966 0 Nov12 ? 00:00:05 /usr/sbin/zabbix_server
                    zabbix 32002 31966 0 Nov12 ? 00:00:06 /usr/sbin/zabbix_server
                    zabbix 32003 31966 0 Nov12 ? 00:00:06 /usr/sbin/zabbix_server
                    zabbix 32004 31966 0 Nov12 ? 00:00:05 /usr/sbin/zabbix_server
                    zabbix 32005 31966 0 Nov12 ? 00:00:01 /usr/sbin/zabbix_server
                    zabbix 32006 31966 0 Nov12 ? 00:00:02 /usr/sbin/zabbix_server
                    And results of ls -l:
                    root@ht-50814ffc17b2c:~# ls -l /etc/zabbix/alert.d/
                    total 28
                    -rw-r--r-- 1 root root 0 Nov 12 16:13 You
                    -rwxr-xr-x 1 root root 4004 Nov 7 18:18 cli_sms_clickatell.php
                    -rwxr-xr-x 1 root root 228 Oct 26 16:38 gmail.conf
                    -rwxr-xr-x 1 root root 2662 Oct 26 18:11 gmail.sh
                    -rwxr-xr-x 1 root root 1744 Nov 12 14:51 smstrade.php
                    -rwxr-xr-x 1 root root 350 Nov 12 16:13 zabbix_sendmail.conf
                    -rwxr-xr-x 1 root root 366 Nov 8 19:29 zabbix_sendmail_test.conf
                    -rwxr-xr-x 1 root root 219 Oct 31 17:06 zext_msmtp.sh

                    Comment

                    • Colttt
                      Senior Member
                      Zabbix Certified Specialist
                      • Mar 2009
                      • 878

                      #11
                      chown zabbix.zabbix /etc/zabbix/alert.d/*

                      some log-information?!

                      please login as zabbix-user and try you scripts!
                      Debian-User

                      Sorry for my bad english

                      Comment

                      • tchjts1
                        Senior Member
                        • May 2008
                        • 1605

                        #12
                        To do what Shadow suggests, you can assume the zabbix user by doing sudo su - zabbix and entering your password for the root user.

                        Now that you are user "zabbix", you should be able to see where the issue lies. Try navigating to your scripts dir and running some of them.

                        Comment

                        • kqfp31
                          Member
                          • Apr 2012
                          • 48

                          #13
                          But when I am doing this command, nothing happend:


                          Which logs should I check?

                          Comment

                          • Colttt
                            Senior Member
                            Zabbix Certified Specialist
                            • Mar 2009
                            • 878

                            #14
                            Code:
                            grep -i zabbix /etc/passwd
                            which shell do you have?! /bin/false ??
                            when yes, you must set it to /bin/bash.. otherwise zabbix can“t login
                            Debian-User

                            Sorry for my bad english

                            Comment

                            • kqfp31
                              Member
                              • Apr 2012
                              • 48

                              #15
                              How to do this?
                              root@ht-50814ffc17b2c:~# grep -i zabbix /etc/passwd
                              zabbix:x:110:115::/var/run/zabbix/:/bin/false

                              Comment

                              Working...