1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

changed file extension to need to prefix with dot

This commit is contained in:
postmannen 2021-04-07 08:16:22 +02:00
parent b08dd4558e
commit 92addf50bc
9 changed files with 21 additions and 17 deletions

View file

@ -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",

View file

@ -1,7 +1,7 @@
[
{
"directory":"cli_command__result",
"fileExtension": "result",
"fileExtension": ".result",
"toNode": "ship1",
"data": ["bash","-c","sleep 3 & tree ./"],
"method":"REQCliCommand",

View file

@ -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
}

View file

@ -1,7 +1,7 @@
[
{
"directory":"opcommand_logs",
"fileExtension": "log",
"fileExtension": ".log",
"toNode": "ship1",
"data": ["ps"],
"method":"REQOpCommand",

View file

@ -1,7 +1,7 @@
[
{
"directory": "ping",
"fileExtension":"ping.log",
"fileExtension":".ping.log",
"toNode": "ship1",
"data": [""],
"method":"REQPing",

View file

@ -1,7 +1,7 @@
[
{
"directory":"some-directory",
"fileExtension":"result",
"fileExtension":".result",
"toNode": "ship1",
"data": ["bash","-c","tree ../"],
"method":"REQnCliCommand",

Binary file not shown.

View file

@ -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))
}

View file

@ -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 <nil> 0xc0006dc000}