Ad Widget

Collapse

Monitoring EXIM

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sdwilders
    Member
    • Feb 2008
    • 33

    #1

    Monitoring EXIM

    I would like to get the queue length from exim reported back to zabbix. The command line is simple:

    exim -bpc

    I have tried the following command in zabbix:

    system.run[exim -bpc,nowait]

    1) What is the difference between 'wait' and 'nowait'? (in this example 'nowait' works but 'wait' returns not supported).
    2) Zabbix always returns the result as 1 even though there are significantly more messages in the queue; I am guessing 1 just means the command ran. How do I get the figure that exim echos instead of 1?
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    nowait means "just run it and return success immediately". wait means "wait for it to return and give me the value" - so no, it is not working for you

    things to check.

    1. system.run requires remote commands enabled in agent config file (and this allows running any command from the zabbix server) - maybe user params are a better choice;

    2. command is run as the zabbix user w/o any environment variables - make sure that actually works
    Zabbix 3.0 Network Monitoring book

    Comment

    • sdwilders
      Member
      • Feb 2008
      • 33

      #3
      Thanks for this, makes sense.

      I'm guessing it may be because I have a space in the command (exim -bpc), how do I get around this?

      I've tried the following item keys:

      system.run[exim -bpc,wait]
      system.run['exim -bpc',wait]
      system.run["exim -bpc",wait]

      Comment

      • sdwilders
        Member
        • Feb 2008
        • 33

        #4
        Hmmm...

        Just tried:

        sudo -u zabbix exim -bpc

        from the command line and got permission denied - how do I get around the permission denied?

        Comment

        • sdwilders
          Member
          • Feb 2008
          • 33

          #5
          Ok, here's how I managed it with some help from richlv...

          create a cronjob under root:

          crontab -u root -e

          added the following:

          */1 * * * * /usr/sbin/exim -bpc > /tmp/eximqueue.tmp

          added the following userparameter:

          UserParameter=eximqueue,cat /tmp/eximqueue.tmp

          Then I just setup the item with the key eximqueue and the triggers as required.

          Comment

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

            #6
            well, you got to the root cause of the problem yourself - zabbix agent/user did not have permissions to run the command.

            you could have granted sudo permissions to it for exim command and then used that as a userparam, but cron solution will also work.

            keep in mind that if command will fail for some reason, zabbix item might go into unsupported state because of empty data returned.
            Zabbix 3.0 Network Monitoring book

            Comment

            • wojciech.wojcik
              Junior Member
              • Sep 2015
              • 4

              #7
              Hello,

              Has anyone ever managed to do this without running a cronjob ? I have tried all variations of sudo config and userparameter configs. Always getting access denied in zabbix_server.log. If anyone is willing to share it I would be glad

              Many thanks

              Comment

              • Firm
                Senior Member
                • Dec 2009
                • 342

                #8
                Add the following line to sudoers:

                zabbix ALL=(root) NOPASSWD: /usr/sbin/exim

                Comment

                Working...