Page 1 of 2
UPS
Posted: Sat Jun 29, 2013 2:23 pm
by IvanAK
Hi all
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
Re: UPS
Posted: Sun Jun 30, 2013 5:27 pm
by jsmurphy
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.
Re: UPS
Posted: Mon Jul 01, 2013 5:29 am
by MPIvan
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
Re: UPS
Posted: Mon Jul 01, 2013 12:59 pm
by abrist
Lets find out where it is:
Re: UPS
Posted: Tue Jul 02, 2013 12:56 am
by MPIvan
Here it is ..
/usr/bin/perl
Re: UPS
Posted: Tue Jul 02, 2013 12:50 pm
by lmiltchev
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.
Re: UPS
Posted: Wed Jul 03, 2013 6:06 am
by MPIvan
I dont understand you well
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").
Re: UPS
Posted: Wed Jul 03, 2013 11:50 am
by sreinhardt
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.
Re: UPS
Posted: Thu Jul 04, 2013 5:15 am
by MPIvan
Hi sreinhardt,
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.
Re: UPS
Posted: Mon Jul 08, 2013 11:27 am
by abrist
Try:
Code: Select all
/usr/bin/perl ./check_ups_pow.pl -h