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

Expose get_loss #978

Merged
merged 2 commits into from
Mar 29, 2023
Merged

Expose get_loss #978

merged 2 commits into from
Mar 29, 2023

Conversation

selankon
Copy link
Collaborator

@selankon selankon commented Mar 7, 2023

It expose the get_loss function for IPv4 ips. It will be used to do diagnosis of where the last internet path is broken, from the frontend on the new landing page. It just return ping loose to specific ip, example:

ubus call lime-metrics get_loss '{"target" : "1.1.1.4"}'
{
	"status": "ok",
	"loss": "0"
}

@ilario
Copy link
Member

ilario commented Mar 13, 2023

This works also without Babeld, no?
It is a simple ping, why does it look for lime-proto-babeld?
I tested it with IPv4 on LibreMesh built on OpenWrt 19.07 and it works :)

@ilario ilario added this to the 2020.2 milestone Mar 13, 2023
@ilario
Copy link
Member

ilario commented Mar 24, 2023

Tested also on OpenWrt 22.03 and it also works there.
I still have to understand why it checks for the presence of Babeld...

@G10h4ck
Copy link
Member

G10h4ck commented Mar 27, 2023

@selankon the dependency on babel is not obvious to me, can you exaplin it?
Thanks

@selankon
Copy link
Collaborator Author

@G10h4ck probably is not needed. I just copy pasted the code on lime-metrics metrics.get_metrics: https://github.com/libremesh/lime-packages/blob/master/packages/ubus-lime-metrics/files/usr/lib/lua/lime-metrics.lua#L19

    if lutils.is_installed("lime-proto-bmx6") then
        loss = utils.get_loss(node..".mesh", 6)
        shell_output = lutils.unsafe_shell("netperf -6 -l 10 -H "..node..".mesh| tail -n1| awk '{ print $5 }'")
    elseif lutils.is_installed("lime-proto-babeld") then
        loss = utils.get_loss(node, 4)
        shell_output = lutils.unsafe_shell("netperf -l 10 -H "..node.."| tail -n1| awk '{ print $5 }'")
    else
        return {status="error", error={msg="No lime-proto-bmx6 or lime-proto-babeld found", code="1"}}
    end

Probably, it can work without this. And also, I'm thinking that maybe ipv6 has to be supported?

@G10h4ck
Copy link
Member

G10h4ck commented Mar 27, 2023

just remove the check then, let's keep the IPv6 stuff for another PR

@selankon
Copy link
Collaborator Author

@G10h4ck this should fix it 97646dd

@selankon
Copy link
Collaborator Author

selankon commented Mar 28, 2023

I don't know why the tests are failing, locally don't, and I can't re run the jobs (could be a permission problems for my user?)

@ilario
Copy link
Member

ilario commented Mar 29, 2023

The tests are failing because someone have to build a new Docker image for unit testing on OpenWrt 22.03.

@ilario ilario self-requested a review March 29, 2023 07:55
@ilario ilario merged commit 73e92cb into libremesh:master Mar 29, 2023
@G10h4ck G10h4ck modified the milestones: 2020.2, mesh-wide May 10, 2024
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.

None yet

3 participants