Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 54

Thread: Zimbra Monitoring with Nagios

  1. #21
    sems is offline Trained Alumni
    Join Date
    Apr 2009
    Posts
    13
    Rep Power
    6

    Default

    I have set it up mostly, only issue so far is that check_mailq returns:

    "CRITICAL: Error code 78 returned from /usr/bin/mailq "

    in Nagios. From command line if I enter:

    /usr/local/nagios/libexec/check_mailq -w 100 -c 150 -M postfix

    it gives:

    Couldn't match output

    If I use /usr/local/nagios/libexec/check_mailq -w 100 -c 150

    then I get:

    OK: mailq is empty|unsent=0;100;150;0

    but i don't think it is checking the proper folder. I might end up using

    ls -l /opt/zimbra/data/postfix/spool/deferred/* | grep '-' | wc -l

    in a script, but I thought I'll check with you first Jummo.

  2. #22
    sems is offline Trained Alumni
    Join Date
    Apr 2009
    Posts
    13
    Rep Power
    6

    Default

    Spoke too soon, also

    /usr/local/nagios/libexec/check_nrpe -H myhostname -c check_zimbra_clamd_sig

    generates "NRPE: Unable to read output". Interestingly all other commands are working fine, so at least it is not a NRPE connectivity issue. I also checked on myhostname, the script runs fine, it outputs:

    # sudo -u zimbra /usr/local/nagios/libexec/check_clamav.pl -w 3 -c 5
    ClamAV OK: daily.cvd 9554 (Fri Jul 10 12:05:16 2009) is up to date

    So, I don't know what the issue is. I am running Nagios 3.1.2, Plugins 1.4.13, NRPE 2.12

  3. #23
    jummo is offline Special Member
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    check_zimbra_clamd_sig
    Did you have run "sudo -u zimbra /usr/local/nagios/libexec/check_clamav.pl -w 3 -c 5" as user nagios (su - nagios)?

    check_zimbra_mailq
    Sorry, I forgot to mention that I have changed /usr/lib/perl5/vendor_perl/5.8.8/utils.pm to use the mailq executable supplied by Zimbra.
    Diff on my CentOS 5 system:
    Code:
    /usr/lib/perl5/vendor_perl/5.8.8/utils.pm
    24c24
    < $PATH_TO_MAILQ   = "/usr/bin/mailq";
    ---
    > $PATH_TO_MAILQ   = "/opt/zimbra/postfix/sbin/mailq";
    Last edited by jummo; 07-15-2009 at 12:37 PM.

  4. #24
    sems is offline Trained Alumni
    Join Date
    Apr 2009
    Posts
    13
    Rep Power
    6

    Default

    I actually did after I sent the message. But I can't figure out why permission is denied:

    sudo -u zimbra /usr/local/nagios/libexec/check_clamav.pl -w 3 -c 5
    -bash: /usr/bin/sudo: Permission denied

    /etc/sudoers shows:

    nagios ALL=(zimbra) NOPASSWD: /usr/local/nagios/libexec/check_clamav.pl

    And if I run the command "/usr/local/nagios/libexec/check_clamav.pl -w 3 -c 5" as zimbra (su - zimbra , while under root), it works. Any ideas?

    I'll update the utils.pm and see how it goes with mailq.

  5. #25
    jummo is offline Special Member
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    I looks like the nagios user don't have permission to execute /usr/bin/sudo.
    What shows a ls -la /usr/bin/sudo? And what OS do you run?

  6. #26
    sems is offline Trained Alumni
    Join Date
    Apr 2009
    Posts
    13
    Rep Power
    6

    Default

    I am on RHEL 5.3.

    ls -la /usr/bin/sudo shows:

    ---s--x--- 2 root wheel 150896 Jan 29 05:52 /usr/bin/sudo

    So, I can add nagios to the wheel group and it works. That shouldn't create any security holes hopefully.

    Thanks for the help

  7. #27
    jummo is offline Special Member
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    My sudo has world executetable right.
    Code:
    ---s--x--x 2 root root 140744 Mar 25 00:55 /usr/bin/sudo
    This is the default on a fresh CentOS installation. Have you tweaked your installation for more security?

  8. #28
    sems is offline Trained Alumni
    Join Date
    Apr 2009
    Posts
    13
    Rep Power
    6

    Default

    I haven't, it could be a part of RHEL, I haven't used RHEL prior to this, just CentOS.

  9. #29
    buee is offline Loyal Member
    Join Date
    Feb 2009
    Posts
    76
    Rep Power
    6

    Default Not working for me

    Hey, I hate to dig up old topics but I'm really hoping to get this one working. When I run /usr/local/nagios/libexec/check_mailq -w 250 -c 500 as root, it comes back correctly. When I run it as nagios, I get
    Code:
    Program mode requires special privileges, e.g., root or TrustedUser.
    CRITICAL: Error code 78 returned from /usr/bin/mailq
    even though I've modified the utils.pm file to reflect the mailq in /opt/zimbra. Does something need to be restarted after that?

    I've appended the sudoers files with:
    Code:
    nagios ALL=(zimbra) NOPASSWD: /usr/local/nagios/libexec/check_mailq
    And ls -la /usr/bin/sudo shows:
    Code:
    ---s--x--x 2 root root 140744 Mar 24 18:55 /usr/bin/sudo
    Just like yours, jummo

    What am I missing?

  10. #30
    jummo is offline Special Member
    Join Date
    May 2009
    Location
    Bremen, Germany
    Posts
    122
    Rep Power
    6

    Default

    I don't need sudo to perform this check.
    The error indicates that you still use /usr/bin/mailq and not /opt/zimbra/postfix/sbin/mailq.
    You can add
    Code:
    print "$utils::PATH_TO_MAILQ \n";
    after use utils to /usr/local/nagios/libexec/check_mailq to see which mailq is in use.
    Perhaps you have to edit the utils.pm in /usr/local/nagios/libexec/ instead of the system wide /usr/lib/perl5/vendor_perl/5.8.8/utils.pm.

Page 3 of 6 FirstFirst 12345 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 01-12-2012, 02:20 AM
  2. admin consol blank after 5.0.3 upgarde
    By maumar in forum Administrators
    Replies: 6
    Last Post: 03-21-2008, 05:16 AM
  3. Replies: 12
    Last Post: 02-25-2008, 07:28 PM
  4. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 08:55 AM
  5. Fedora Core 3, Clean Install - Not working!
    By pcjackson in forum Installation
    Replies: 17
    Last Post: 03-05-2006, 07:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •