etsxxx / keepalived-tools

Management tools for keepalived.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

keepalived-tools

keepalived_checker.py

Description

Check duplications or typo of VRRP IDs (vrid), Virtual IP Addresses (vrip) and Virtual Servers (vs) from 'keepalived.conf'.

Tested on

  • CentOS 6 (+ python 2.6)
  • CentOS 7 (+ python 2.7)
  • Ubuntu 20.04 (+ python 3.8)
  • keepalived v1.2.7, v2.0.19

Required

  • Python

Usage

Simply, run it.

$ ./keepalived_checker.py

If your config file is located on non default path, add -f.

$ ./keepalived_checker.py -f CONF_PATH

Output Examples

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

Known Issues

  • This script does not treat syntax error.
    • gokc is a great implementation for syntax check.
    • kc is also.

Author

Etsushi Nakano

About

Management tools for keepalived.


Languages

Language:Python 100.0%