I'm back in the saddle again with a new blog platform and a new server. I had to re-create them, so it only made sense to combine everything and move to a single smaller package. I chose Ghost, and it does the one thing - allow me to write, which is really all I will be using these for in the first place.
the work code
I can't name the actual code I am working on, or there would be hints to my employer, and I am very careful to keep them out of my personal/public/Internet life. Not fair to them and not cool for me. Not that there is anything wrong with them, I work for an awesome company, but I signed some papers, and I have promised to behave (and I do, for the most part, until some Chinese spammers make me a tad miffed).
This piece of code will only work on their systems and with their processes, but the general plan is to make a public consumption version of this code that will help give administrators a snapshot of their system in the event that they are having issues and need to sort them out. I might simply make that a public package as well in Casgliad (the current public offering). I would not mind having a tool that would tell me what the heck I am missing in my logs as well as the suggested ways to fix them.
Here's the reality... I can spend 45 minutes to an hour pulling different types of information together blindly from particular customers. Without giving too much away on it, I am dealing with multiple versions of binaries and offered platforms, and when I receive an issue, I don't know a vast array of parameters that I have to ascertain before I can even begin to troubleshoot the active issue that is the whole point of the excursion.
At this point, it makes sense to at least attempt to automate that so I am an hour ahead of the game in the first five minutes. This scripting will do that.
for the public good
So today, instead of starting out with the work stuff, I began my work on Casgliad, and the Casglu script specifically. It is primarily a collector of data, so I started there, which was not a easy as I thought it might be. I walked right into a dating problem. I wanted to put the date into the title, and that was not happening the way I had envisioned. After a little thought I realised that I don't really need that in the header, nor do I have to have it in the actual logfile name.
That is much more proficient as a later function, ie. file rotation. As it stands now, I am able to see it in the actual generated logfile, so I really don't have the complaint I thought I did.
In today's session, I was able to get the following things done in the script, and yes, believe it or not there were battles:
- create a log file
- grab the uname info
- lop the head off of top and deliver it
- grab iostat, vmstat, and sar on memory and CPU
- it grabs the nmcli stats from 5 commands and outputs them
Tomorrow I might work a little more on things like free and ip commands, because I want to flesh these all out more where the information is all there, but it is categorised and not painful to read. All of the commands are there, it is simply a matter of learning them all and integrating them.
Duck Duck Go is your friend. It is much better for coding, unlike Google which is really more of a comsumer thing. With DDG it will pretty print the best command block on the right hand side and gives you an edge on things that you wouldn't normally have otherwise.
I heartily suggest it to anyone that needs to search coding and tchnical related things on a borderline excessive basis.
That's probably a good use of a first day. I'm going to bank my extra time before I have to go to my real job.