UTF8 Japanese characters in macros

Leonid Titov leonid.titov at gmail.com
Mon Nov 13 15:41:35 CET 2006


Hi!

I encountered the same problem with Nagios 2.3 running on FreeBSD.
I supposed that the problem is a command-line interface, which - as I
supposed - couldn't transfer a UTF-8 encoded string to /usr/bin/printf.
So I wrote a simple perl script which streamed UTF-8 through STDIN.
Unfortunately, this trial was unsuccessfull: I still have blanks instead
of Cyrillic characters.  
I think this issue is deeply inherent from nagios internal architecture,
which was not intended to use in a non-ASCII environment :(

> I am running nagios 2.5 on SuSE 10.1, and I would like to include
> japanese in my mail notifications.  SuSE is set up to use UTF8 as the
> base language, and I am using the standard host-notify-by-email command
> provided in the example configs as below:
> 
> /usr/bin/printf "%b" "***** Nagios  *****\n\nNotification Type:
> $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
> $HOSTADDRESS$\n$HOSTNOTES$\n\nInfo: $HOSTOUTPUT$\n\nDate/Time:
> $LONGDATETIME$\n" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for
> $HOSTNAME$!" $CONTACTEMAIL$
> 
> note the use of $HOSTNOTES$, this is where I would like to include the
> japanese location of the device having problems.
> 
> for example I have the following hostextinfo entry:
> 
> define hostextinfo{
> host_name       mail
> notes           [room name in japanese UTF8]
> }
> 
> However, the mail arrives with an empty line where the notes information
> should be.  If I include some english in the notes section, for example
> "Location: [Japanese]" the mail contains "Location: ", but not the rest.
> 
> Both printf and mail work fine with UTF8 japanese, and tests using only
> the $HOSTNOTES$ macro yeilds similar results (nothing output).
> The CGI's work fine, and display the japanese, so it seems the macro
> processing is not able to handle the characters.
> 
> Has anyone had similar problems, and is there a solution?
> 
> Thanks,
> Martin
-- 
Leonid Titov <leonid.titov at gmail.com>
Silvernet urban network: http://www.silvernet.ru


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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