Skip to content

Conversation

@GigleGig
Copy link

@GigleGig GigleGig commented Dec 3, 2025

Related Issue

Fixes #903

Description

Fix KeyError when parsing Junos device data. The _clean_junos_data function was failing when bootupTimestamp key was missing from the device output, which occurs on certain Junos EX devices with different JSON output structures.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

New Behavior

Junos device data is now parsed correctly even when bootupTimestamp is missing from the output. The parser handles different JSON structures across various Junos versions and device types.

Contrast to Current Behavior

Previously, the parser threw a KeyError exception when processing Junos devices (such as EX9208 with Junos 14.2R8.4) that return a different JSON structure for show system uptime output.

Discussion: Benefits and Drawbacks

  • Benefits: Junos EX devices with different JSON output formats can now be properly monitored by SuzieQ
  • Drawbacks: None
  • Backwards-compatible: Yes

Changes to the Documentation

None required.

Proposed Release Note Entry

Fix KeyError when parsing Junos device data with missing bootupTimestamp (#903)

Comments

The issue was caused by different Junos devices returning different JSON structures for the show system uptime command. Some devices use system-uptime-information directly, while others wrap it in multi-routing-engine-results.

Changes include:

  • config/device: Modified the junos-ex device logic to match different versions
  • poller/node: The parsing logic was relaxed

Double Check

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR source branch is created from the develop branch.
  • My PR targets the develop branch.
  • All my commits have --signoff applied

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.

[Bug]: _clean_junos_data KeyError: 'bootupTimestamp'

1 participant