Check duplications or typo of VRRP IDs (vrid), Virtual IP Addresses (vrip) and Virtual Servers (vs) from 'keepalived.conf'.
- CentOS 6 (+ python 2.6)
- CentOS 7 (+ python 2.7)
- Ubuntu 20.04 (+ python 3.8)
- keepalived v1.2.7, v2.0.19
- Python
Simply, run it.
$ ./keepalived_checker.py
If your config file is located on non default path, add -f
.
$ ./keepalived_checker.py -f CONF_PATH
You will get output like this if NG has found.
$ ./keepalived_checker.py
'virtual_server' duplications found:
192.168.1.1:80/tcp
- /etc/keepalived/keepalived.conf:20
- /etc/keepalived/conf.d/test.conf:2
If no errors found, get this.
$ ./keepalived_checker.py
OK
- This script does not treat syntax error.