Skip to content
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

Alarms are broken on multi-RE systems #216

Closed
Nothing4You opened this issue Jun 15, 2023 · 0 comments · Fixed by #217
Closed

Alarms are broken on multi-RE systems #216

Nothing4You opened this issue Jun 15, 2023 · 0 comments · Fixed by #217

Comments

@Nothing4You
Copy link
Contributor

single-RE `show system alarms`

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/ZZZ/junos">
    <alarm-information xmlns="http://xml.juniper.net/junos/ZZZ/junos-alarm">
        <alarm-summary>
            <active-alarm-count>2</active-alarm-count>
        </alarm-summary>
        <alarm-detail>
            <alarm-time junos:seconds="1635533090">
                2021-10-29 18:44:50 UTC
            </alarm-time>
            <alarm-class>Minor</alarm-class>
            <alarm-description>Autorecovery information needs to be saved</alarm-description>
            <alarm-short-description>autorecovery-save-r</alarm-short-description>
            <alarm-type>Autorecovery</alarm-type>
        </alarm-detail>
        <alarm-detail>
            <alarm-time junos:seconds="1635533089">
                2021-10-29 18:44:49 UTC
            </alarm-time>
            <alarm-class>Minor</alarm-class>
            <alarm-description>Rescue configuration is not set</alarm-description>
            <alarm-short-description>no-rescue</alarm-short-description>
            <alarm-type>Configuration</alarm-type>
        </alarm-detail>
    </alarm-information>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>

single-RE `show chassis alarms`

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/ZZZ/junos">
    <alarm-information xmlns="http://xml.juniper.net/junos/ZZZ/junos-alarm">
        <alarm-summary>
            <no-active-alarms/>
        </alarm-summary>
    </alarm-information>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>

single-RE exporter output

# HELP junos_alarms_red_count Number of red alarms (not silenced)
# TYPE junos_alarms_red_count gauge
junos_alarms_red_count{target="TARGET"} 0
# HELP junos_alarms_set Alarm active with the details provided in labels
# TYPE junos_alarms_set gauge
junos_alarms_set{class="Minor",description="Autorecovery information needs to be saved",target="TARGET",type="Autorecovery"} 1
junos_alarms_set{class="Minor",description="Rescue configuration is not set",target="TARGET",type="Configuration"} 1
# HELP junos_alarms_yellow_count Number of yollow alarms (not silenced)
# TYPE junos_alarms_yellow_count gauge
junos_alarms_yellow_count{target="TARGET"} 2
# HELP junos_collect_duration_seconds Duration of a scrape by collector and target
# TYPE junos_collect_duration_seconds gauge
junos_collect_duration_seconds{collector="Alarm",target="TARGET"} 5.236934917
# HELP junos_collector_duration_seconds Duration of a collector scrape for one target
# TYPE junos_collector_duration_seconds gauge
junos_collector_duration_seconds{target="TARGET"} 5.2369784169999996
# HELP junos_up Scrape of target was successful
# TYPE junos_up gauge
junos_up{target="TARGET"} 1
multi-RE `show system alarms`

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/ZZZ/junos">
    <multi-routing-engine-results>

        <multi-routing-engine-item>

            <re-name>node0</re-name>

            <alarm-information xmlns="http://xml.juniper.net/junos/ZZZ/junos-alarm">
                <alarm-summary>
                    <active-alarm-count>2</active-alarm-count>
                </alarm-summary>
                <alarm-detail>
                    <alarm-time junos:seconds="1684172206">2023-05-15 17:36:46 UTC</alarm-time>
                    <alarm-class>Minor</alarm-class>
                    <alarm-description>Autorecovery information needs to be saved</alarm-description>
                    <alarm-short-description>autorecovery-save-r</alarm-short-description>
                    <alarm-type>Autorecovery</alarm-type>
                </alarm-detail>
                <alarm-detail>
                    <alarm-time junos:seconds="1684172206">2023-05-15 17:36:46 UTC</alarm-time>
                    <alarm-class>Minor</alarm-class>
                    <alarm-description>Rescue configuration is not set</alarm-description>
                    <alarm-short-description>no-rescue</alarm-short-description>
                    <alarm-type>Configuration</alarm-type>
                </alarm-detail>
            </alarm-information>
        </multi-routing-engine-item>

        <multi-routing-engine-item>

            <re-name>node1</re-name>

            <alarm-information xmlns="http://xml.juniper.net/junos/ZZZ/junos-alarm">
                <alarm-summary>
                    <active-alarm-count>2</active-alarm-count>
                </alarm-summary>
                <alarm-detail>
                    <alarm-time junos:seconds="1685967777">2023-06-05 12:22:57 UTC</alarm-time>
                    <alarm-class>Minor</alarm-class>
                    <alarm-description>Autorecovery information needs to be saved</alarm-description>
                    <alarm-short-description>autorecovery-save-r</alarm-short-description>
                    <alarm-type>Autorecovery</alarm-type>
                </alarm-detail>
                <alarm-detail>
                    <alarm-time junos:seconds="1685967777">2023-06-05 12:22:57 UTC</alarm-time>
                    <alarm-class>Minor</alarm-class>
                    <alarm-description>Rescue configuration is not set</alarm-description>
                    <alarm-short-description>no-rescue</alarm-short-description>
                    <alarm-type>Configuration</alarm-type>
                </alarm-detail>
            </alarm-information>
        </multi-routing-engine-item>

    </multi-routing-engine-results>
    <cli>
        <banner>{primary:node0}</banner>
    </cli>
</rpc-reply>

multi-RE `show chassis alarms`

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/ZZZ/junos">
    <multi-routing-engine-results>

        <multi-routing-engine-item>

            <re-name>node0</re-name>

            <alarm-information xmlns="http://xml.juniper.net/junos/ZZZ/junos-alarm">
                <alarm-summary><no-active-alarms/>
            </alarm-summary>
        </alarm-information>
    </multi-routing-engine-item>

    <multi-routing-engine-item>

        <re-name>node1</re-name>

        <alarm-information xmlns="http://xml.juniper.net/junos/ZZZ/junos-alarm">
            <alarm-summary><no-active-alarms/>
        </alarm-summary>
    </alarm-information>
</multi-routing-engine-item>

    </multi-routing-engine-results>
    <cli>
<banner>{primary:node0}</banner>
    </cli>
        </rpc-reply>

multi-RE exporter output

# HELP junos_alarms_red_count Number of red alarms (not silenced)
# TYPE junos_alarms_red_count gauge
junos_alarms_red_count{target="TARGET"} 0
# HELP junos_alarms_yellow_count Number of yollow alarms (not silenced)
# TYPE junos_alarms_yellow_count gauge
junos_alarms_yellow_count{target="TARGET"} 0
# HELP junos_collect_duration_seconds Duration of a scrape by collector and target
# TYPE junos_collect_duration_seconds gauge
junos_collect_duration_seconds{collector="Alarm",target="TARGET"} 6.111589375
# HELP junos_collector_duration_seconds Duration of a collector scrape for one target
# TYPE junos_collector_duration_seconds gauge
junos_collector_duration_seconds{target="TARGET"} 6.111599
# HELP junos_up Scrape of target was successful
# TYPE junos_up gauge
junos_up{target="TARGET"} 1
Nothing4You added a commit to Nothing4You/junos_exporter that referenced this issue Jun 15, 2023
This implements handling of multi-RE alarm responses, fixing czerwonk#216.
It also introduces a few test cases to ensure multi-RE systems are being
handled properly in the future.
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 a pull request may close this issue.

1 participant