aboutsummaryrefslogtreecommitdiffstats
path: root/examples/tg19/dhcp/config/dhcpd-notify-v4.conf
blob: 6f63412087db3a7caa8a1c2c14055f4057cf0ef3 (plain)
1
2
3
4
5
6
7
8
9
10
on commit {
	set ClientIP = concat("--ip=", binary-to-ascii(10, 8, ".", leased-address));
	set ClientMac = concat("--mac=", binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)));
	set ClientName = concat("--clientname=", pick-first-value(option fqdn.fqdn, option fqdn.hostname, option host-name, ""));
	set LeaseTime = concat("--lease=", binary-to-ascii(10,32,"",encode-int(lease-time,32)));
	set CircuitID = concat("--circuit=", pick-first-value(option agent.circuit-id, ""));
	set GondulAPI = concat("--api=", "https://tech:<SECRET>@gondul.tg19.gathering.org/api/write/collector");

	execute("/usr/local/bin/gondul-lol", ClientIP, ClientMac, ClientName, CircuitID, LeaseTime, GondulAPI);
}