-
Notifications
You must be signed in to change notification settings - Fork 39
rtrdump: serial missing from metadata if zero #83
Comments
Thank you for raising the issue. |
I'm currently writing and testing a script that handles rtrdump and jq, compares serial and data with a previous run, and returns with different exit codes, infos on stdout and errors on stderr. I should then be able to use the script both in custom situations (cronjob triggered local health-check and sending results to something like healthcheck.io) and also as a nagios plugin. |
Following #82, I am considering making something like this (that would output to Prometheus or run as one-off with diff). |
I'm accessing
I don't understand what you mean by saying jq may not be being able to handle default values? |
`jq '.["metadata"]["serial"] | numbers' does not return zero but empty: you have to assume zero in the subsequent script, correct? |
Yes, I have to assume zero in this case, so I'm unable to tell the difference between incomplete JSON and "just" missing serial. If rtrdump would output |
Ah to handle the case where the rtr session would break and rtrdump outputs a partial file? |
Well I didn't think about possible failure scenarios too much to be honest, I'm just trying to make it as robust as possible, so that's why I dislike the idea that I have to assume zero when the parameter is missing. I think if 0 is a proper serial number valid as per the RTR specification, it should appear in the JSON explicitly. In reality, jq behaves differently with a truncated JSON file, so is already detected today:
I just feel like I would be more robust to remove the second part (although even today a truncated json would lead to jq return non-zero, and the die() error function would stop it all):
|
Hello,
setup is:
VRP's: https://rpki.cloudflare.com/rpki.json
Server: GoRTR v0.14.6
Client: RTRdump 0.11.0 (really is v0.14.6 but the version string was not updated)
When GoRTR was just started, and the serial is zero:
I would expect to see "serial": 0 in JSON, instead of omitting the serial.
Only when the serial bumps to non-zero does the JSON metadata output from the rtrdump contain it:
This is making monitoring serial updates more difficult.
Could you make rtrdump emit
"serial": 0
in these cases instead if omitting it?The text was updated successfully, but these errors were encountered: