No pipe in external commands
Frank Werner
develop at WernerOnline.de
Wed Oct 9 18:46:05 CEST 2002
Hello,
I,ve got problems in notifying me per email.
I use a sendEmail (a perl script) to send emails from console. It works great.
With nagios it works only when I use the following in misccommands.cfg:
---
define command{
command_name notify-by-email
command_line sendEmail -m "row1\nrow2\n" -t frank -f Nagios
}
---
This code sends me an email, but the problem is that the \n is not be
substituted.
This code should be work, but nothing is happend. No mail, no errors.
---
define command{
command_name notify-by-email
command_line printf "%b" "row1\nrow2\n" | sendEmail -t frank -f Nagios
}
---
The code: 'printf "%b" "row1\nrow2\n" | sendEmail -t frank -f Nagios' direct
at the console hacked works great: ist sends me an email with two rows in the
body.
So my concluseion is that the problem has to do with the pipe from printf to
sendEmail started from nagios.
I have enabled the --DEBUG0..5 in the configure script of nagios, and I get a
lot of debugging hints, but this did not solve my problem.
Maybe someone out there, who has the same problem and can point me to the
right direction.
Thanks for any help.
Frank
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
More information about the Users
mailing list