running a perl script.

Marc Powell marc at ena.com
Wed Mar 14 15:04:01 CET 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Mark Thompson
> Sent: Wednesday, March 14, 2007 8:54 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] running a perl script.
> 
> Nagios 2.7 running on OpenSUSE 10.2
> Perl ver 5.8.8
> 
> I have the system up and running using the standard check plugins.  I
> downloaded some perl scripts from nagioexchange but don't seem to know
how
> to use them.  I copied them into the libexec directory, changed the
user
> group, made them exe. When I try to run them from the command line I
get
> the error,
> 
> Nagios1:/usr/local/nagios/libexec # ./check_gwia.pl -h
> -bash: ./check_gwia.pl: /usr/bin/perl^M: bad interpreter: No such file
or
> directory
> 
> Is it telling me it can't find perl?

It's telling you it can't find the program /usr/bin/perl^M. That's
different than /usr/bin/perl. Did you open this file on a Windows box
and save it again? In wordpad perhaps? It has Windows specific
formatting in it that's breaking the script. I'm going to bet that every
line of the script ends in ^M. You'll need to remove them, either
manually or using a vi search/replace like ':%s/[CTRL-V][CTRL-M]//'.

--
Marc

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list