<br><font size=2 face="sans-serif">The use of printf is necessary so you can nicely format the output as mail.</font>
<br><font size=2 face="sans-serif">echo does not easily support linebreaks and such. You could force them</font>
<br><font size=2 face="sans-serif">of course by using quoting ^M into the output, but that might pose other</font>
<br><font size=2 face="sans-serif">unforeseen problems.</font>
<br>
<br><font size=2 face="sans-serif">sash</font>
<br>
<br><font size=2 face="sans-serif">--------------------------------------------------<br>
Sascha Runschke<br>
Netzwerk Administration<br>
IT-Services<br>
<br>
ABIT AG<br>
Robert-Bosch-Str. 1<br>
40668 Meerbusch<br>
<br>
Tel.:+49 (0) 2150.9153.226<br>
mailto:SRunschke@abit.de<br>
<br>
http://www.abit.net<br>
http://www.abit-epos.net<br>
http://www.my-academy.net<br>
--------------------------------------------------<br>
Der Inhalt dieser Email sowie die Anhänge sind ausschließlich für den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser Email oder dessen Vertreter sein sollten, so beachten Sie bitte, daß jede Form der Kenntnisnahme, Veröffentlichung,  Vervielfältigung oder Weitergabe des Inhalts dieser Email unzulässig ist. Wir möchten Sie außerdem darauf hinweisen, daß die Kommunikation per Email über das Internet unsicher ist, da fuer unberechtigte Dritte grundsätzlich die Möglichkeit der Kenntnisnahme und Manipulation besteht. Wenn Sie diese Nachricht versehentlich erhalten, informieren Sie bitte den Absender und löschen diese Nachricht mit den Anhängen. Herzlichen Dank<br>
<br>
The information and any attachments contained in this email are intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any form of disclosure, reproduction, distribution or any action taken or refrained from in reliance on it, is prohibited and may be unlawful. We also like to inform you that communication via email over the internet is insecure because third parties may have the possibility to access and manipulate emails. If you have received the message in error, please advise the sender and delete the message and any attachments. Thank you very much.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"Schmitz, Carsten" <Carsten.Schmitz@aegon.com></b></font>
<br><font size=1 face="sans-serif">Gesendet von: nagios-users-admin@lists.sourceforge.net</font>
<p><font size=1 face="sans-serif">20.01.2005 17:04</font>
<br>
<td><font size=1 face="Arial">        </font>
<br><font size=1 face="sans-serif">        An:        "Ian Davidson" <idavidso@juniper.net>, <nagios-users@lists.sourceforge.net></font>
<br><font size=1 face="sans-serif">        Kopie:        </font>
<br><font size=1 face="sans-serif">        Thema:        RE: [Nagios-users] Printf issues with $output$ [Virus scanned]</font></table>
<br>
<br>
<br><font size=2 face="Courier New"><br>
> it is processing the backslash as an exit request. Any ideas how to get<br>
> around this??<br>
<br>
As someone who has never really used printf (at least not outside C), any reason you can't use echo? Seems to work:<br>
<br>
/usr/local/nagios/libexec# printf "tes\t"<br>
tes<br>
<br>
/usr/local/nagios/libexec# echo "tes\t"<br>
tes\t<br>
<br>
Should work similar to this:<br>
<br>
FILE=`mktemp /tmp/nagios_XXXXXX` && echo "my_text_with_backshashes" > $FILE && cat $FILE | mail -s "mytext" recipient@example.com ; rm $FILE<br>
<br>
(and there's probably a way to do this without temp files and my "useless use of cat", too ;)<br>
<br>
Cheers,<br>
<br>
Carsten<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: nagios-users-admin@lists.sourceforge.net<br>
[mailto:nagios-users-admin@lists.sourceforge.net]On Behalf Of Ian<br>
Davidson<br>
Sent: Thursday, January 20, 2005 1:57 PM<br>
To: nagios-users@lists.sourceforge.net<br>
Subject: [Nagios-users] Printf issues with $output$<br>
<br>
<br>
I've seen a few questions on this subject but have yet to find the<br>
solution, so apologies if I'm going over old ground here.<br>
<br>
I'm monitoring some Windows server disks and the resulting output is<br>
along the lines of:<br>
<br>
'c:\ - total: 16.92 Gb - used: 11.92 Gb (70%) - free 5.00 Gb (30%)', but<br>
printf is cutting off everything after the 'c:' in the email alerts as<br>
it is processing the backslash as an exit request. Any ideas how to get<br>
around this??<br>
<br>
Cheers,<br>
<br>
Ian<br>
---<br>
Ian Davidson<br>
Corporate Network Services<br>
Email: idavidso@juniper.net<br>
GSM: +44-7952-173703<br>
Tel: +44-1372-385653 <br>
<br>
<br>
-------------------------------------------------------<br>
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting<br>
Tool for open source databases. Create drag-&-drop reports. Save time<br>
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.<br>
Download a FREE copy at http://www.intelliview.com/go/osdn_nl<br>
_______________________________________________<br>
Nagios-users mailing list<br>
Nagios-users@lists.sourceforge.net<br>
https://lists.sourceforge.net/lists/listinfo/nagios-users<br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. <br>
::: Messages without supporting info will risk being sent to /dev/null<br>
<br>
<br>
-------------------------------------------------------<br>
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting<br>
Tool for open source databases. Create drag-&-drop reports. Save time<br>
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.<br>
Download a FREE copy at http://www.intelliview.com/go/osdn_nl<br>
_______________________________________________<br>
Nagios-users mailing list<br>
Nagios-users@lists.sourceforge.net<br>
https://lists.sourceforge.net/lists/listinfo/nagios-users<br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. </font>
<br><font size=2 face="Courier New">::: Messages without supporting info will risk being sent to /dev/null<br>
</font>
<br>
<br>