Printf issues with $output$

Schmitz, Carsten Carsten.Schmitz at aegon.com
Thu Jan 20 17:04:17 CET 2005


> it is processing the backslash as an exit request. Any ideas how to get
> around this??

As someone who has never really used printf (at least not outside C), any reason you can't use echo? Seems to work:

/usr/local/nagios/libexec# printf "tes\t"
tes

/usr/local/nagios/libexec# echo "tes\t"
tes\t

Should work similar to this:

FILE=`mktemp /tmp/nagios_XXXXXX` && echo "my_text_with_backshashes" > $FILE && cat $FILE | mail -s "mytext" recipient at example.com ; rm $FILE

(and there's probably a way to do this without temp files and my "useless use of cat", too ;)

Cheers,

Carsten



-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of Ian
Davidson
Sent: Thursday, January 20, 2005 1:57 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Printf issues with $output$


I've seen a few questions on this subject but have yet to find the
solution, so apologies if I'm going over old ground here.

I'm monitoring some Windows server disks and the resulting output is
along the lines of:

'c:\ - total: 16.92 Gb - used: 11.92 Gb (70%) - free 5.00 Gb (30%)', but
printf is cutting off everything after the 'c:' in the email alerts as
it is processing the backslash as an exit request. Any ideas how to get
around this??

Cheers,

Ian
---
Ian Davidson
Corporate Network Services
Email: idavidso at juniper.net
GSM: +44-7952-173703
Tel: +44-1372-385653 


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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