Ad Widget

Collapse

postfix queue monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fulltilt
    Member
    • Nov 2006
    • 39

    #1

    postfix queue monitoring

    like to monitor postfix mailqueue in zabbix ...
    can i use following line in agents_conf:

    Code:
    # Mailqueue
    UserParameter=postfix.queue,postqueue -p | find /var/spool/postfix/{deferred,active,maildrop}/ -type f | wc -
    and how do i set the item in zabbix and alert @ 100 mails?

    Regards
    Last edited by fulltilt; 26-08-2008, 15:04. Reason: solved
  • teferi
    Member
    • Jul 2008
    • 93

    #2
    Originally posted by fulltilt
    like to monitor postfix mailqueue in zabbix ...
    can i use following line in agents_conf:

    Code:
    # Mailqueue
    UserParameter=postfix.queue,postqueue -p | find /var/spool/postfix/{deferred,active,maildrop}/ -type f | wc -
    and how do i set the item in zabbix and alert @ 100 mails?
    Regards
    I may be wrong, but you should set item simply as integer with the key postfix.queue and the trigger would look like {Somehostostfix.queue.last(0)}>100

    Comment

    • fulltilt
      Member
      • Nov 2006
      • 39

      #3
      thanks :-)
      but now i have permission problem to the queue folders ... agent can not access queue folder ... is threre a way to get it working?

      Code:
      # Mailqueue
      UserParameter=postfix.queue,postqueue -p | find /var/spool/postfix/deferred/*/ /var/spool/postfix/active/ /var/spool/postfix/maildrop/ | wc -l
      
      Debian4
      Originally posted by teferi
      I may be wrong, but you should set item simply as integer with the key postfix.queue and the trigger would look like {Somehostostfix.queue.last(0)}>100

      Comment

      • teferi
        Member
        • Jul 2008
        • 93

        #4
        Originally posted by fulltilt
        thanks :-)
        but now i have permission problem to the queue folders ... agent can not access queue folder ... is threre a way to get it working?

        [/CODE]
        Err. add a sudo exception for zabbix user for example or add zabbix user to the postfix group. Aint that obvious?

        Comment

        • fulltilt
          Member
          • Nov 2006
          • 39

          #5
          Originally posted by teferi
          Err. add a sudo exception for zabbix user for example or add zabbix user to the postfix group. Aint that obvious?
          thanks teferi,

          found a solution:
          # Mailqueue
          UserParameter=postfix.queue,mailq | grep -v "Mail queue is empty" | grep -c '^[0-9A-Z]'

          this one is working :-)
          Last edited by fulltilt; 26-08-2008, 15:04.

          Comment

          • teferi
            Member
            • Jul 2008
            • 93

            #6
            happy to help

            Comment

            • richlv
              Senior Member
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Oct 2005
              • 3112

              #7
              Originally posted by fulltilt
              thanks teferi,

              found a solution:
              # Mailqueue
              UserParameter=postfix.queue,mailq | grep -v "Mail queue is empty" | grep -c '^[0-9A-Z]'

              this one is working :-)
              added this as an example userparameter in trunk, thanks
              Zabbix 3.0 Network Monitoring book

              Comment

              • fratotec
                Junior Member
                • May 2010
                • 12

                #8
                Queue monitoring - suggetion

                Hello,
                based on the info from

                I extended my userparameter to

                UserParameter=unix_mail.queue_hold,mailq | grep -v "Mail queue is empty" | egrep -c '^[0-9A-F]{11}[$!]'
                UserParameter=unix_mail.queue_active,mailq | grep -v "Mail queue is empty" | egrep -c '^[0-9A-F]{11}[*]'
                UserParameter=unix_mail.queue_deferred,mailq | grep -v "Mail queue is empty" | egrep -c '^[0-9A-F]{11}[^*]'


                which gives me the number of active, deferred and hold messages.
                As I use MailScanner with the HOLD queue options, this allows me to trigger of mails pile up in the hold queue.

                Regards.

                Comment

                Working...