diff --git a/example/toCentral-REQTextToLogFile.json b/example/toCentral-REQTextToLogFile.json index 80fdb74..df9bfda 100644 --- a/example/toCentral-REQTextToLogFile.json +++ b/example/toCentral-REQTextToLogFile.json @@ -1,7 +1,7 @@ [ { "directory": "random_text_log", - "fileExtension": "log", + "fileExtension": ".log", "toNode": "central", "data": ["some message sent from a ship for testing\n"], "commandOrEvent":"EventACK", diff --git a/example/toShip1-REQCliCommand.json b/example/toShip1-REQCliCommand.json index b9b1777..f68714d 100644 --- a/example/toShip1-REQCliCommand.json +++ b/example/toShip1-REQCliCommand.json @@ -1,7 +1,7 @@ [ { "directory":"cli_command__result", - "fileExtension": "result", + "fileExtension": ".result", "toNode": "ship1", "data": ["bash","-c","sleep 3 & tree ./"], "method":"REQCliCommand", diff --git a/example/toShip1-REQHttpGet.json b/example/toShip1-REQHttpGet.json index a9e4edc..d919119 100644 --- a/example/toShip1-REQHttpGet.json +++ b/example/toShip1-REQHttpGet.json @@ -1,11 +1,11 @@ [ { "directory": "metrics/network/sniffer", - "fileExtension": "html", - "toNode": "ship2", + "fileExtension": ".html", + "toNode": "ship1", "data": ["http://vg.no"], "method":"REQHttpGet", - "timeout":10, + "timeout":5, "retries":3, "methodTimeout": 5 } diff --git a/example/toShip1-REQOpCommand.json b/example/toShip1-REQOpCommand.json index 4567994..84d3f45 100644 --- a/example/toShip1-REQOpCommand.json +++ b/example/toShip1-REQOpCommand.json @@ -1,7 +1,7 @@ [ { "directory":"opcommand_logs", - "fileExtension": "log", + "fileExtension": ".log", "toNode": "ship1", "data": ["ps"], "method":"REQOpCommand", diff --git a/example/toShip1-REQPing.json b/example/toShip1-REQPing.json index 070129f..8d27797 100644 --- a/example/toShip1-REQPing.json +++ b/example/toShip1-REQPing.json @@ -1,7 +1,7 @@ [ { "directory": "ping", - "fileExtension":"ping.log", + "fileExtension":".ping.log", "toNode": "ship1", "data": [""], "method":"REQPing", diff --git a/example/toShip1-REQnCliCommand.json b/example/toShip1-REQnCliCommand.json index d568ce9..ab36624 100644 --- a/example/toShip1-REQnCliCommand.json +++ b/example/toShip1-REQnCliCommand.json @@ -1,7 +1,7 @@ [ { "directory":"some-directory", - "fileExtension":"result", + "fileExtension":".result", "toNode": "ship1", "data": ["bash","-c","tree ../"], "method":"REQnCliCommand", diff --git a/incommmingBuffer.db b/incommmingBuffer.db index e3a7762..3e84517 100644 Binary files a/incommmingBuffer.db and b/incommmingBuffer.db differ diff --git a/subscriber_method_types.go b/subscriber_method_types.go index 505aef6..26453a9 100644 --- a/subscriber_method_types.go +++ b/subscriber_method_types.go @@ -294,13 +294,13 @@ func (m methodREQTextToLogFile) handler(proc process, message Message, node stri case message.PreviousMessage == nil: // If this was a direct request there are no previous message to take // information from, so we use the one that are in the current mesage. - fileName = fmt.Sprintf("%v.%v.%v", message.ToNode, message.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.ToNode, message.Method, message.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.Directory, string(message.FromNode)) case message.PreviousMessage.ToNode != "": - fileName = fmt.Sprintf("%v.%v.%v", message.PreviousMessage.ToNode, message.PreviousMessage.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.PreviousMessage.ToNode, message.PreviousMessage.Method, message.PreviousMessage.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Directory, string(message.PreviousMessage.ToNode)) case message.PreviousMessage.ToNode == "": - fileName = fmt.Sprintf("%v.%v.%v", message.FromNode, message.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.FromNode, message.Method, message.PreviousMessage.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Directory, string(message.PreviousMessage.ToNode)) } @@ -355,13 +355,13 @@ func (m methodREQTextToFile) handler(proc process, message Message, node string) case message.PreviousMessage == nil: // If this was a direct request there are no previous message to take // information from, so we use the one that are in the current mesage. - fileName = fmt.Sprintf("%v.%v.log", message.ToNode, message.Method) + fileName = fmt.Sprintf("%v.%v%v", message.ToNode, message.Method, message.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.Directory, string(message.FromNode)) case message.PreviousMessage.ToNode != "": - fileName = fmt.Sprintf("%v.%v.%v", message.PreviousMessage.ToNode, message.PreviousMessage.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.PreviousMessage.ToNode, message.PreviousMessage.Method, message.PreviousMessage.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Directory, string(message.PreviousMessage.ToNode)) case message.PreviousMessage.ToNode == "": - fileName = fmt.Sprintf("%v.%v.%v", message.FromNode, message.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.FromNode, message.Method, message.PreviousMessage.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Directory, string(message.PreviousMessage.ToNode)) } @@ -440,13 +440,13 @@ func (m methodREQErrorLog) handler(proc process, message Message, node string) ( case message.PreviousMessage == nil: // If this was a direct request there are no previous message to take // information from, so we use the one that are in the current mesage. - fileName = fmt.Sprintf("%v.%v.%v", message.ToNode, message.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.ToNode, message.Method, message.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.Directory, string(message.FromNode)) case message.PreviousMessage.ToNode != "": - fileName = fmt.Sprintf("%v.%v.%v", message.PreviousMessage.ToNode, message.PreviousMessage.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.PreviousMessage.ToNode, message.PreviousMessage.Method, message.PreviousMessage.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Directory, string(message.PreviousMessage.ToNode)) case message.PreviousMessage.ToNode == "": - fileName = fmt.Sprintf("%v.%v.%v", message.FromNode, message.Method, message.PreviousMessage.FileExtension) + fileName = fmt.Sprintf("%v.%v%v", message.FromNode, message.Method, message.PreviousMessage.FileExtension) folderTree = filepath.Join(proc.configuration.SubscribersDataFolder, message.PreviousMessage.Directory, string(message.PreviousMessage.ToNode)) } diff --git a/var/errorLog/central/errorCentral.REQErrorLog b/var/errorLog/central/errorCentral.REQErrorLog new file mode 100644 index 0000000..b8a79bb --- /dev/null +++ b/var/errorLog/central/errorCentral.REQErrorLog @@ -0,0 +1,4 @@ +2021-04-07 06:11:54.599555 +0000 UTC, error: subReply.NextMsg failed for node=ship2, subject=ship2.REQHttpGet.EventACK: nats: timeout +2021-04-07 06:11:59.601342 +0000 UTC, error: subReply.NextMsg failed for node=ship2, subject=ship2.REQHttpGet.EventACK: nats: timeout +2021-04-07 06:12:04.603312 +0000 UTC, error: subReply.NextMsg failed for node=ship2, subject=ship2.REQHttpGet.EventACK: nats: timeout +2021-04-07 06:12:04.603423 +0000 UTC, info: max retries for message reached, breaking out: {ship2 1 [http://vg.no] REQHttpGet central 5 3 0 0 5 metrics/network/sniffer .html 0xc0006dc000}