summaryrefslogtreecommitdiffstats
path: root/doc/examples/agent/simple.json
blob: b64a647a62f01a5e4a7acb295623e89b59f0cb88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// This is a simple example of a configuration for Control-Agent (CA) or simply
// Agent. This server provides RESTful interface for all Kea servers.
{
    "Control-agent":
    {
        // We need to specify where the agent should listen to incoming HTTP
        // queries. Note that agent does not provide SSL or TLS protection
        // on its own, so limiting the traffic to localhost is a good idea.
        "http-host": "127.0.0.1",

        // Another mandatory parameter is the HTTP port.
        "http-port": 8000,

        // This map specifies where control channel of each server is configured
        // to listen on. See 'control-socket' object in the respective
        // servers. At this time the only supported socket type is "unix".
        // Make sure that the Agent and respective servers configuration
        // matches exactly, otherwise they won't be able to communicate.
        // One extra feature that requires some explanation is
        // user-context. This is a structure that you can define at
        // global scope, in control sockets and others. It is parsed by
        // Kea, but not used directly.  It is intended to keep anything
        // you may want to put there - comments, extra designations,
        // floor or department names etc. These structures will be made
        // available to Kea hooks. A comment entry is translated into a
        // user-context with a "comment" property so you can include
        // comments inside the configuration itself.
        "control-sockets":
        {
            // This is how the Agent can communicate with the DHCPv4 server.
            "dhcp4":
            {
                "comment": "socket to DHCP4 server",
                "socket-type": "unix",
                "socket-name": "/path/to/the/unix/socket-v4"
            },

            // Location of the DHCPv6 command channel socket.
            "dhcp6":
            {
                "socket-type": "unix",
                "socket-name": "/path/to/the/unix/socket-v6"
            },

            // Location of the D2 command channel socket.
            "d2":
            {
                "socket-type": "unix",
                "socket-name": "/path/to/the/unix/socket-d2",
                "user-context": { "in-use": false }
            }
        },

        // CA is able to load hook libraries that augment its operation.
        // The primary functionality is the ability to add new commands.
        "hooks-libraries": [
            // Hook libraries list may contain more than one library.
            {
                // The only necessary parameter is the library filename.
                "library": "/opt/local/control-agent-commands.so",

                // Some libraries may support parameters. Make sure you
                // type this section carefully, as the CA does not validate
                // it (because the format is library specific).
                "parameters": {
                    "param1": "foo"
                }
            }
        ]

    },

    // Similar to other Kea components, CA also uses logging.
    "Logging":
    {
        "loggers": [
            {
                "name": "kea-ctrl-agent",
                "output_options": [
                    {
                        "output": "/var/log/kea-ctrl-agent.log",
                        // Several additional parameters are possible in addition
                        // to the typical output. Flush determines whether logger
                        // flushes output to a file. Maxsize determines maximum
                        // filesize before the file is being rotated. maxver
                        // specifies the maximum number of rotated files being
                        // kept.
                        "flush": true,
                        "maxsize": 204800,
                        "maxver": 4
                    }
                ],
                "severity": "INFO",
                "debuglevel": 0
            }
        ]
    }
}