From 92addf50bca8911909c51fff1201b90fad4fca39 Mon Sep 17 00:00:00 2001 From: postmannen Date: Wed, 7 Apr 2021 08:16:22 +0200 Subject: [PATCH] changed file extension to need to prefix with dot --- example/toCentral-REQTextToLogFile.json | 2 +- example/toShip1-REQCliCommand.json | 2 +- example/toShip1-REQHttpGet.json | 6 +++--- example/toShip1-REQOpCommand.json | 2 +- example/toShip1-REQPing.json | 2 +- example/toShip1-REQnCliCommand.json | 2 +- incommmingBuffer.db | Bin 65536 -> 65536 bytes subscriber_method_types.go | 18 +++++++++--------- var/errorLog/central/errorCentral.REQErrorLog | 4 ++++ 9 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 var/errorLog/central/errorCentral.REQErrorLog 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 e3a77620d7a4025fa6490823cedf47e2a94ced7e..3e84517c50be918fe3835fe143d4468b7f957025 100644 GIT binary patch delta 234 zcmZo@U}Yd|CvbSCRK zcrh7UY_4$V;NN7RBfwZcSy#amC^ET1!Aih~k%7V3*t}ZF(?!V&$e4Uc!IM46H83DE zFMYD2qP~bytd3G{YDq?ZijtKQOrl*;kkj+p@r?q2(O`OCv6`!*XIY~Y_H;2^LTD#3L&QE|r4b;lqQ3OY>L zjFa^gJeUlPCs#OF30N>PFc=#eRV#VAC|Lm+lMgv~iaGmuI_Kx+Cg!CCr52W^7MJ+> z2fGGN7IM@#Pf9G#P|{J-O$HJrMX9L@dV2awu{uh*sU;ctDN0sKIP``(Dl!=wOfGkH hW-+L(t=$;N&$r1yM_{s!f)~&!n=2GL_!k9i001g?L`VPt 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}