djmitche/pynsca — pull request #12 by djmitche (2014-10-22 13:53:39+00:00)
Title: Special characters don't go through

It seems that something in the xoring is off because this simple multiline :
notif.svc_result(SERVER,"Data cleanup", pynsca.CRITICAL, 'test 1\n\ntest2')
gets logged as:
nsca[23423]: SERVICE CHECK -> Host Name: 'SERVER', Service Description: 'Data cleanup', Return Code: '2', Output: 'test 1#012#012test2'
and does not render,
whereas a command line like :
echo -e 'SERVER\tData cleanup\t3\toutput line1\noutput line 2' |/usr/local/nagios/bin/send_nsca -H localhost -c etc/send_nsca.cfg
logs like :
nsca[9150]: SERVICE CHECK -> Host Name: 'SERVER', Service Description: 'Data cleanup', Return Code: '3', Output
: 'output line1\noutput line 2'
and renders fine.
It seems that no special character goes through. Tested were \n, \t, \r