Data Aggregation Sources
How to setup data sources for Daggy

Supported formats

Daggy supports yaml and json formats. In yaml repeated nodes can be grouped by yaml standard.

Data sources template

YAML
JSON
1
sources:
2
host1:
3
#....
4
host2:
5
#....
6
#....
7
hostN:
8
#....
9
Copied!
1
{
2
"sources": {
3
"host1" : {
4
},
5
"host2" : {
6
},
7
"hostN" : {
8
}
9
}
10
}
Copied!
Each config conatins map of hosts. Host (data source) parameters is next:
Parameter
Type
Description
Is Requiered
type
string
Type of connection to host. Daggy supportes local and ssh host connection types
Yes
commands
array
Array of commands for simultaneous launch
Yes
parameters
map
Connection parameters
Required for ssh2 type
host
string
Host address
No. For ssh2 is 127.0.0.1 by default
reconnect
boolean
true, if need reconnect connection
No

Data Sources Types

Daggy supportes local and ssh2 (remote) host connection types.

Local type

YAML
JSON
1
sources:
2
localhost:
3
type: local
4
commands:
5
pingYa:
6
exec: ping ya.ru
7
extension: log
Copied!
1
{
2
"sources": {
3
"localhost": {
4
"commands": {
5
"pingYa": {
6
"extension": "log",
7
"exec": "ping ya.ru"
8
}
9
},
10
"type": "local"
11
}
12
}
13
}
Copied!

SSH2 type

YAML
JSON
1
remotehost:
2
type: ssh2
3
host: 192.168.1.9
4
restart: false
5
parameters:
6
user: muxa
7
key: /home/muxa/.ssh/id_rsa
8
commands:
9
pingYa:
10
command: ping ya.ru
11
extension: log
Copied!
1
{
2
"localhost": {
3
"type": "ssh",
4
"host": "192.169.1.9",
5
"restart": false,
6
"parameters": {
7
"user": "muxa",
8
"key": "/home/muxa/.ssh/id_rsa"
9
},
10
"commands": {
11
"pingYa": {
12
"command": "ping ya.ru",
13
"extension": "log"
14
}
15
}
16
}
17
}
Copied!

SSH type additional parameters

    host - remote host ip address or url
    connection - map of ssh connection parameters. Includes next parameters
Connection Parameter
Type
Description
Default value
user
string
ssh2 connection login
Current user
passphrase
string
ssh2 connection password. If field is not empty, then will be used password authentication for ssh2 connection. In other case, will be used public key authentication
key
string
path to private key for ssh2 connection
~/.ssh/id_rsa
keyphrase
string
passphrase for private key file
port
integer
ssh2 connection port
22
timeout
integer
limit to establish ssh2 connection, in milliseconds
1000

Commands

YAML
JSON
1
commands:
2
pingYa:
3
exec: ping ya.ru
4
extension: log
5
restart: false
Copied!
1
"commands": {
2
"pingYa": {
3
"command": "ping ya.ru",
4
"extension": "log"
5
}
6
}
Copied!
Each command must contain:
    name - unique within host command identifier, using in command output file name template.
    exec - shell script
    extension - extension for command output file
    restart - restart command if it finished

Using environment and other variables in Data Aggregation Sources

Mustache syntax

YAML/JSON Data Aggregation Sources are support mustache syntax:
    env_* - template for environment variable, where * is environment variable name.
    output_folder - output folder path

Example of using mustache syntax in Data Aggregation Sources

YAML
JSON
1
aliases:
2
- &my_commands
3
pingYa:
4
exec: ping ya.ru
5
extension: log
6
pingGoo:
7
exec: ping goo.gl
8
extension: log
9
10
- &ssh_auth
11
user: {{env_USER}}
12
passphrase: {{env_PASSWORD}}
13
14
sources:
15
localhost:
16
type: local
17
commands: *my_commands
18
remotehost:
19
host: 192.168.1.9
20
type: ssh2
21
parameters: *ssh_auth
22
commands: *my_commands
23
remotehost2:
24
host: 192.168.1.9
25
type: ssh2
26
parameters: *ssh_auth
27
commands: *my_commands
28
remotehost3:
29
host: 192.168.1.9
30
type: ssh2
31
parameters: *ssh_auth
32
commands: *my_commands
Copied!
1
{
2
"sources": {
3
"remotehost3": {
4
"host": "192.168.1.9",
5
"type": "ssh2",
6
"commands": {
7
"pingYa": {
8
"extension": "log",
9
"exec": "ping ya.ru"
10
},
11
"pingGoo": {
12
"extension": "log",
13
"exec": "ping goo.gl"
14
}
15
},
16
"parameters": {
17
"user": "{{env_USER}}",
18
"passphrase": "{{env_PASSWORD}}"
19
}
20
},
21
"remotehost2": {
22
"host": "192.168.1.9",
23
"type": "ssh2",
24
"commands": {
25
"pingYa": {
26
"extension": "log",
27
"exec": "ping ya.ru"
28
},
29
"pingGoo": {
30
"extension": "log",
31
"exec": "ping goo.gl"
32
}
33
},
34
"parameters": {
35
"user": "{{env_USER}}",
36
"passphrase": "{{env_PASSWORD}}"
37
}
38
},
39
"remotehost": {
40
"host": "192.168.1.9",
41
"type": "ssh2",
42
"commands": {
43
"pingYa": {
44
"extension": "log",
45
"exec": "ping ya.ru"
46
},
47
"pingGoo": {
48
"extension": "log",
49
"exec": "ping goo.gl"
50
}
51
},
52
"parameters": {
53
"user": "{{env_USER}}",
54
"passphrase": "{{env_PASSWORD}}"
55
}
56
},
57
"localhost": {
58
"commands": {
59
"pingYa": {
60
"extension": "log",
61
"exec": "ping ya.ru"
62
},
63
"pingGoo": {
64
"extension": "log",
65
"exec": "ping goo.gl"
66
}
67
},
68
"type": "local"
69
}
70
}
71
}
Copied!
Last modified 1yr ago