Nagio plugin installation error
Re: Nagio plugin installation error
Alright, I will attempt to reproduce this issue. What mailq package are you using and where can I get it (so I can test the conditional in the script)?
EDIT: Did you reconfigure and recompile after the installation of gawk?
EDIT: Did you reconfigure and recompile after the installation of gawk?
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.
"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.
Re: Nagio plugin installation error
On redhat 6.5
postfix-2.6.6-6.el6_5.x86_64
I do a plain
and after
Yves
postfix-2.6.6-6.el6_5.x86_64
I do a plain
Code: Select all
./configure
Code: Select all
make
Yves
Re: Nagio plugin installation error
The perl code contain lines like:
I think the bug is with the nagios-plugins-2.0.2/plugins-scripts/subst awk code,
Since check_mailq contain refrence to full path name cmd the script try to substitute them ........
you can reproduce the bug with a script of 1 line:
and try to run subst on it:
Code: Select all
|| -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim'
Code: Select all
50 # If a script contains a reference to a fully qualified command,
51 # subst will replace the fully qualified command with whatever is
52 # returned from the which subroutine. run before changes to INC to add libexecdir
53 # FIXME: Prepend executables with a substitution keyword instead.
54 #
55 /^[^#]/ && /(\/.*)?\/(bin|sbin|lib|libexec)\// {
56 match($0,/(\/.*)?\/(bin|sbin|lib|libexec)\/[-_a-zA-Z0-9]+/);
57 c=substr($0,RSTART,RLENGTH);
58 sub(c,which(c,path));
59 }
you can reproduce the bug with a script of 1 line:
Code: Select all
echo "'/usr/sbin/exim' || '/usr/local/sbin/exim'" > t.pl
Code: Select all
NP_VERSION=2.0.2 gawk -f ./subst t.pl > tt
Re: Nagio plugin installation error
Thanks for the bug report and example. I have been looking at the awk script and I feel it may be best to pull in the changes from monitoring-plugins that removes the ugly awk script in its entirety. Replacing '||' with 'or' will just cause problems with mawk. I will look at this more tomorrow. Even if we shim the regex in subst, there will be further problems down the road as we update other things in the perl plugins. The changes from MP will also bring with it better trusted path support.
The only issue is that using FindBin will force us to disable perl taint checks (though not all the perl scripts even do the taint check). Do you think this is acceptable? Maybe there is an alternative to FindBin?
I will patch a new branch tomorrow and post the link here for those interested in trying the subst/trusted path changes.
The only issue is that using FindBin will force us to disable perl taint checks (though not all the perl scripts even do the taint check). Do you think this is acceptable? Maybe there is an alternative to FindBin?
I will patch a new branch tomorrow and post the link here for those interested in trying the subst/trusted path changes.
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.
"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.
Re: Nagio plugin installation error
There is indeed something bad happening with check_mailq.
Had the same compile error and then installed gawk as outlined in this thread. Compilation then worked but trying to launch the plugin gives this error:
The problems seem to come from this commit: https://github.com/nagios-plugins/nagio ... 8033cace40
Running Debian 7.5 here.
Had the same compile error and then installed gawk as outlined in this thread. Compilation then worked but trying to launch the plugin gives this error:
Code: Select all
./plugins-scripts/check_mailq --help
Having no space between pattern and following word is deprecated at ./plugins-scripts/check_mailq line 613.
Bareword found where operator expected at ./plugins-scripts/check_mailq line 613, near "/usr/sbin"
(Missing operator before bin?)
Semicolon seems to be missing at ./plugins-scripts/check_mailq line 618.
syntax error at ./plugins-scripts/check_mailq line 613, near "/usr/sbin"
syntax error at ./plugins-scripts/check_mailq line 618, near "exim4 elsif"
syntax error at ./plugins-scripts/check_mailq line 623, near "nullmailer elsif"
syntax error at ./plugins-scripts/check_mailq line 670, near "}"
Execution of ./plugins-scripts/check_mailq aborted due to compilation errors.
Running Debian 7.5 here.
Re: Nagio plugin installation error
I think we will revert the commit for the next release and start testing the MP commits for trusted path/no awk-magic in a new branch.
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.
"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.
Re: Nagio plugin installation error
Commits reverted: https://github.com/nagios-plugins/nagio ... its/master
Branch of MP code coming shortly.
Branch of MP code coming shortly.
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.
"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.
Re: Nagio plugin installation error
Branch "findbin" pushed to github. If anyone gets a chance, try out the new branch and let me know your thoughts.
https://github.com/nagios-plugins/nagio ... ts/findbin
EDIT: Github issue: https://github.com/nagios-plugins/nagio ... /issues/35
https://github.com/nagios-plugins/nagio ... ts/findbin
EDIT: Github issue: https://github.com/nagios-plugins/nagio ... /issues/35
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.
"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.
Re: Nagio plugin installation error
Hello,
Just test the check_mailq produce with the change in the branch and the result work for me !!
Yves
Just test the check_mailq produce with the change in the branch and the result work for me !!
Yves
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Nagio plugin installation error
Excellent news! Lets see how it works out for the others.