Outils pour utilisateurs

Outils du site


issue148:certifie_linux

Ceci est une ancienne révision du document !


Where we are: https://www.lpi.org/our-certifications/exam-201-objectives (Measure and troubleshoot resource usage).

Welcome back learners, and a nod to those “just interested”. We are continuing from last issue with the very first topic, capacity planning. We are still busy with resource availability and troubleshooting. Last issue, we covered ps & pstree, and how you can use it to troubleshoot. This time, let us look at network & bandwidth measuring and troubleshooting.

Now, LPIC objectives say netstat - and netstat is something you can write a book about. Luckily, they do not expect you to remember every switch, etc. off the top of your head. (Have a look here: https://www.tecmint.com/20-netstat-commands-for-linux-network-management/ ). The man page is rather overwhelming for newbies, but feel free to peruse it. Though dstat has replaced it in some distributions, you still have it on a vast variety of systems, so let us look at what we need to know.

When one troubleshoots a network connection, usually we run the “ping” command or “traceroute” command. When things look off, we run “netstat -r” to see the routing table. This is handy when you have multiple networks on multiple subnets, or multiple network cards on your server. Open a terminal and type netstat -s please. Look at the output. Scroll up and down if you have to. One of the nice features of netstat is that it will reversely resolve hostnames for you, so if you are connected to www.somedomain.com, it will pop back and give you the IP, say, 41.42.43.44, but this can take time. When you are on your home PC or laptop, this is usually very quick and you do not wait. Now, imagine a server with thousands of open ports, connected to thousands of clients. As sysadmin, you run a netstat -l and the ‘Foreign Address’ field needs to be populated for each one… This is where the -n option comes into play. At the night school where I used to teach, we had a lecturer who used to get his students to memorise “netstat -tuna”. Funny and handy. I would recommend that you make rhymes or funny words to remember the options you want to use, say “netstat -cult -n”.

Let us deconstruct that last one: • To see listening ports, -l • To see TCP ports, -t • To see UDP ports, -u • To have no foreign address resolution, -n • To have it constantly updated, -c

Remember , “-tuna” and “-t -u -n -a” is the same. Can you come up with a catchy phrase?

Try them out!

Let us do what we did with the previous commands and try to link it up.

When you add the -p option, you will see the PID / Program name added at the end of the output. Again this is very handy to see what is hogging your resources, which is what we want to do in “measuring” and “troubleshooting”. So don’t break your head over all the options now; for the exam, know how to “measure” and “troubleshoot”.

Some questions

Which of the following commands will list the IPv4 neighbours of the current system? This includes IP and MAC addresses (choose TWO correct answers): A. arp B. ifconfig -lv eth0 C. netstat -al D. ip neigh show

If you said C … SHAME on you! Just because we were learning about netstat doesn’t mean the answer will automatically be netstat!

Give us your answer/explanation at misc@fullcirclemagazine.org

If you would like to jump ahead, or test your skills at an LPI exam, do a test paper here: https://www.itexams.com/exam/117-201 These were once valid LPI questions and will ease you into the format: • The new exam number is 201-400, 117-201 was the old one. • The site does require signing up, but sign up with temporary email – not your real email. • DO NOT learn these questions parrot fashion, as they are probably not real exam questions.

Let us know how you did, good or bad, it does not matter. Good means you are ready to write and confident in your skills. Bad means you will be learning new stuff!! Yay! There is no down side here. If you do not know why an answer is the way it is, contact us.

issue148/certifie_linux.1567418681.txt.gz · Dernière modification : 2019/09/02 12:04 de auntiee