aboutsummaryrefslogtreecommitdiffstats
path: root/extras/test-collector.sh
blob: 126a2a1c546c9240be14d5d7bc4f8c60d021c2f5 (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
#!/bin/bash

POST http://localhost:80/api/write/collector  <<_EOF_

{
   "src": "dhcp",
   "metadata":  {
      "server": "dhcpserver1"
   },
   "data": [
      {
         "type": "assignment",
         "time": "2001-01-01T15:12:01Z",
         "ip": "2001:db8::1",
         "circuit": "vlan123:e3-1:ge-0/0/1",
         "msg": "blatti foo"
      }, 
      {
         "type": "renew",
         "time": "2001-01-01T15:32:01Z",
         "ip": "2001:db8::1",
         "circuit": "vlan123:e3-1:ge-0/0/1",
         "msg": "blatti foo something"
      } 
   ]
}
_EOF_


POST http://localhost:80/api/write/collector  <<_EOF_
{
  "src": "dhcp",
  "metadata": {
    "server": "dhcp.tg.lol"
  },
  "data": [
    {
      "clientip": "127.27.36.162",
      "clientmac": "0e:74:14:1f:ce:e2",
      "clientname": "WIN-8KE6TTQA821",
      "leasetime": 120,
      "circuitid": "ge-0/0/1.0:1011",
      "time": "2019-02-13T22:21:27.195685448+01:00"
    }
  ]
}
_EOF_