New Language: Keepalived configure file (#2417)

Co-authored-by: RunDevelopment <mitchi5000.ms@googlemail.com>
This commit is contained in:
那里好脏不可以 2021-10-03 22:39:07 +08:00 committed by GitHub
parent a80a68ba50
commit d908e45781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 1125 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -713,6 +713,10 @@
"title": "Julia",
"owner": "cdagnino"
},
"keepalived": {
"title": "Keepalived Configure",
"owner": "dev-itsheng"
},
"keyman": {
"title": "Keyman",
"owner": "mcdurdin"

View File

@ -0,0 +1,51 @@
Prism.languages.keepalived = {
'comment': {
pattern: /[#!].*/,
greedy: true
},
'string': {
pattern: /(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,
lookbehind: true,
greedy: true
},
// support IPv4, IPv6, subnet mask
'ip': {
pattern: RegExp(
/\b(?:(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){5}:(?:[\da-f]{1,4}:)?[\da-f]{1,4}|(?:[\da-f]{1,4}:){4}:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4}|(?:[\da-f]{1,4}:){3}:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4}|(?:[\da-f]{1,4}:){2}:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}<ipv4>|(?:[\da-f]{1,4}:){0,5}:<ipv4>|::(?:[\da-f]{1,4}:){0,5}<ipv4>|[\da-f]{1,4}::(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4}|::(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:)(?:\/\d{1,3})?|<ipv4>(?:\/\d{1,2})?)\b/.source
.replace(/<ipv4>/g, function () { return /(?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d))/.source; }),
'i'
),
alias: 'number'
},
// support *nix / Windows, directory / file
'path': {
pattern: /(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/,
lookbehind: true,
alias: 'string',
},
'variable': /\$\{?\w+\}?/,
'email': {
pattern: /[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/,
alias: 'string',
},
'conditional-configuration': {
pattern: /@\^?[\w-]+/,
alias: 'variable'
},
'operator': /=/,
'property': /\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/,
'constant': /\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/,
'number': {
pattern: /(^|[^\w.-])-?\d+(?:\.\d+)?/,
lookbehind: true
},
'boolean': /\b(?:false|no|off|on|true|yes)\b/,
'punctuation': /[\{\}]/
};

1
components/prism-keepalived.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,130 @@
<h2>A example from keepalived document</h2>
<pre><code>
# Configuration File for keepalived
global_defs {
notification_email {
admin@domain.com
0633225522@domain.com
}
notification_email_from keepalived@domain.com
smtp_server 192.168.200.20
smtp_connect_timeout 30
router_id LVS_MAIN
}
# VRRP Instances definitions
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve1
}
virtual_ipaddress {
192.168.200.10
192.168.200.11
}
}
vrrp_instance VI_2 {
state MASTER
interface eth1
virtual_router_id 52
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve2
}
virtual_ipaddress {
192.168.100.10
}
}
vrrp_instance VI_3 {
state BACKUP
interface eth0
virtual_router_id 53
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve3
}
virtual_ipaddress {
192.168.200.12
192.168.200.13
}
}
vrrp_instance VI_4 {
state BACKUP
interface eth1
virtual_router_id 54
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass k@l!ve4
}
virtual_ipaddress {
192.168.100.11
}
}
# Virtual Servers definitions
virtual_server 192.168.200.10 80 {
delay_loop 30
lb_algo wrr
lb_kind NAT
persistence_timeout 50
protocol TCP
sorry_server 192.168.100.100 80
real_server 192.168.100.2 80 {
weight 2
HTTP_GET {
url {
path /testurl/test.jsp
digest ec90a42b99ea9a2f5ecbe213ac9eba03
}
url {
path /testurl2/test.jsp
digest 640205b7b0fc66c1ea91c463fac6334c
}
connect_timeout 3
retry 3
delay_before_retry 2
}
}
real_server 192.168.100.3 80 {
weight 1
HTTP_GET {
url {
path /testurl/test.jsp
digest 640205b7b0fc66c1ea91c463fac6334c
}
connect_timeout 3
retry 3
delay_before_retry 2
}
}
}
virtual_server 192.168.200.12 443 {
delay_loop 20
lb_algo rr
lb_kind NAT
persistence_timeout 360
protocol TCP
real_server 192.168.100.2 443 {
weight 1
TCP_CHECK {
connect_timeout 3
}
}
real_server 192.168.100.3 443 {
weight 1
TCP_CHECK {
connect_timeout 3
}
}
}
</code></pre>

View File

@ -22,4 +22,5 @@ server { # simple reverse-proxy
location / {
proxy_pass http://127.0.0.1:8080;
}
}</code></pre>
}
</code></pre>

View File

@ -124,6 +124,7 @@
"jsonp": "JSONP",
"jsstacktrace": "JS stack trace",
"js-templates": "JS Templates",
"keepalived": "Keepalived Configure",
"kts": "Kotlin Script",
"kt": "Kotlin",
"kumir": "KuMir (КуМир)",

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,23 @@
strict_mode on
strict_mode off
strict_mode true
strict_mode false
strict_mode yes
strict_mode no
----------------------------------------------------
[
["property", "strict_mode"],
["boolean", "on"],
["property", "strict_mode"],
["boolean", "off"],
["property", "strict_mode"],
["boolean", "true"],
["property", "strict_mode"],
["boolean", "false"],
["property", "strict_mode"],
["boolean", "yes"],
["property", "strict_mode"],
["boolean", "no"]
]

View File

@ -0,0 +1,13 @@
#
# Foobar
----------------------------------------------------
[
["comment", "#"],
["comment", "# Foobar"]
]
----------------------------------------------------
Checks for comments.

View File

@ -0,0 +1,37 @@
global_defs {
@main router_id main_router
}
vrrp_instance VRRP {
@main unicast_src_ip 1.2.3.4
unicast_peer {
@^main 1.2.3.4
}
}
----------------------------------------------------
[
["property", "global_defs"],
["punctuation", "{"],
["conditional-configuration", "@main"],
["property", "router_id"],
" main_router\r\n",
["punctuation", "}"],
["property", "vrrp_instance"],
" VRRP ",
["punctuation", "{"],
["conditional-configuration", "@main"],
["property", "unicast_src_ip"],
["ip", "1.2.3.4"],
["property", "unicast_peer"],
["punctuation", "{"],
["conditional-configuration", "@^main"],
["ip", "1.2.3.4"],
["punctuation", "}"],
["punctuation", "}"]
]

View File

@ -0,0 +1,127 @@
virtual_server 192.168.1.200 3306 {
lvs_sched rr
lvs_sched wrr
lvs_sched lc
lvs_sched wlc
lvs_sched lblc
lvs_sched sh
lvs_sched mh
lvs_sched dh
lvs_sched fo
lvs_sched ovf
lvs_sched lblcr
lvs_sched sed
lvs_sched nq
lvs_method NAT
lvs_method DR
lvs_method TUN
protocol TCP
protocol UDP
protocol SCTP
}
vrrp_instance test {
state MASTER
state BACKUP
authentication {
auth_type PASS
auth_type AH
}
}
DNS_CHECK {
type A
type NS
type CNAME
type SOA
type MX
type TXT
type AAAA
}
----------------------------------------------------
[
["property", "virtual_server"],
["ip", "192.168.1.200"],
["number", "3306"],
["punctuation", "{"],
["property", "lvs_sched"],
["constant", "rr"],
["property", "lvs_sched"],
["constant", "wrr"],
["property", "lvs_sched"],
["constant", "lc"],
["property", "lvs_sched"],
["constant", "wlc"],
["property", "lvs_sched"],
["constant", "lblc"],
["property", "lvs_sched"],
["constant", "sh"],
["property", "lvs_sched"],
["constant", "mh"],
["property", "lvs_sched"],
["constant", "dh"],
["property", "lvs_sched"],
["constant", "fo"],
["property", "lvs_sched"],
["constant", "ovf"],
["property", "lvs_sched"],
["constant", "lblcr"],
["property", "lvs_sched"],
["constant", "sed"],
["property", "lvs_sched"],
["constant", "nq"],
["property", "lvs_method"],
["constant", "NAT"],
["property", "lvs_method"],
["constant", "DR"],
["property", "lvs_method"],
["constant", "TUN"],
["property", "protocol"],
["constant", "TCP"],
["property", "protocol"],
["constant", "UDP"],
["property", "protocol"],
["constant", "SCTP"],
["punctuation", "}"],
["property", "vrrp_instance"],
" test ",
["punctuation", "{"],
["property", "state"],
["constant", "MASTER"],
["property", "state"],
["constant", "BACKUP"],
["property", "authentication"],
["punctuation", "{"],
["property", "auth_type"],
["constant", "PASS"],
["property", "auth_type"],
["constant", "AH"],
["punctuation", "}"],
["punctuation", "}"],
["property", "DNS_CHECK"],
["punctuation", "{"],
["property", "type"],
["constant", "A"],
["property", "type"],
["constant", "NS"],
["property", "type"],
["constant", "CNAME"],
["property", "type"],
["constant", "SOA"],
["property", "type"],
["constant", "MX"],
["property", "type"],
["constant", "TXT"],
["property", "type"],
["constant", "AAAA"],
["punctuation", "}"]
]
----------------------------------------------------
Checks for constants, number, punctuations.

View File

@ -0,0 +1,25 @@
virtual_server 192.168.1.200 3306
virtual_server 192.168.1.200/32 3306
virtual_server ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 3306
virtual_server ABCD:EF01:2345:6789:ABCD:EF01:2345:6789/128 3306
----------------------------------------------------
[
["property", "virtual_server"],
["ip", "192.168.1.200"],
["number", "3306"],
["property", "virtual_server"],
["ip", "192.168.1.200/32"],
["number", "3306"],
["property", "virtual_server"],
["ip", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789"],
["number", "3306"],
["property", "virtual_server"],
["ip", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789/128"],
["number", "3306"]
]
----------------------------------------------------
Checks for ip (IPv4, IPv6, subnet mask).

View File

@ -0,0 +1,27 @@
vrrp_instance VI_1 {
notify_master /etc/keepalived/to_master.sh
notify_backup C:\keepalived\to_backup.bat
net_namespace /var/run/keepalived
net_namespace C:\users\prism\keepalived
}
----------------------------------------------------
[
["property", "vrrp_instance"],
" VI_1 ",
["punctuation", "{"],
["property", "notify_master"],
["path", "/etc/keepalived/to_master.sh"],
["property", "notify_backup"],
["path", "C:\\keepalived\\to_backup.bat"],
["property", "net_namespace"],
["path", "/var/run/keepalived"],
["property", "net_namespace"],
["path", "C:\\users\\prism\\keepalived"],
["punctuation", "}"]
]
----------------------------------------------------
Checks for path.

View File

@ -0,0 +1,625 @@
BFD_CHECK
DNS_CHECK
FILE_CHECK
HTTP_GET
MISC_CHECK
NAME
PING_CHECK
SCRIPTS
SMTP_CHECK
SSL
SSL_GET
TCP_CHECK
UDP_CHECK
accept
advert_int
alpha
auth_pass
auth_type
authentication
bfd_cpu_affinity
bfd_instance
bfd_no_swap
bfd_priority
bfd_process_name
bfd_rlimit_rttime
bfd_rt_priority
bind_if
bind_port
bindto
ca
certificate
check_unicast_src
checker
checker_cpu_affinity
checker_log_all_failures
checker_no_swap
checker_priority
checker_rlimit_rttime
checker_rt_priority
child_wait_time
connect_ip
connect_port
connect_timeout
dbus_service_name
debug
default_interface
delay
delay_before_retry
delay_loop
digest
dont_track_primary
dynamic
dynamic_interfaces
enable_dbus
enable_script_security
enable_sni
enable_snmp_checker
enable_snmp_rfc
enable_snmp_rfcv2
enable_snmp_rfcv3
enable_snmp_vrrp
enable_traps
end
fall
fast_recovery
file
flag-1
flag-2
flag-3
fork_delay
full_command
fwmark
garp_group
garp_interval
garp_lower_prio_delay
garp_lower_prio_repeat
garp_master_delay
garp_master_refresh
garp_master_refresh_repeat
garp_master_repeat
global_defs
global_tracking
gna_interval
group
ha_suspend
hashed
helo_name
higher_prio_send_advert
hoplimit
http_protocol
hysteresis
idle_tx
include
inhibit_on_failure
init_fail
init_file
instance
interface
interfaces
interval
ip_family
ipvs_process_name
keepalived.conf
kernel_rx_buf_size
key
linkbeat_interfaces
linkbeat_use_polling
log_all_failures
log_unknown_vrids
lower_prio_no_advert
lthreshold
lvs_flush
lvs_flush_onstop
lvs_method
lvs_netlink_cmd_rcv_bufs
lvs_netlink_cmd_rcv_bufs_force
lvs_netlink_monitor_rcv_bufs
lvs_netlink_monitor_rcv_bufs_force
lvs_notify_fifo
lvs_notify_fifo_script
lvs_sched
lvs_sync_daemon
max_auto_priority
max_hops
mcast_src_ip
mh-fallback
mh-port
min_auto_priority_delay
min_rx
min_tx
misc_dynamic
misc_path
misc_timeout
multiplier
name
namespace_with_ipsets
native_ipv6
neighbor_ip
net_namespace
net_namespace_ipvs
nftables
nftables_counters
nftables_ifindex
nftables_priority
no_accept
no_checker_emails
no_email_faults
nopreempt
notification_email
notification_email_from
notify
notify_backup
notify_deleted
notify_down
notify_fault
notify_fifo
notify_fifo_script
notify_master
notify_master_rx_lower_pri
notify_priority_changes
notify_stop
notify_up
old_unicast_checksum
omega
ops
param_match
passive
password
path
persistence_engine
persistence_granularity
persistence_timeout
preempt
preempt_delay
priority
process
process_monitor_rcv_bufs
process_monitor_rcv_bufs_force
process_name
process_names
promote_secondaries
protocol
proxy_arp
proxy_arp_pvlan
quorum
quorum_down
quorum_max
quorum_up
random_seed
real_server
regex
regex_max_offset
regex_min_offset
regex_no_match
regex_options
regex_stack
reload_time_file
reload_repeat
require_reply
retry
rise
router_id
rs_init_notifies
script
script_user
sh-fallback
sh-port
shutdown_script
shutdown_script_timeout
skip_check_adv_addr
smtp_alert
smtp_alert_checker
smtp_alert_vrrp
smtp_connect_timeout
smtp_helo_name
smtp_server
snmp_socket
sorry_server
sorry_server_inhibit
sorry_server_lvs_method
source_ip
start
startup_script
startup_script_timeout
state
static_ipaddress
static_routes
static_rules
status_code
step
strict_mode
sync_group_tracking_weight
terminate_delay
timeout
track_bfd
track_file
track_group
track_interface
track_process
track_script
track_src_ip
ttl
type
umask
unicast_peer
unicast_src_ip
unicast_ttl
url
use_ipvlan
use_pid_dir
use_vmac
user
uthreshold
val1
val2
val3
version
virtual_ipaddress
virtual_ipaddress_excluded
virtual_router_id
virtual_routes
virtual_rules
virtual_server
virtual_server_group
virtualhost
vmac_xmit_base
vrrp
vrrp_check_unicast_src
vrrp_cpu_affinity
vrrp_garp_interval
vrrp_garp_lower_prio_delay
vrrp_garp_lower_prio_repeat
vrrp_garp_master_delay
vrrp_garp_master_refresh
vrrp_garp_master_refresh_repeat
vrrp_garp_master_repeat
vrrp_gna_interval
vrrp_higher_prio_send_advert
vrrp_instance
vrrp_ipsets
vrrp_iptables
vrrp_lower_prio_no_advert
vrrp_mcast_group4
vrrp_mcast_group6
vrrp_min_garp
vrrp_netlink_cmd_rcv_bufs
vrrp_netlink_cmd_rcv_bufs_force
vrrp_netlink_monitor_rcv_bufs
vrrp_netlink_monitor_rcv_bufs_force
vrrp_no_swap
vrrp_notify_fifo
vrrp_notify_fifo_script
vrrp_notify_priority_changes
vrrp_priority
vrrp_process_name
vrrp_rlimit_rttime
vrrp_rt_priority
vrrp_rx_bufs_multiplier
vrrp_rx_bufs_policy
vrrp_script
vrrp_skip_check_adv_addr
vrrp_startup_delay
vrrp_strict
vrrp_sync_group
vrrp_track_process
vrrp_version
warmup
weight
----------------------------------------------------
[
["property", "BFD_CHECK"],
["property", "DNS_CHECK"],
["property", "FILE_CHECK"],
["property", "HTTP_GET"],
["property", "MISC_CHECK"],
["property", "NAME"],
["property", "PING_CHECK"],
["property", "SCRIPTS"],
["property", "SMTP_CHECK"],
["property", "SSL"],
["property", "SSL_GET"],
["property", "TCP_CHECK"],
["property", "UDP_CHECK"],
["property", "accept"],
["property", "advert_int"],
["property", "alpha"],
["property", "auth_pass"],
["property", "auth_type"],
["property", "authentication"],
["property", "bfd_cpu_affinity"],
["property", "bfd_instance"],
["property", "bfd_no_swap"],
["property", "bfd_priority"],
["property", "bfd_process_name"],
["property", "bfd_rlimit_rttime"],
["property", "bfd_rt_priority"],
["property", "bind_if"],
["property", "bind_port"],
["property", "bindto"],
["property", "ca"],
["property", "certificate"],
["property", "check_unicast_src"],
["property", "checker"],
["property", "checker_cpu_affinity"],
["property", "checker_log_all_failures"],
["property", "checker_no_swap"],
["property", "checker_priority"],
["property", "checker_rlimit_rttime"],
["property", "checker_rt_priority"],
["property", "child_wait_time"],
["property", "connect_ip"],
["property", "connect_port"],
["property", "connect_timeout"],
["property", "dbus_service_name"],
["property", "debug"],
["property", "default_interface"],
["property", "delay"],
["property", "delay_before_retry"],
["property", "delay_loop"],
["property", "digest"],
["property", "dont_track_primary"],
["property", "dynamic"],
["property", "dynamic_interfaces"],
["property", "enable_dbus"],
["property", "enable_script_security"],
["property", "enable_sni"],
["property", "enable_snmp_checker"],
["property", "enable_snmp_rfc"],
["property", "enable_snmp_rfcv2"],
["property", "enable_snmp_rfcv3"],
["property", "enable_snmp_vrrp"],
["property", "enable_traps"],
["property", "end"],
["property", "fall"],
["property", "fast_recovery"],
["property", "file"],
["property", "flag-1"],
["property", "flag-2"],
["property", "flag-3"],
["property", "fork_delay"],
["property", "full_command"],
["property", "fwmark"],
["property", "garp_group"],
["property", "garp_interval"],
["property", "garp_lower_prio_delay"],
["property", "garp_lower_prio_repeat"],
["property", "garp_master_delay"],
["property", "garp_master_refresh"],
["property", "garp_master_refresh_repeat"],
["property", "garp_master_repeat"],
["property", "global_defs"],
["property", "global_tracking"],
["property", "gna_interval"],
["property", "group"],
["property", "ha_suspend"],
["property", "hashed"],
["property", "helo_name"],
["property", "higher_prio_send_advert"],
["property", "hoplimit"],
["property", "http_protocol"],
["property", "hysteresis"],
["property", "idle_tx"],
["property", "include"],
["property", "inhibit_on_failure"],
["property", "init_fail"],
["property", "init_file"],
["property", "instance"],
["property", "interface"],
["property", "interfaces"],
["property", "interval"],
["property", "ip_family"],
["property", "ipvs_process_name"],
["property", "keepalived.conf"],
["property", "kernel_rx_buf_size"],
["property", "key"],
["property", "linkbeat_interfaces"],
["property", "linkbeat_use_polling"],
["property", "log_all_failures"],
["property", "log_unknown_vrids"],
["property", "lower_prio_no_advert"],
["property", "lthreshold"],
["property", "lvs_flush"],
["property", "lvs_flush_onstop"],
["property", "lvs_method"],
["property", "lvs_netlink_cmd_rcv_bufs"],
["property", "lvs_netlink_cmd_rcv_bufs_force"],
["property", "lvs_netlink_monitor_rcv_bufs"],
["property", "lvs_netlink_monitor_rcv_bufs_force"],
["property", "lvs_notify_fifo"],
["property", "lvs_notify_fifo_script"],
["property", "lvs_sched"],
["property", "lvs_sync_daemon"],
["property", "max_auto_priority"],
["property", "max_hops"],
["property", "mcast_src_ip"],
["property", "mh-fallback"],
["property", "mh-port"],
["property", "min_auto_priority_delay"],
["property", "min_rx"],
["property", "min_tx"],
["property", "misc_dynamic"],
["property", "misc_path"],
["property", "misc_timeout"],
["property", "multiplier"],
["property", "name"],
["property", "namespace_with_ipsets"],
["property", "native_ipv6"],
["property", "neighbor_ip"],
["property", "net_namespace"],
["property", "net_namespace_ipvs"],
["property", "nftables"],
["property", "nftables_counters"],
["property", "nftables_ifindex"],
["property", "nftables_priority"],
["property", "no_accept"],
["property", "no_checker_emails"],
["property", "no_email_faults"],
["property", "nopreempt"],
["property", "notification_email"],
["property", "notification_email_from"],
["property", "notify"],
["property", "notify_backup"],
["property", "notify_deleted"],
["property", "notify_down"],
["property", "notify_fault"],
["property", "notify_fifo"],
["property", "notify_fifo_script"],
["property", "notify_master"],
["property", "notify_master_rx_lower_pri"],
["property", "notify_priority_changes"],
["property", "notify_stop"],
["property", "notify_up"],
["property", "old_unicast_checksum"],
["property", "omega"],
["property", "ops"],
["property", "param_match"],
["property", "passive"],
["property", "password"],
["property", "path"],
["property", "persistence_engine"],
["property", "persistence_granularity"],
["property", "persistence_timeout"],
["property", "preempt"],
["property", "preempt_delay"],
["property", "priority"],
["property", "process"],
["property", "process_monitor_rcv_bufs"],
["property", "process_monitor_rcv_bufs_force"],
["property", "process_name"],
["property", "process_names"],
["property", "promote_secondaries"],
["property", "protocol"],
["property", "proxy_arp"],
["property", "proxy_arp_pvlan"],
["property", "quorum"],
["property", "quorum_down"],
["property", "quorum_max"],
["property", "quorum_up"],
["property", "random_seed"],
["property", "real_server"],
["property", "regex"],
["property", "regex_max_offset"],
["property", "regex_min_offset"],
["property", "regex_no_match"],
["property", "regex_options"],
["property", "regex_stack"],
["property", "reload_time_file"],
["property", "reload_repeat"],
["property", "require_reply"],
["property", "retry"],
["property", "rise"],
["property", "router_id"],
["property", "rs_init_notifies"],
["property", "script"],
["property", "script_user"],
["property", "sh-fallback"],
["property", "sh-port"],
["property", "shutdown_script"],
["property", "shutdown_script_timeout"],
["property", "skip_check_adv_addr"],
["property", "smtp_alert"],
["property", "smtp_alert_checker"],
["property", "smtp_alert_vrrp"],
["property", "smtp_connect_timeout"],
["property", "smtp_helo_name"],
["property", "smtp_server"],
["property", "snmp_socket"],
["property", "sorry_server"],
["property", "sorry_server_inhibit"],
["property", "sorry_server_lvs_method"],
["property", "source_ip"],
["property", "start"],
["property", "startup_script"],
["property", "startup_script_timeout"],
["property", "state"],
["property", "static_ipaddress"],
["property", "static_routes"],
["property", "static_rules"],
["property", "status_code"],
["property", "step"],
["property", "strict_mode"],
["property", "sync_group_tracking_weight"],
["property", "terminate_delay"],
["property", "timeout"],
["property", "track_bfd"],
["property", "track_file"],
["property", "track_group"],
["property", "track_interface"],
["property", "track_process"],
["property", "track_script"],
["property", "track_src_ip"],
["property", "ttl"],
["property", "type"],
["property", "umask"],
["property", "unicast_peer"],
["property", "unicast_src_ip"],
["property", "unicast_ttl"],
["property", "url"],
["property", "use_ipvlan"],
["property", "use_pid_dir"],
["property", "use_vmac"],
["property", "user"],
["property", "uthreshold"],
["property", "val1"],
["property", "val2"],
["property", "val3"],
["property", "version"],
["property", "virtual_ipaddress"],
["property", "virtual_ipaddress_excluded"],
["property", "virtual_router_id"],
["property", "virtual_routes"],
["property", "virtual_rules"],
["property", "virtual_server"],
["property", "virtual_server_group"],
["property", "virtualhost"],
["property", "vmac_xmit_base"],
["property", "vrrp"],
["property", "vrrp_check_unicast_src"],
["property", "vrrp_cpu_affinity"],
["property", "vrrp_garp_interval"],
["property", "vrrp_garp_lower_prio_delay"],
["property", "vrrp_garp_lower_prio_repeat"],
["property", "vrrp_garp_master_delay"],
["property", "vrrp_garp_master_refresh"],
["property", "vrrp_garp_master_refresh_repeat"],
["property", "vrrp_garp_master_repeat"],
["property", "vrrp_gna_interval"],
["property", "vrrp_higher_prio_send_advert"],
["property", "vrrp_instance"],
["property", "vrrp_ipsets"],
["property", "vrrp_iptables"],
["property", "vrrp_lower_prio_no_advert"],
["property", "vrrp_mcast_group4"],
["property", "vrrp_mcast_group6"],
["property", "vrrp_min_garp"],
["property", "vrrp_netlink_cmd_rcv_bufs"],
["property", "vrrp_netlink_cmd_rcv_bufs_force"],
["property", "vrrp_netlink_monitor_rcv_bufs"],
["property", "vrrp_netlink_monitor_rcv_bufs_force"],
["property", "vrrp_no_swap"],
["property", "vrrp_notify_fifo"],
["property", "vrrp_notify_fifo_script"],
["property", "vrrp_notify_priority_changes"],
["property", "vrrp_priority"],
["property", "vrrp_process_name"],
["property", "vrrp_rlimit_rttime"],
["property", "vrrp_rt_priority"],
["property", "vrrp_rx_bufs_multiplier"],
["property", "vrrp_rx_bufs_policy"],
["property", "vrrp_script"],
["property", "vrrp_skip_check_adv_addr"],
["property", "vrrp_startup_delay"],
["property", "vrrp_strict"],
["property", "vrrp_sync_group"],
["property", "vrrp_track_process"],
["property", "vrrp_version"],
["property", "warmup"],
["property", "weight"]
]
----------------------------------------------------
Checks for properties.

View File

@ -0,0 +1,34 @@
global_defs {
notification_email {
example@163.com
}
notification_email_from example@example.com
}
vrrp_instance VI_1 {
notify_fault "/etc/keepalived/to_fault.sh"
}
----------------------------------------------------
[
["property", "global_defs"],
["punctuation", "{"],
["property", "notification_email"],
["punctuation", "{"],
["email", "example@163.com"],
["punctuation", "}"],
["property", "notification_email_from"],
["email", "example@example.com"],
["punctuation", "}"],
["property", "vrrp_instance"],
" VI_1 ",
["punctuation", "{"],
["property", "notify_fault"],
["string", "\"/etc/keepalived/to_fault.sh\""],
["punctuation", "}"]
]
----------------------------------------------------
Checks for string, email (alias string).

View File

@ -0,0 +1,23 @@
$ADDRESS_BASE=10.2.${ADDRESS_BASE_SUB}
$ADDRESS_BASE_SUB=0
${ADDRESS_BASE}.100/32
$ADDRESS_BASE_SUB=10
----------------------------------------------------
[
["variable", "$ADDRESS_BASE"],
["operator", "="],
["number", "10.2"],
".",
["variable", "${ADDRESS_BASE_SUB}"],
["variable", "$ADDRESS_BASE_SUB"],
["operator", "="],
["number", "0"],
["variable", "${ADDRESS_BASE}"],
".100/",
["number", "32"],
["variable", "$ADDRESS_BASE_SUB"],
["operator", "="],
["number", "10"]
]