Page 1 of 1

Nagio plugin installation error

Posted: Sat May 10, 2014 12:26 am
by robotto
In reference to this topic: http://support.nagios.com/forum/viewtop ... 35&t=26852

I habe the same issue on Debian 7.5.

After installing gawak everything looks ok but I now I geht the following error.
Having no space between pattern and following word is deprecated at ./check_mailq line 613.
Bareword found where operator expected at ./check_mailq line 613, near "/usr/sbin"
(Missing operator before bin?)
Semicolon seems to be missing at ./check_mailq line 618.
syntax error at ./check_mailq line 613, near "/usr/sbin"
syntax error at ./check_mailq line 618, near "exim4 elsif"
syntax error at ./check_mailq line 623, near "nullmailer elsif"
syntax error at ./check_mailq line 670, near "}"
Execution of ./check_mailq aborted due to compilation errors.
The file /usr/local/nagios/libexec/check_mailq show this.

Code: Select all

        }else{
                if (defined $utils::PATH_TO_QMAIL_QSTAT
                    && -x $utils::PATH_TO_QMAIL_QSTAT)
                {
                        $mailq = 'qmail';
                }
/usr/sbin/postfix               elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
/usr/sbin/postfix                      || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
                {
                        $mailq = 'postfix';
                }
exim4           elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
exim                   || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
                {
                        $mailq = 'exim';
                }
nullmailer              elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
                       || -e 'nullmailer-send'
                       || -e 'nullmailer-send')
                {
                        $mailq = 'nullmailer';
                }
                else {
                        $mailq = 'sendmail';
                }
        }

Re: Nagio plugin installation error

Posted: Mon May 12, 2014 10:06 am
by tmcdonald
That's very odd, and I have the same thing going on in my plugin.

The lines should be as follows:

Code: Select all

            }else{
                    if (defined $utils::PATH_TO_QMAIL_QSTAT
                        && -x $utils::PATH_TO_QMAIL_QSTAT)
                    {
                            $mailq = 'qmail';
                    }
                    elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
                        || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
                    {
                            $mailq = 'postfix';
                    }
                    elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
                        || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
                    {
                            $mailq = 'exim';
                    }
                    elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
                           || -e 'nullmailer-send'
                           || -e 'nullmailer-send')
                    {
                            $mailq = 'nullmailer';
                    }
                    else {
                            $mailq = 'sendmail';
                    }
            }


Re: Nagio plugin installation error

Posted: Tue May 13, 2014 1:21 am
by robotto
When I modify the file it works

Re: Nagio plugin installation error

Posted: Tue May 13, 2014 9:30 am
by slansing
You modified to what Tmcdonald showed? I'm going to check with the plugins dev today and see if it's currently still a dirty script in the development version they use.

Re: Nagio plugin installation error

Posted: Tue May 13, 2014 1:01 pm
by robotto
When I modified the script it works.