Help - I am unable to send notifications

Marc Powell marc at ena.com
Tue Jul 22 20:14:38 CEST 2008


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.

> root at LOOKINIUM:/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

-------------------------------------------------------------------------
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 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