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

It would be cool if fping could return json with results #164

Open
shkabaturd opened this issue Dec 13, 2019 · 7 comments
Open

It would be cool if fping could return json with results #164

shkabaturd opened this issue Dec 13, 2019 · 7 comments

Comments

@shkabaturd
Copy link

No description provided.

@mmihalev
Copy link

Yes, please. We need that feature.

@amit777
Copy link

amit777 commented Feb 18, 2023

+1. This would be awesome

@gsnw-sebast
Copy link
Collaborator

I have stored a current version under https://github.com/gsnw/fping/tree/json-output which was created from the branch https://github.com/schweikert/fping/tree/json-output that is no longer current.
I will keep this branch up to date with the develop branch until I perhaps pursue the topic further myself

@gsnw-sebast
Copy link
Collaborator

Under https://github.com/gsnw/fping/tree/issue/164-1 is my first working version of the JSON output.

This can be tested with the call ./fping -J -c 2 -q 127.0.0.1 8.8.8.8 8.8.8.1

@gsnw-sebast
Copy link
Collaborator

Viewing and testing permitted. Comments and suggestions for improvement welcome.

Pull request: #379

@AthenaNetworks
Copy link

+1

Ended up writing an fping drop in replacement in Go just to output JSON. Would be a million times better if it was built into fping.

AthenaNetworks pushed a commit to AthenaNetworks/fping that referenced this issue Feb 12, 2025
- Modified json.c to consistently use stdout for all JSON output
- Updated add_name in fping.c to use stdout for error JSON output
- Simplified error JSON output in add_name to match other JSON output
- All tests now pass with consistent stdout/stderr behavior
AthenaNetworks pushed a commit to AthenaNetworks/fping that referenced this issue Feb 12, 2025
…r one coming

🚌 Sometimes DNS says 'Name or service not known'
🚌 Sometimes it says 'Temporary failure in name resolution'
🤷 Who are we to judge? Let's accept both!

Also fixed the exit code because num_noaddress++ was playing hide and seek
in the wrong place. It's now properly counted before we return.
AthenaNetworks pushed a commit to AthenaNetworks/fping that referenced this issue Feb 12, 2025
…k in! 🤦‍♂️

Dear DNS errors,
Could we maybe standardize on ONE message?
Pretty please? No?
Fine, have it your way...

Added yet another special snowflake to our regex:
'nodename nor servname provided, or not known'

At this point, I wouldn't be surprised if Windows
comes along with 'Computer says no' 🙄

(Testing is fun, they said.
It'll be easy, they said...)
@AthenaNetworks
Copy link

New pull request with updated code, pretty print on/off, and passing tests. #380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants