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

Suggestion: Report local IP as well #4

Open
SuperHofstad opened this issue Apr 21, 2020 · 3 comments
Open

Suggestion: Report local IP as well #4

SuperHofstad opened this issue Apr 21, 2020 · 3 comments

Comments

@SuperHofstad
Copy link

Make it report local ip's as well, or an config option as to what interfaces to do an additional check
for ip changes.

Example:
Someone else is moving a server to a new network, gets new ip, it gets internet connectivity, send an email about the external and internal ip's. (its behind a firewall, cant connect externally)
Then when I'm at site connecting locally thru same network, I already know the ip. no need to do a netscan.

A hostname can kinda "do" the same thing, but for me its better to know the ip than the hostname.

@begleysm
Copy link
Owner

Thank you for the suggestion @SuperHofstad. It is a good one. At this time I probably won't add that feature as I'm busy with other projects but I'll keep this suggestion open against the day that I find the time. Feel free to implement the feature yourself and submit a pull request.

This could be done using the same email functionality built into the software but driven by hostname -i or hostname -I or ifconfig or ip address + some grep work. It might be a bit complicated by the fact that different distros support different commands and formats.

@begleysm begleysm changed the title Suggestion Suggestion: Report local IP as well Jun 30, 2021
@carolmanderson
Copy link
Contributor

I needed the local IP address too, so implemented it in my own fork of this repo. It's not clean enough to be ready for a pull request, but it does work.

Thanks @begleysm for this useful code.

@begleysm
Copy link
Owner

begleysm commented Aug 2, 2021

Thanks @carolmanderson! And you're welcome!

I've been a bit hesitant to attack this since my, limited, research suggested that it is difficult to make it platform independent and reliable. Although I found the comment in the link you provided in the code (https://stackoverflow.com/a/28950776). It looks like people are having pretty good results with this solution.

And as to the code not being "clean enough". I'm an EE, not a CC, so it looks fine to me! I'd accept a pull request if you submitted one.

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

No branches or pull requests

3 participants