Get list of interface name, descriptions and ip address
-
Hello,
I want get a list of interface names, descriptions and their ip addresses via cli to feed into zabbix/influxdb. I can see this information being listed in 'console' login. Is it possible to get this via a script?
Thanks
-
Hi,
Have a close look at that information.
see this :
That's a perfect candidate for what looks like a static text : it's hardcoded somewhere in a script that make the login screen menu.
Knowing that your question is as old as there are console type system access, some oen wrote a tools for it in the sixties, some 60 years ago.
It's called 'grep'.In the console, use option 8.
Typegrep -R '*** Welcome to' /etc/*
I guess you underand why I choose as a string to be searched for.
Check out the file it found : /etc/rc.banner
That's a small file that collects all the info. You can see how it's done using world most simplest script language : PHP. -
Thanks, I can work with this.
-
Of course
You already did. When you visit the console, you activated that script.
( maybe without knowing it )