NSClient problem with russian letters


#1

Hello. Ive faced problem that command check_uptime, inside NSClient, returned boot time without russian letters. Client installed on windows 2008 r2 server with Russian format, location and non-Unicode programs. NSClient version 0.4.3.143.

so usual check inside nsclient (nscp test) show ??? instead current month in russian letters.

Its looks like: "OK: uptime: 20:21h, boot: 2015-???-19 22:03:36 (UTC)

and should be: OK: uptime: 20:21h, boot: 2015-окт-19 22:03:36 (UTC)

this command runs on client every 5 min and data sends via NSCA channel to Nagios Core main host. Messages send through NSCA have same problem and Nagios received this as ??? too.

So, question is, can i avoid it except sets regional settings to English (or similar with English language)?

And second question, time always send as UTC, can i set it to server local time(with timezone offset)?

PS: ive checked NSClient documentation, but did not find anything about changing format date/time or may be sets unicode for output.


#2

NSCA and NRPE does not have support for encoding chars unfortunately.

NSCLient++ can work around this by encoding the data in the format you have “on the other side” so if you set encoding on nsclient++ to whatever you have on linux (often utf8) it should work.


#3

what do you mean “set encoding on nsclient++”? is there option in nsclient for sets encoding? or this means that i should use system encoding to UTF8 or something like this that equal on recepient side? If that, then i cant do this, windows charsets bind to regional settings and i cant change corporate rules for servers.

is this feature planned in future releases?


#4

Hi the same problem occurs with Spanish characters. Ardark says it would be more interesting . Its posible develop this feature ? In the client side Thanks


#5

There is a configuration option in nsclient++ to set the encoding

https://docs.nsclient.org/reference/client/NRPEServer.html#NRPEServer./settings/NRPE/server.encoding.


#6

The ay this works if anytone is intrested is that NSClient++ converts all data to utf8 internally and then use this encoding oubound on the wire. So as long as this matches your target systems (i.e nagios) it should display properly so normally for linux setting this to utf8 is fine.


#7

Hi MickeM

Thanks for your hard work on this project. I have Icinga2 for monitoring. My config is this:

I do the next config with yours coments in my nsclient++ (0.4.3) config:

[/settings/NRPE/server]

allow arguments= 1

allow nasty characters = 1

;allow arguments= true

;allow nasty characters = true

encoding = utf8

But this no solved the problem, In the server side i see the next one:

Nov 29 11:45:59 dashboardv3 nsca[1036]: SERVICE CHECK -> Host Name: 'winduino.usuarios.enrutador.net', Service Description: 'InfoLoadNet', Return Code: '0', Output: 'OK: Conexi?n de red Intel(R) PRO/1000 MT: Avg of 10 seconds: {Total Link Utilisation: 0,00104%}{Rate (Total: 0,00124 MB/sec)(Received: 0,00031 MB/sec)(Sent: 0,00093 MB/sec)} |'Total_Rate'=0.00124MB/sec 'Received_Rate'=0.00031MB/sec 'Sent_Rate'=0.00093MB/sec'
Nov 29 11:45:59 dashboardv3 icinga2: Ignoring invalid perfdata value: Total_Rate=0.00124MB/sec#012Context:#012#011(0) Processing check result for 'winduino.usuarios.enrutador.net!InfoLoadNet'
Nov 29 11:45:59 dashboardv3 icinga2: Ignoring invalid perfdata value: Received_Rate=0.00031MB/sec#012Context:#012#011(0) Processing check result for 'winduino.usuarios.enrutador.net!InfoLoadNet'
Nov 29 11:45:59 dashboardv3 icinga2: Ignoring invalid perfdata value: Sent_Rate=0.00093MB/sec#012Context:#012#011(0) Processing check result for 'winduino.usuarios.enrutador.net!InfoLoadNet'

The client always send me "Conexi?n " , when i need to see “Conexión”

Thanks ¡¡¡

Thanks


#8

And your sure the linux machine running the checks is setup to use utf8?


#9

enrutador
i think that encoding only implemented in 0.5.x clients, at least MickeM share link to 0.5.0 nsclient documentation.


#10

No, encoding was added in 0.4.2.88


#11

is this setting only for NRPE check aspects?

Can i use something similar for NSCA module? because im using check_uptime for passive checks via NSCA module.


#12

Same setting exists for NSCA (set under …/default/target]) and same “kind of solution” i.e. the NSCA protocol does not really have encoding support so you have to match the system encoding on the Nagios server…


#13

I just wanted to express that NSClient++ was returning garbled output when used in conjunction with check_nrpe (check_eventlog) to look for errors in a Windows 2012 system event log (the system language is not English). Adding the “encoding = utf8” directive to nsclient.ini solved the problem, and I am now able to see the system event log contents normally.