Ad Widget

Collapse

Monitor mail server on Linux/Unix servers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dstubbs
    Junior Member
    • Oct 2006
    • 11

    #1

    Monitor mail server on Linux/Unix servers

    I have been trying to configure Zabbix to monitor my mail server which is on a Fedora Core installation.

    I have seen lots of posts from users with what they have tried but I cannot seem to get anything to work correctly.


    Here is some of the things I have tried:

    This always return 0-
    UserParameter=mail.queue_count,mailq|grep "Total"|cut -f3 -d" "

    The below commands should if they worked return the number of files in the mail queue times 2 which can be corrected by a .5 multiplier.

    This always returns 0-
    UserParameter=mail.queue_count,ls /var/spool/mqueue/ | wc -w

    This one always returns 1-
    UserParameter=mail.queue_count,echo /var/spool/mqueue/* | wc -w

    The below command always returns 'Not Supported'-
    UserParameter=mail.queue_size,ls -lA /var/spool/mqueue | grep "total" | cut -f2 -d" "

    Now if I su to the zabbix user and run these commands at the console, I get the correct output. Note: I had to add the zabbix user to the mail in order to read the /var/spool/mqueue directory.

    Has anyone had luck with trying to monitor their mail queue and size parameters?

    Thanks
  • sphaero
    Junior Member
    • Nov 2005
    • 11

    #2
    Well i was just looking into this subject but since I'm using postfix I'd use a command like this:

    mailq |grep "Requests." | cut -d " " -f 5
    which will give me the total entries in the queue.

    Comment

    • biloude
      Junior Member
      • Jan 2007
      • 16

      #3
      ok, but what is your item for return the value in Zabbix ?
      thanks

      Comment

      • crashdummyMCH
        Member
        • Jun 2006
        • 33

        #4
        mailq check that works with sudo (mailq privileged command)

        --zabbix node--
        1. add the user zabbix to sudo without password
        2. copy zabbix_sendmail.pl script to zabbix executable directory
        3. edit zabbix_agentd.conf file add:
        #sendmail stats
        UserParameter=sendmail.mailq,/usr/local/zabbix_agentd/zabbix_sendmail.pl
        4. restart zabbix_agentd
        --zabix node--

        --zabbix server--
        1. create item
        key=sendmail.mailq
        type of information=numeric
        --zabbix server--

        by using sudo with no password zabbix will now be able to execute the privileged mailq command and sendmail results

        hope this helps
        Attached Files

        Comment

        Working...