On Tue, 2008-07-22 at 11:14 -0700, Marc Powell wrote: > > On Jul 22, 2008, at 12:26 PM, jonathan williams wrote: > >> > > >> Umm..what can I say? Wow. OK.. I fixed that in the send_mail.pl > >> file. Any other steps I need to take once I did that to make it > >> work. > >> I did re-run the sed-i command and still get the same error: > > > > Not unless you experience further errors. > > > [EMAIL PROTECTED]:/usr/local/nagios/libexec# sed -i '1s,.*,#!/usr/bin/ > > perl > > -w,' check_sendmail.pl > > sed: can't read check_sendmail.pl: No such file or directory > > Ok. sed 101. > > sed -i '1s,.*,#!/usr/bin/perl -w,' check_sendmail.pl > > The above is a sed 1-liner. It performs an immediate action and then > exits. What action? Let's break it down -- > > sed : this is the command to be executed > -i : this tells sed that it's going to be editing an existing file > 1s : the start of the actual sed script. This means we're going to be > doing 1 substitution > .* : this is what we're going to be looking for, essentially any > content on the line > #!/usr/bin/perl -w : what the previous match will be replaced with > check_sendmail.pl : The file that sed is going to be editing > > The end result is that sed would replace the entire first line of the > file check_sendmail.pl, located in your current directory, with the > text '#!/usr/bin/perl -w'. > > Your confusion is that the filename should have been check_mail.pl, > not check_sendmail.pl. > > -- > Marc >
Thank you for that breakdown. I am still having the same error in my nagios.log: "[1216749581] SERVICE NOTIFICATION: nagiosadmin;jwilliamspc;PrintSpooler;OK;service-notify-by-email;Spooler: Started [1216749581] Warning: Attempting to execute the command "/usr/local/nagios/libexec/send_mail.pl -n "SERVICE RECOVERY" -h "jwilliamspc" -s "OK" -a "10.10.113.51" -i "PrintSpooler - Spooler: Started - check_nt!SERVICESTATE!-d SHOWALL -l Spooler" -d "Tue Jul 22 10:59:41 PDT 2008" -e "[EMAIL PROTECTED]"" resulted in a return code of 126. Make sure the script or binary you are trying to execute actually exists..." The top line in the send_mail.pl script is indeed "#!/usr/bin/perl -w". I am not sure what it does though. Doesn't the # mean it is remarked? I guess my confusion is that there is no such file on my system called check_sendmail.pl or check_mail.pl. I was unable to locate any of them. There is only a check_mailq. That is why when you state: #!/usr/bin/perl -w : what the previous match will be replaced with > check_sendmail.pl : The file that sed is going to be editing > > The end result is that sed would replace the entire first line of the > file check_sendmail.pl, located in your current directory, with the > text '#!/usr/bin/perl -w'. > > Your confusion is that the filename should have been check_mail.pl, > not check_sendmail.pl. I get lost. > > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Nagios-users mailing list Nagios-users@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