summaryrefslogtreecommitdiffstats
path: root/doc/examples/agent/simple.json
blob: 1fafb4ca73388601dfc63ebf8b45198589a636c1 (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
// 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.
	"control-sockets":
	{
	    // This is how the Agent can communicate with the DHCPv4 server.
	    "dhcp4-server":
	    {
		"socket-type": "unix",
		"socket-name": "/path/to/the/unix/socket-v4"
	    },

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

	    // Currently DHCP-DDNS (nicknamed D2) does not support
	    // command channel yet, but we hope this will change in the
	    // future.
	    "d2-server":
	    {
		"socket-type": "unix",
		"socket-name": "/path/to/the/unix/socket-d2"
	    }
	},

	// 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
	    }
	]
    }
}