Check_Mk RAW 1.4.0p37 AttributeError: 'dict' object has no attribute 'replace'


(Aleksey) #1

Hello, after update Check_MK RAW from 1.4.0p33 to 1.4.0p37

Error message in mkeventd.log and not show event in Event View.

Can someone have encountered such an error and can suggest what to do?

[1543841490.904572] Error handling client : ‘dict’ object has no attribute ‘replace’
[1543841490.904797] Traceback (most recent call last):
File “/omd/sites/mysite/bin/mkeventd”, line 3057, in serve
addr_info and addr_info[0] or “”)
File “/omd/sites/mysite/bin/mkeventd”, line 3110, in handle_client
self._answer_query(client_socket, output_format, response)
File “/omd/sites/mysite/bin/mkeventd”, line 3123, in _answer_query
client_socket.sendall("\t".join([to_utf8(quote_tab©) for c in line]))
File “/omd/sites/mysite/bin/mkeventd”, line 847, in quote_tab
return col.replace("\t", " ")
AttributeError: ‘dict’ object has no attribute ‘replace’


(Aleksey) #2

I add file vi /omd/sites/mysite/bin/mkeventd
and it works, but probably not right

def quote_tab(col):
    if type(col) in [ float, int ]:
        return str(col)
    elif type(col) == bool:
        return col and "1" or "0"
    elif type(col) in [ tuple, list, dict ]:
        col = "\1" + "\1".join([ quote_tab(e) for e in col ])
    elif col == None:
        col = "\2"
    # print(str(col))
    return col.replace("\t", " ")