Send via email to me the name of server and IP

VinylxScratches

Golden Member
Feb 2, 2009
1,666
0
0
What would be the best way to get this information sent to me? Most of the Linux boxes are Red Hat. They're different versions.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
What IP are you looking for? Local? Are the servers behind firewalls and you want their public IP?

For the most part you can send any text you want using the CLI command mail

echo 'some text to go in the body of my e-mail' | mail -s "subject of my email" myemail@address.com
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
As Crusty says, local is simple: "ip addr show dev eth0 | grep "inet " | awk '{ print $2 }' | mail -s "Current IP on `hostname -f`".

But if you want the public IP you should probably look at using a dynamic DNS service.