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):
2727 self .port = config .fetch ('zabbix' , 'port' , int )
2828 self .max_queue_size = config .fetch ('sender' , 'queue' , int )
2929 self .fqdn = config .fetch ('zabbix' , 'client' )
30+ self .timeout = config .fetch ('zabbix' , 'timeout' )
3031 self .re_send = config .fetch ('zabbix' , 're_send' , bool )
3132 self .queue = Queue ()
3233 self .log = logging .getLogger (
@@ -115,7 +116,9 @@ def _send_data(self, data):
115116 packet = b'ZBXD\x01 ' + data_len + str .encode (data )
116117 try :
117118 sock = socket .socket ()
119+ sock .settimeout (int (self .timeout ))
118120 sock .connect ((self .host , self .port ))
121+ # time.sleep(100)
119122 self .log .debug ('request: {0}' .format (data ))
120123 sock .sendall (packet )
121124 resp_header = self ._receive (sock , 13 )
You can’t perform that action at this time.
0 commit comments