Nagio plugin installation error

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Nagio plugin installation error

Postby robotto » Sat May 10, 2014 12:26 am

In reference to this topic: viewtopic.php?f=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';
                }
        }
Last edited by tmcdonald on Tue May 13, 2014 2:14 pm, edited 2 times in total.
Reason: I have split your reply to that topic into its own for organization purposes.
robotto
 
Posts: 10
Joined: Sun Sep 22, 2013 12:08 am

Re: Nagio plugin installation error

Postby tmcdonald » Mon May 12, 2014 10:06 am

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';
                    }
            }

Former Nagios employee
tmcdonald
 
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagio plugin installation error

Postby robotto » Tue May 13, 2014 1:21 am

When I modify the file it works
robotto
 
Posts: 10
Joined: Sun Sep 22, 2013 12:08 am

Re: Nagio plugin installation error

Postby slansing » Tue May 13, 2014 9:30 am

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.
slansing
 
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagio plugin installation error

Postby robotto » Tue May 13, 2014 1:01 pm

When I modified the script it works.
robotto
 
Posts: 10
Joined: Sun Sep 22, 2013 12:08 am


Return to Community Support

Who is online

Users browsing this forum: No registered users and 38 guests