Page MenuHomeVyOS Platform

mtr / monitor traceroute can't show any ouput in json
Closed, ResolvedPublic

Description

mtr tool can't show the values in JSON format, it's broken in our cli.

monitor traceroute www.google.com json or mtr www.google.com json

 (185.144.208.198) -> www.google.com (142.250.191.196)                                                                                                                                                                                2024-09-30T18:45:41+0000
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                                                                                                                                                                                                                     Packets               Pings
 Host                                                                                                                                                                                                                              Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 169.254.1.1                                                                                                                                                                                                                     0.0%     7    0.2   0.2   0.2   0.2   0.0
 2. 169.254.21.0                                                                                                                                                                                                                    0.0%     7    0.4   0.4   0.4   0.4   0.0
 3. 10.253.53.57                                                                                                                                                                                                                    0.0%     7    0.3   0.3   0.3   0.4   0.0
 4. 10.253.52.3                                                                                                                                                                                                                     0.0%     7    0.7   0.6   0.5   0.7   0.1
 5. 0.et-0-1-2.bbr2.ch2.packet.net                                                                                                                                                                                                  0.0%     7    1.4   2.4   1.2   9.1   3.0
 6. 192.178.71.18                                                                                                                                                                                                                   0.0%     7    2.3   1.5   1.3   2.3   0.4
 7. 142.251.249.39                                                                                                                                                                                                                  0.0%     7    1.8   8.3   1.8  27.2   9.6
 8. 142.251.60.13                                                                                                                                                                                                                   0.0%     7    1.3   1.3   1.2   1.3   0.0
 9. ord38s31-in-f4.1e100.net                                                                                                                                                                                                        0.0%     6    1.2   1.2   1.2   1.3   0.0

but mtr is supported it if we use native command :

$ sudo mtr -j www.google.com
{
    "report": {
        "mtr": {
            "src": "macsec02-onprem",
            "dst": "www.google.com",
            "tos": 0,
            "tests": 10,
            "psize": "64",
            "bitpattern": "0x00"
        },
        "hubs": [
            {
                "count": 1,
                "host": "169.254.1.1",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.185,
                "Avg": 0.226,
                "Best": 0.185,
                "Wrst": 0.28,
                "StDev": 0.028
            },
            {
                "count": 2,
                "host": "169.254.21.0",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.413,
                "Avg": 0.398,
                "Best": 0.332,
                "Wrst": 0.472,
                "StDev": 0.038
            },
            {
                "count": 3,
                "host": "10.253.53.63",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.406,
                "Avg": 0.375,
                "Best": 0.297,
                "Wrst": 0.425,
                "StDev": 0.045
            },
            {
                "count": 4,
                "host": "10.253.52.15",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.557,
                "Avg": 4.842,
                "Best": 0.503,
                "Wrst": 10.794,
                "StDev": 4.547
            },
            {
                "count": 5,
                "host": "0.et-1-1-2.bbr1.ch2.packet.net",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 1.507,
                "Avg": 1.86,
                "Best": 1.465,
                "Wrst": 3.247,
                "StDev": 0.646
            },
            {
                "count": 6,
                "host": "147.28.130.207",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 1.522,
                "Avg": 1.502,
                "Best": 1.391,
                "Wrst": 1.613,
                "StDev": 0.08
            },
            {
                "count": 7,
                "host": "192.178.249.203",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 1.444,
                "Avg": 1.417,
                "Best": 1.353,
                "Wrst": 1.476,
                "StDev": 0.043
            },
            {
                "count": 8,
                "host": "142.251.60.203",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 1.396,
                "Avg": 1.369,
                "Best": 1.345,
                "Wrst": 1.403,
                "StDev": 0.021
            },
            {
                "count": 9,
                "host": "ord37s34-in-f4.1e100.net",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 1.354,
                "Avg": 1.354,
                "Best": 1.323,
                "Wrst": 1.415,
                "StDev": 0.027
            }
        ]
    }
}

Details

Version
VyOS 1.4.0
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

fernando renamed this task from mtr / monitor traceroute can show any ouput in json to mtr / monitor traceroute can't show any ouput in json.
fernando created this object in space S1 VyOS Public.
natali-rs1985 changed the task status from Open to In progress.Oct 2 2024, 2:26 PM

tested with the fixed done by @natali-rs1985 : , works with ports as well :

mtr www.google.com tcp port 443 json
{
    "report": {
        "mtr": {
            "src": "vyos",
            "dst": "www.google.com",
            "tos": 0,
            "tests": 10,
            "psize": "64",
            "bitpattern": "0x00"
        },
        "hubs": [
            {
                "count": 1,
                "host": "172.16.50.1",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 0.942,
                "Avg": 0.831,
                "Best": 0.622,
                "Wrst": 1.144,
                "StDev": 0.18
            },
            {
                "count": 2,
                "host": "192.168.0.1",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 1.33,
                "Avg": 1.132,
                "Best": 0.926,
                "Wrst": 1.447,
                "StDev": 0.182
            },
            {
                "count": 3,
                "host": "200.51.241.1",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 4.281,
                "Avg": 6.549,
                "Best": 3.868,
                "Wrst": 15.751,
                "StDev": 3.841
            },
            {
                "count": 4,
                "host": "74.125.32.151",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 16.592,
                "Avg": 7.961,
                "Best": 3.871,
                "Wrst": 17.839,
                "StDev": 5.241
            },
            {
                "count": 5,
                "host": "72.14.208.90",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 3.431,
                "Avg": 5.362,
                "Best": 3.431,
                "Wrst": 10.078,
                "StDev": 2.425
            },
            {
                "count": 6,
                "host": "108.170.255.29",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 4.561,
                "Avg": 5.326,
                "Best": 4.561,
                "Wrst": 6.821,
                "StDev": 0.705
            },
            {
                "count": 7,
                "host": "142.251.77.171",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 4.811,
                "Avg": 4.541,
                "Best": 3.898,
                "Wrst": 5.306,
                "StDev": 0.503
            },
            {
                "count": 8,
                "host": "eze10s02-in-f4.1e100.net",
                "Loss%": 0.0,
                "Snt": 10,
                "Last": 4.55,
                "Avg": 4.296,
                "Best": 3.59,
                "Wrst": 4.81,
                "StDev": 0.336
            }
        ]
    }
}

thanks

vyosbot added a project: Restricted Project.Oct 14 2024, 8:05 AM
dmbaturin removed a project: Restricted Project.Oct 14 2024, 10:43 AM
dmbaturin changed Version from -VyOS 1.4.0 to VyOS 1.4.0.
dmbaturin changed Issue type from Unspecified (please specify) to Bug (incorrect behavior).
natali-rs1985 moved this task from Need Triage to Completed on the VyOS Rolling board.