Akkadius / glass-isc-dhcp

Glass - ISC DHCP Server Interface
MIT License
707 stars 144 forks source link

Ignoring binding states of backup, expired and free #74

Open atownsend247 opened 4 years ago

atownsend247 commented 4 years ago

Fixes the issue when running isc-dhcp-server witha failover pair, which causes the symptoms highlighted in the following Issue https://github.com/Akkadius/glass-isc-dhcp/issues/65.

This change will now ignore any leases in the lease file which are marked as backup, expired or free. This will mean that Glass ISC DHCP will be able to correct display the data in the table.

Happy to further discuss changes/ammendments if required. I created this as I too am having the same issue as in Issue https://github.com/Akkadius/glass-isc-dhcp/issues/65, so thought I'd go ahead and fix it now I've had some free time.

atownsend247 commented 4 years ago

Think it needs the maintainer to click the merge button unfortunately :(

anubisg1 commented 4 years ago

Think it needs the maintainer to click the merge button unfortunately :(

yeah..

anyway, i was testing and i think we might need more work. the patch seems to be working fine on one of the 2 servers in cluster (as in the undefined entries are gone or are still there).

it seems that on the second server, there is a missing line in the lease json bracket, which makes the entry have 4 instead of 5 lines

Server 1 (where it works) has this lease file:

`root@Brno-DHCP-SRV01:/home/gt3# cat /var/lib/dhcp/dhcpd.leases authoring-byte-order little-endian;

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:48; partner state normal at 1 2020/11/23 11:01:48; } lease 10.10.30.150 { starts 4 2020/04/30 13:17:29; ends 4 2020/04/30 13:18:04; tstp 4 2020/04/30 13:18:04; tsfp 4 2020/04/30 13:18:04; atsfp 4 2020/04/30 13:18:04; cltt 4 2020/04/30 13:18:02; binding state free; hardware ethernet b8:69:f4:99:d1:4c; uid "\001\270i\364\231\321L"; } lease 10.10.30.149 { starts 4 2020/04/30 14:17:15; ends 4 2020/04/30 13:19:26; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 14:17:15; atsfp 4 2020/04/30 14:17:15; binding state free; hardware ethernet b8:69:f4:99:d1:4c; uid "\001\270i\364\231\321L"; } lease 10.10.30.151 { starts 3 2020/06/10 10:56:06; ends 3 2020/06/10 12:56:06; tstp 3 2020/06/10 12:56:06; tsfp 3 2020/06/10 13:56:06; atsfp 3 2020/06/10 13:56:06; cltt 3 2020/06/10 10:56:06; binding state free; hardware ethernet b8:69:f4:99:d1:4c; uid "\001\270i\364\231\321L"; } lease 10.10.30.152 { starts 3 2020/06/10 13:26:31; tstp 3 2020/06/10 13:26:31; tsfp 3 2020/06/10 13:26:31; atsfp 3 2020/06/10 13:26:31; binding state backup; } lease 10.10.30.100 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.101 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.102 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.103 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.104 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.105 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.106 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.107 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.108 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.109 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.110 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.111 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.112 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.113 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.114 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.115 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.116 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.117 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.118 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.119 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.120 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.121 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.122 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.123 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.124 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.125 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.126 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.127 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.128 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.129 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.130 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.131 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.132 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.133 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.134 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.135 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.136 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.137 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.138 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.139 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.140 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.141 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.142 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.143 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.144 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.145 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.146 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.147 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.148 { starts 4 2020/04/30 13:16:13; tstp 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.200.100 { starts 3 2020/05/27 14:31:27; tstp 4 2020/04/30 11:41:29; tsfp 3 2020/05/27 14:31:27; atsfp 3 2020/05/27 14:31:27; binding state free; } lease 10.10.200.101 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.102 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.103 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.104 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.105 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.106 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.107 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.108 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.109 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.110 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.111 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.112 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.113 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.114 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.115 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.116 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.117 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.118 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.119 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.120 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.121 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.122 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.123 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.124 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.125 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.126 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.127 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.128 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.129 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.130 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.131 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.132 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.133 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.134 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.135 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.136 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.137 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.138 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.139 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.140 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.141 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.142 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.143 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.144 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.145 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.146 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.147 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.148 { starts 4 2020/04/30 11:41:29; tstp 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.150 { starts 4 2020/04/30 11:53:59; ends 4 2020/04/30 11:53:57; tstp 4 2020/04/30 11:53:59; tsfp 4 2020/04/30 11:53:59; atsfp 4 2020/04/30 11:53:59; cltt 4 2020/04/30 11:53:51; binding state backup; hardware ethernet b8:69:f4:99:d1:4a; uid "\001\270i\364\231\321J"; } lease 10.10.200.149 { starts 3 2020/06/10 13:08:27; ends 3 2020/06/10 13:08:25; tstp 3 2020/06/10 13:08:27; tsfp 3 2020/06/10 13:08:27; atsfp 3 2020/06/10 13:08:27; cltt 3 2020/05/27 12:38:50; binding state backup; hardware ethernet b8:69:f4:99:d1:4a; uid "\001\270i\364\231\321J"; }

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:48; partner state normal at 1 2020/11/23 11:01:48; } server-duid "\000\001\000\001&zZ\337\002\\037\002\037\021";

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:48; partner state communications-interrupted at 1 2020/11/23 11:01:58; }

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:48; partner state communications-interrupted at 1 2020/11/23 11:01:58; }

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:48; partner state normal at 1 2020/11/23 11:01:59; }

failover peer "failover-partner" state { my state communications-interrupted at 1 2020/11/23 11:03:24; partner state normal at 1 2020/11/23 11:01:59; }

failover peer "failover-partner" state { my state communications-interrupted at 1 2020/11/23 11:03:24; partner state normal at 1 2020/11/23 11:03:29; }

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:03:29; partner state normal at 1 2020/11/23 11:03:29; }`

Server 2 (where it does NOT work) has this lease file:

`root@Brno-DHCP-SRV02:/home/gt3# cat /var/lib/dhcp/dhcpd.leases authoring-byte-order little-endian;

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:59; partner state normal at 1 2020/11/23 11:01:59; mclt 3600; } lease 10.10.30.150 { starts 4 2020/04/30 13:17:29; ends 4 2020/04/30 13:18:04; tstp 4 2020/04/30 13:18:04; tsfp 4 2020/04/30 13:18:04; atsfp 4 2020/04/30 13:18:04; binding state free; hardware ethernet b8:69:f4:99:d1:4c; uid "\001\270i\364\231\321L"; } lease 10.10.30.149 { starts 4 2020/04/30 14:17:15; ends 4 2020/04/30 13:19:26; tstp 4 2020/04/30 14:17:15; tsfp 4 2020/04/30 14:17:15; atsfp 4 2020/04/30 14:17:15; cltt 4 2020/04/30 13:17:26; binding state free; hardware ethernet b8:69:f4:99:d1:4c; uid "\001\270i\364\231\321L"; } lease 10.10.30.151 { starts 3 2020/06/10 10:56:06; ends 3 2020/06/10 12:56:06; tstp 3 2020/06/10 12:56:06; tsfp 3 2020/06/10 13:56:06; atsfp 3 2020/06/10 13:56:06; cltt 1 2020/06/08 10:56:09; binding state free; hardware ethernet b8:69:f4:99:d1:4c; uid "\001\270i\364\231\321L"; } lease 10.10.30.152 { starts 3 2020/06/10 13:26:31; tsfp 3 2020/06/10 13:26:31; atsfp 3 2020/06/10 13:26:31; binding state backup; } lease 10.10.30.100 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.101 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.102 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.103 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.104 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.105 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.106 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.107 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.108 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.109 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.110 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.111 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.112 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.113 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.114 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.115 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.116 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.117 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.118 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.119 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.120 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.121 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.122 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.123 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.124 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.125 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.126 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.127 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.128 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.129 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.130 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.131 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.132 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.133 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.134 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.135 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.136 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.137 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.138 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.139 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.140 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.141 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.142 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.143 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.144 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.145 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.146 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.147 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.30.148 { starts 4 2020/04/30 13:16:13; tsfp 4 2020/04/30 13:16:13; atsfp 4 2020/04/30 13:16:13; binding state backup; } lease 10.10.200.100 { starts 3 2020/05/27 14:31:27; tstp 3 2020/05/27 14:31:27; tsfp 3 2020/05/27 14:31:27; atsfp 3 2020/05/27 14:31:27; binding state free; } lease 10.10.200.101 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.102 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.103 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.104 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.105 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.106 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.107 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.108 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.109 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.110 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.111 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.112 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.113 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.114 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.115 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.116 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.117 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.118 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.119 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.120 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.121 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.122 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.123 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.124 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.125 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.126 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.127 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.128 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.129 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.130 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.131 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.132 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.133 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.134 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.135 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.136 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.137 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.138 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.139 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.140 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.141 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.142 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.143 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.144 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.145 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.146 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.147 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.148 { starts 4 2020/04/30 11:41:29; tsfp 4 2020/04/30 11:41:29; atsfp 4 2020/04/30 11:41:29; binding state backup; } lease 10.10.200.150 { starts 4 2020/04/30 11:53:59; ends 4 2020/04/30 11:53:57; tstp 4 2020/04/30 11:53:57; tsfp 4 2020/04/30 11:53:59; atsfp 4 2020/04/30 11:53:59; binding state backup; hardware ethernet b8:69:f4:99:d1:4a; uid "\001\270i\364\231\321J"; } lease 10.10.200.149 { starts 3 2020/06/10 13:08:27; ends 3 2020/06/10 13:08:25; tstp 3 2020/06/10 13:08:25; tsfp 3 2020/06/10 13:08:27; atsfp 3 2020/06/10 13:08:27; cltt 3 2020/06/10 11:08:25; binding state backup; hardware ethernet b8:69:f4:99:d1:4a; uid "\001\270i\364\231\321J"; }

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:59; partner state normal at 1 2020/11/23 11:01:59; mclt 3600; } server-duid "\000\001\000\001&zZ\267\002\\037\002 \020";

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:59; partner state communications-interrupted at 1 2020/11/23 11:03:29; mclt 3600; }

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:59; partner state communications-interrupted at 1 2020/11/23 11:03:29; mclt 3600; }

failover peer "failover-partner" state { my state normal at 1 2020/11/23 11:01:59; partner state normal at 1 2020/11/23 11:03:29; mclt 3600; }`

anubisg1 commented 4 years ago

if the reason why this isn't working is that you are checking the 5th line and i have 4 in the second server, then instead of checking for the 5th line only, i would be checking in every line (with a for cycle where i check between 0 and the number of lines)

anubisg1 commented 4 years ago

yes, i was right, on the second server i fix it by checking "lines[4]" instead of "lines[5]"