"Cannot find file" error on host

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.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: "Cannot find file" error on host

Post by eloyd »

Dude, nice catch!
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
logic_bomb421
Posts: 43
Joined: Tue Jul 15, 2014 6:58 pm

Re: "Cannot find file" error on host

Post by logic_bomb421 »

emislivec wrote:
millisa wrote:I'll take a swing since I have an unhealthy relationship with perl...

The perl script has a few issues:

Code: Select all

#!usr/bin/perl
Missing leading slash there. Should probably be:

Code: Select all

#!/usr/bin/perl
This would account for the error from the log:

Code: Select all

execvp(/usr/local/nagios/libexec/ftp.pl, ...) failed. errno is 2: No such file or directory
This would happen if /usr/local/nagios/libexec/ftp.pl doesn't exist, or the interpreter given in the #! line doesn't exist.

(Edit: Also thanks for the thorough posting millisa.)
Wouldn't you know it. A missing forward slash has caused me almost a weeks worth of trouble. Thank you guys so much for all you r help with this. And thank you millisa for giving me a rundown on how to write a better Perl script. Everything seems to be working now. I greatly appreciate everyone helping here.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: "Cannot find file" error on host

Post by eloyd »

If nothing else, regardless of your perl knowledge gained, at least if someone else has a similar problem, your week's worth of banging your head against the screen might help them solve their problem.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
Locked