[SOLVED] Question for all who lurk and post here. Are you also a "system admin"?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Question for all who lurk and post here. Are you also a "system admin"?
I came across a post on reddit the other day where someone was making a joke about this nifty command that could retrieve the IP address of an LXC container. As far as I understand, the comments on the post were in agreement, it was an elegant method to get around some short comings of the systems they work in.
Now to me, this command seemed like a dirty hack. Something you might do in an emergency, not something that would be praised or even worse, acknowledged as a common technique. So I asked, is this common behaviour in a system admin role? To which I got a response that said yes, system administration is filled with small one off commands that solve these common problems.
To me this seems completely counter to what modern programming is like, I have more experience programming than I do in system administration but I am trying to improve and gain more confidence by administering my own home server. I constantly feel like everything I achieve is a waste of time because to me, it all lacks elegance and design, but this is me looking at it from the same perspective I would use when programming.
So this brief experience the other day was illuminating to me, maybe the challenges and frustrations I feel with my own self directed learning of system administration is part of what modern system administration is?
So I wanted to ask all of y'all how ya felt about this? Do you find modern system administration to be the opposite of modern programming?
For an ephemeral command to retrieve a value, where an error or unexpected value simply means re-typing, it only matters if it returns the appropriate value.
For persistent code that has to work unsupervised with different states and unknown future inputs, being fully correct and maintainable are obviously important.
Of course, many one-off commands do require careful correctness to not screw things up, but retrieving an IP address doesn't sound dangerous...
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,485
Rep:
Most sysadmins will hack together commands via 'redirection' & 'pipes' to achieve their goal, it is quite common, & the way that unix/Linux was built to work originally. For jobs that may be performed more than once or twice, programming 'scripts' are often used.
To me this seems completely counter to what modern programming is like, I have more experience programming than I do in system administration but I am trying to improve and gain more confidence by administering my own home server. I constantly feel like everything I achieve is a waste of time because to me, it all lacks elegance and design, but this is me looking at it from the same perspective I would use when programming.
So I wanted to ask all of y'all how ya felt about this? Do you find modern system administration to be the opposite of modern programming?
In my career I have been a system programmer, a programmer, a programming manager, and a data center manager where some of my subordinates were system administrators. You are looking at system administration through a programmers eyes. You are taken aback that a system administrator does things that a programmer would consider "quick and dirty" and with a complete lack of documentation.
A system administrator is in charge of a running system which he has to keep running smoothly and not allowing problems or configuration changes to create downtime or user inconvenience. He fixes problems as quickly as possible with as few disruptions as possible. If he creates a quick and dirty solution which causes no further problems then more glory to the system administrator. Having done so he will park the solution someplace handy for possible future use and verbally tell the other sysadmins of its existence.
If a programmer did the same thing with production programs the programming manager would downgrade the programmer's evaluation for writing code which did not conform to company programming standards and which is not maintainable because there is no documentation.
Another difference between the two is time deadlines. A programmer is working to a deadline of six weeks from now. A sysadmin is working to a deadline of "NOW". This difference is also seen in their different attitudes to work schedules. A programmer can take time off to run errands, work odd shifts to get machine time, and work a lot of unpaid overtime as the deadline approaches. A sysadmin has to be at work on the dot to relieve the person working the previous shift. If he wants to skip out to go to the bank or whatever he has to get some other sysadmin to cover for him and probably trade time with his substitute. I had one single woman sysadmin who would consistently trade second shift on Fridays for any third shift during the week because working second shift Friday interfered with her love life.
and so it goes
Last edited by jailbait; 07-03-2022 at 06:40 PM.
Reason: typo
I do not do anything officially or as a profession. I consider myself one though. I manage the stuff around my home which is a bit extensive from my viewpoint. I run all kinds of random things that aren't super dangerous to my layout or setup around here. There is always a better way but when you are trying to get the job done sometimes it's quicker to do a dirty hack depending on who is waiting for the services or whatever. I'd imagine that is true in the professional world as well. Get the job done with as little danger as possible while still being quick about it.
To be fair I don't have to answer to anyone but myself either so it's all a matter of perspective.
After 37 years in computers professionally, 35 as acting network/system administrator, one-line and one-off solutions that got the information needed and/or solved the problem until other tools caught up to the need were not only common, they were almost daily treasures. It is great to know the tools and what they can do, but that is not your real job. Your real job is to save the business, protect the data, and make sure that the doors open again Monday morning! If there is not a prebuilt way to make it work on-hand, you MAKE it work! That is what the degrees and experience are for, that is why you make the big (never big enough) bucks!
And once you have something you can share, you share it: because there are other professionals out there that WILL run into the same problem. They share with you, you share with them, everyone gets smarter and stays employed.
What, you thought there was a magic wand or book of answers? We CREATED this world!
After 37 years in computers professionally, 35 as acting network/system administrator, one-line and one-off solutions that got the information needed and/or solved the problem until other tools caught up to the need were not only common, they were almost daily treasures. It is great to know the tools and what they can do, but that is not your real job. Your real job is to save the business, protect the data, and make sure that the doors open again Monday morning! If there is not a prebuilt way to make it work on-hand, you MAKE it work! That is what the degrees and experience are for, that is why you make the big (never big enough) bucks!
And once you have something you can share, you share it: because there are other professionals out there that WILL run into the same problem. They share with you, you share with them, everyone gets smarter and stays employed.
What, you thought there was a magic wand or book of answers? We CREATED this world!
I guess what is weird to me is that there is basically a package or a framework for practically anything these days in the programming world, hell, VS Code is perhaps on the verge of writing code on it's own with minimal support from the human, then to see and hear that system administration is somehow "behind" (if that's the right word) in this regard just seems so strange to me as system administration in my opinion is a level lower than the software we write. It's the infrastructure that makes the modern world exist. I feel like it would evolve slower and thus have more mature tooling. Is that not the case?
I guess what is weird to me is that there is basically a package or a framework for practically anything these days in the programming world, hell, VS Code is perhaps on the verge of writing code on it's own with minimal support from the human, then to see and hear that system administration is somehow "behind" (if that's the right word) in this regard just seems so strange to me as system administration in my opinion is a level lower than the software we write. It's the infrastructure that makes the modern world exist. I feel like it would evolve slower and thus have more mature tooling. Is that not the case?
Yes, in general the quality of the code written by sysadmins is of much lower quality than the code written by programmers. But you are missing the point made by wpeckham that programming is only a minor part of a sysadmins responsibilities. There is backup and recovery. When (not if) a disk drive fails is there backup available, how long does it take to switch to the backup, and how disruptive is the switch? All of that has to be figured out before the disk drive breaks. And if a problem arises during the restore then you need some quick and dirty software ASAP.
When a clerk calls up and says he forgot his password is this really a company employee or a hacker doing some social engineering? Security is a whole area to itself where you have to only allow company personnel to access the data that they are authorized to work with and keep them out of unauthorized areas while at the same time not driving people up the wall with arcane security rules. Dealing with in-house security is actually more difficult than dealing with the stereotypical hacker working in another continent.
When a clerk calls up and says her terminal is non-responsive you have to troubleshoot the problem as to where the problem is in the network, testing equipment that you have never seen and you may not even know what state it is located in. You have to get it right because, aside from the time wasted, there is nothing madder than a repairman who drove fifty miles to fix a piece of equipment that you told him was broken and there is nothing wrong with the equipment. Or perhaps it is a software problem in the mainframe in which case you need to call in the maintenance programmer. Or maybe the clerk forgot to throw the correct switch. Dealing with a complaining user is a whole skill set in itself.
The list could go on and on but my point is that the fact that programs written by sysadmins are not as professional as programs written by programmers is irrelevant.
Yes, in general the quality of the code written by sysadmins is of much lower quality than the code written by programmers. But you are missing the point made by wpeckham that programming is only a minor part of a sysadmins responsibilities. There is backup and recovery. When (not if) a disk drive fails is there backup available, how long does it take to switch to the backup, and how disruptive is the switch? All of that has to be figured out before the disk drive breaks. And if a problem arises during the restore then you need some quick and dirty software ASAP.
When a clerk calls up and says he forgot his password is this really a company employee or a hacker doing some social engineering? Security is a whole area to itself where you have to only allow company personnel to access the data that they are authorized to work with and keep them out of unauthorized areas while at the same time not driving people up the wall with arcane security rules. Dealing with in-house security is actually more difficult than dealing with the stereotypical hacker working in another continent.
When a clerk calls up and says her terminal is non-responsive you have to troubleshoot the problem as to where the problem is in the network, testing equipment that you have never seen and you may not even know what state it is located in. You have to get it right because, aside from the time wasted, there is nothing madder than a repairman who drove fifty miles to fix a piece of equipment that you told him was broken and there is nothing wrong with the equipment. Or perhaps it is a software problem in the mainframe in which case you need to call in the maintenance programmer. Or maybe the clerk forgot to throw the correct switch. Dealing with a complaining user is a whole skill set in itself.
The list could go on and on but my point is that the fact that programs written by sysadmins are not as professional as programs written by programmers is irrelevant.
Not disagreeing with a thing you said, but pointing out that many SYSADMINS started in programming, branched into network admin, DBA work, program analysis, system analysis, and BECAME system admins. When I started out, NO ONE trained to become a sysadmin, they were promoted into the title so the company could justify giving them a raise within a ridiculously rigid system.
Yes, in general the quality of the code written by sysadmins is of much lower quality than the code written by programmers. But you are missing the point made by wpeckham that programming is only a minor part of a sysadmins responsibilities.
Well, my main reason for this thread was simply to ask those that are familiar with modern programming standards AND familiar with modern system administration, whether or not my observations that system administration is performed with a completely different set of expectations and qualifiers.
I think I've got my answer: system admins rarely ever get the time to implement a solution in the same way a programmer is expected to due to time constraints.
I'm not really sure what that pct exec 103 -- stuff is — I've never seen that before — but part of the issue here is that linux doesn't make it easy to query this specific information (ip address of an interface).
Some programs are designed with scripted use in mind, and some programs are designed to output human readable text. The first example uses 'ip' and then grep/awk/cut to extract the wanted data from the human readable text. The second example gets creative and uses the arp table to obtain the same information from a different source in what they believe is a more succinct manner. It's not really what the arp table was intended for and it's a bit of a hack, but kudos for the creative thinking.
That said, well designed utilities will have options to aid in scripted use, and if they'd looked at the man-page a little harder they'd have seen that the 'ip' command is one of them, having the -o, and -j options.
Using the -o option might look like this
Code:
$ read id dev family addr rest < <( ip -o -f inet a l dev eno1 )
$ echo ${addr%/*}
192.168.0.201
$
No grep, no awk, no cut, though the ${addr/*} is required to remove the /24 netmask suffix from the address output by 'ip a l' should that need to be done.
I suppose the -j (json) approach would be considered the more modern thing to do, but it does require an additional parser program to be installed on the system.
Here's the json version of the query:
Code:
$ ip -j -f inet a l dev eno1 |jq -r .[].addr_info[].local
192.168.0.201
Moving away from the specific examples in the meme, to the more general topic raised...
There's an old quote that I always liked which I believe might be relevant here. I can't remember where I saw it, or who it's attributed to, and it's likely not exact, but to the best of my recollection it goes something like this:
Quote:
An experienced UNIX programmer can quickly knock up a 1000 line program to do pretty much anything they need. However, someone who truly knows UNIX will understand that they do not need to.
The basic idea behind it being that combining well designed simple utilities within pipelines can achieve an awful lot, avoiding the need to write that 1000 line program.
I can't really offer much insight on modern systems admin vs modern programming, I'm pretty much old-school in both regards: In my time, I've worked as Operator, Ops Analyst, System Programmer on mainframes, and system admin/3rd line support on AIX Systems and some minicomputer and other sundry Info Systems stuff.
Best not to generalise too much though. In my experience, much like programmers, not all system admins are created equal!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.