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.
we uses EATON UPS and im trying to monitor via Nagios, and i have the following errors.
Can some one explain me what this is ?
root@nagios:/usr/local/nagios/libexec# ./check_ups_pow.pl -h
-bash: ./check_ups_pow.pl: /usr/local/groundwork/bin/perl^M: bad interpreter: No such file or directory
root@nagios:/usr/local/nagios/libexec# ./check_ups.0.1.pl
-bash: ./check_ups.0.1.pl: /usr/bin/perl^M: bad interpreter: No such file or directory
root@nagios:/usr/local/nagios/libexec# root@nagios:/usr/local/nagios/libexec# ./check_ups_pow.pl -h
-bash: root@nagios:/usr/local/nagios/libexec#: No such file or directory
It's looking for the perl interpreter (at /usr/bin/perl or /usr/local/groundwork/bin/perl) but can't find it. This means you haven't got perl installed or for whatever reason it hasn't been installed in the required /bin directory(s)... you can solve this by either installing perl or copying the binary to the required directories.
Well according to this output "perl -v" i guess i have perl install
root@nagios:~# perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi
(with 56 registered patches, see perl -V for more detail)
Copyright 1987-2011, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
root@nagios:~#
and you suggest to
or for whatever reason it hasn't been installed in the required /bin directory(s)... you can solve this by either installing perl or copying the binary to the required directories.
How can i find the binary and copy in other directory or other wise how to force or change the path and say that perl is in that directory ... i will love if i can skip copying binary to other directory i rather change the path
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.
Open the plugin in vi, type ":set ff?", press "Enter", and check the output. If it's not showing "fileformat=unix", type ":set ff=unix", and hit "Enter". Check the format again by typing ":set ff?" and hitting "Enter". If it is "unix", save and exit (":wq, Enter").
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Im using Ubuntu server 12.04 LTS. Should i put somewhere :set ff? in the script file or just open with vi and type that. Also i dont know what to do with this ....
If it's not showing "fileformat=unix", type ":set ff=unix", and hit "Enter". Check the format again by typing ":set ff?" and hitting "Enter". If it is "unix", save and exit (":wq, Enter").
Open the plugin in vim
type :set ff?
press "Enter" and check the output.
If it's not showing "fileformat=unix" on the lower right side,
type :set ff=unix
hit "Enter".
Check the format again by typing ":set ff?" and hitting "Enter".
If it is "unix", save and exit (":wq, Enter").
You are doing these steps because the ^M in the first post indicates that this is windows or dos line endings when it needs to be unix.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tnx for the explanation here is what iv done for now ...
root@nagios:/usr/local/nagios/libexec# ./check_ups_pow.pl -h
-bash: ./check_ups_pow.pl: /usr/local/groundwork/bin/perl^M: bad interpreter: No such file or directory
root@nagios:/usr/local/nagios/libexec# vim check_ups_pow.pl
root@nagios:/usr/local/nagios/libexec# ./check_ups_pow.pl -h
-bash: ./check_ups_pow.pl: /usr/local/groundwork/bin/perl: bad interpreter: No such file or directory
root@nagios:/usr/local/nagios/libexec#
the output of error is the same but now there is no ^M.
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.