File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ def __init__(self, config):
27
27
self .port = config .fetch ('zabbix' , 'port' , int )
28
28
self .max_queue_size = config .fetch ('sender' , 'queue' , int )
29
29
self .fqdn = config .fetch ('zabbix' , 'client' )
30
+ self .timeout = config .fetch ('zabbix' , 'timeout' )
30
31
self .re_send = config .fetch ('zabbix' , 're_send' , bool )
31
32
self .queue = Queue ()
32
33
self .log = logging .getLogger (
@@ -115,7 +116,9 @@ def _send_data(self, data):
115
116
packet = b'ZBXD\x01 ' + data_len + str .encode (data )
116
117
try :
117
118
sock = socket .socket ()
119
+ sock .settimeout (int (self .timeout ))
118
120
sock .connect ((self .host , self .port ))
121
+ # time.sleep(100)
119
122
self .log .debug ('request: {0}' .format (data ))
120
123
sock .sendall (packet )
121
124
resp_header = self ._receive (sock , 13 )
You can’t perform that action at this time.
0 commit comments