Nagio plugin installation error

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
marcobto58
Posts: 2
Joined: Tue Feb 04, 2014 10:07 am

Nagio plugin installation error

Post by marcobto58 »

Hi
During make process in nagios plugins 2.0.1 installation i get this error:
...
...
NP_VERSION=2.0.1 mawk -f ./subst check_mailq.pl > check_mailq
mawk: run time error: regular expression compile failed (missing operand)
/var/lib/postfix' || -d '/var/local/lib/postfix
FILENAME="check_mailq.pl" FNR=613 NR=613
make[2]: *** [check_mailq] Error 2
make[2]: Leaving directory `/root/nagios/nagios-plugins-2.0.1/plugins-scripts'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/nagios/nagios-plugins-2.0.1'
make: *** [all] Error 2

have you any suggest?

My environment:

UBUNTU 14.04 LTS X86_64
Nagios core 4.0.6
Nagios plugin 2.0 (working)
postfix 2.11.0-1 amd64

Best ragards
Marco
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagio plugin installation error

Post by abrist »

Looks like mawk thinks there is a regex where there is not. We may want to pull in the monitoring-plugins patchs for the odd awk magic:
https://github.com/monitoring-plugins/m ... 87472ee22f
In order to fix this (there may be a few others as well).
What version of awk/mawk are you using?
If you install GNU awk (gawk), is the issue resolved?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jangomes@gmail.com
Posts: 1
Joined: Thu May 01, 2014 8:50 am

Re: Nagio plugin installation error

Post by jangomes@gmail.com »

Hi there,

I got the same problem with debian 7.5 ...
However, installing the gawk package the issue was solved. :)

Thanks.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagio plugin installation error

Post by tmcdonald »

macrobto58, can you let us know if installing gawk helps?
Former Nagios employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagio plugin installation error

Post by tmcdonald »

Actually, as mentioned in this thread: http://support.nagios.com/forum/viewtop ... 730#p97730

You might have some erroneous lines in check_mailq that are throwing things off. Can you please run the following and post the output?

grep -C15 "exim4" /usr/local/nagios/libexec/check_mailq
Former Nagios employee
koffe
Posts: 1
Joined: Fri May 23, 2014 1:11 pm

Re: Nagio plugin installation error

Post by koffe »

I had the same problem on Ubuntu 12.04.4, installing gawk helped. Thanks!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagio plugin installation error

Post by lmiltchev »

marcobto58,
can you let us know if installing gawk helped?
Be sure to check out our Knowledgebase for helpful articles and solutions!
hafiz
Posts: 1
Joined: Sun Jun 01, 2014 8:55 pm

Re: Nagio plugin installation error

Post by hafiz »

for debian wheezy you can try install gawk package by using this command

#apt-get install gawk:amd64 or
#apt-get install gawk:i386

depanding on your platform linux version either amd64 or i386
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagio plugin installation error

Post by abrist »

Marco, does installing gawk fix your issue?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ydastous
Posts: 4
Joined: Mon Jun 02, 2014 3:03 pm

Re: Nagio plugin installation error

Post by ydastous »

Hello

Just try to install nagios-plugins 2.0.2 and I have the same issue, the check_mailq produce is not good perl. I am on RedHat 6.5 with the gawk package install and the check_mailq perl script is not good around line 613:

Code: Select all

607         }else{
    608                 if (defined $utils::PATH_TO_QMAIL_QSTAT
    609                     && -x $utils::PATH_TO_QMAIL_QSTAT)
    610                 {
    611                         $mailq = 'qmail';
    612                 }
    613 /usr/sbin/postfix               elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
    614 /usr/sbin/postfix                      || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
    615                 {
    616                         $mailq = 'postfix';
    617                 }
    618 exim4           elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
    619 exim                   || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
    620                 {
    621                         $mailq = 'exim';
    622                 }
    623 nullmailer              elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
    624                        || -e 'nullmailer-send'
    625                        || -e 'nullmailer-send')
    626                 {
    627                         $mailq = 'nullmailer';
    628                 }
    629                 else {
    630                         $mailq = 'sendmail';
    631                 }
    632         }
    633 
Locked