Skip to content

fix: export Excluded VIPs (evips) with JSON output" #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

dmachard
Copy link
Contributor

This pull request addresses an issue with exporting excluded VIPs in JSON format.

Currently, when using JSON output, the keepalived_vrrp_excluded_state metric is missing because the excluded_vips field is absent from the Keepalived JSON output.
This fix ensures that the key, named evips, is correctly included in the JSON output, allowing the metric to be properly exported.

@dmachard dmachard changed the title fix: rename json flag excluded_vips to evips fix: export Excluded VIPs (evips) with JSON output" Mar 21, 2025
@dmachard
Copy link
Contributor Author

@clwluvw ok for you ?

@clwluvw
Copy link
Collaborator

clwluvw commented Mar 24, 2025

Could you please comment on what version you tested against? I guess we missed a test case for json parsing.

@dmachard
Copy link
Contributor Author

dmachard commented Mar 24, 2025

keepalived 2.2.4

[
    {"data":
        {
            "iname":"VI_IPV4",
            "dont_track_primary":0,
            "skip_check_adv_addr":0,
            "strict_mode":0,
            "vmac_ifname":"",
            "ifp_ifname":"ens224",
            "master_priority":100,
            "last_transition":1742377372.387751,
            "garp_delay":5,
            "garp_refresh":0,
            "garp_rep":5,
            "garp_refresh_rep":1,
            "garp_lower_prio_delay":5,
            "garp_lower_prio_rep":5,
            "lower_prio_no_advert":0,
            "higher_prio_send_advert":0,
            "vrid":137,
            "base_priority":100,
            "effective_priority":100,
            "vipset":true,
            "promote_secondaries":false,
            "adver_int":1,
            "master_adver_int":1,
            "accept":1,
            "nopreempt":true,
            "preempt_delay":0,
            "state":2,
            "wantstate":2,
            "version":2,
            "smtp_alert":false,
            "notify_deleted":false,
            "vips":["10.0.0.1 dev ens224 scope global set"],
            "evips":["10.0.0.2 dev ens224 scope global set",
            "10.0.0.41 dev ens224 scope global set",
            "10.0.0.7 dev ens224 scope global set"],
            "track_ifp":["dummy0"],
            "track_script":["'\/etc\/keepalived\/keepalived_check.sh' 'keepalive.' '10.0.0.1'"],
            "auth_type":1,
            "auth_data":"keep137"},
            "stats":{"advert_rcvd":347,
            "advert_sent":4230522,
            "become_master":7,
            "release_master":6,
            "packet_len_err":0,
            "advert_interval_err":0,
            "ip_ttl_err":0,
            "invalid_type_rcvd":0,
            "addr_list_err":0,
            "invalid_authtype":0,
            "authtype_mismatch":0,
            "auth_failure":0,
            "pri_zero_rcvd":14,
            "pri_zero_sent":6
        }
    }
]

Copy link
Collaborator

@clwluvw clwluvw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I tried to search the keepalived's code for any references to excluded_vips but couldn’t find any. It seems this was an oversight from the start.

@clwluvw clwluvw merged commit d91ee6a into mehdy:master Mar 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants