1z0-821 Oracle Solaris 11 System Administration – System Processes and Tasks Part 2
4. Troubleshoot Process Issues
Now that we’ve discussed how to list and manage processes, we probably want to talk about troubleshooting them now. Troubleshooting process Issues it may be necessary because processes, of course, like anything else in the system, can cause issues if certain things go wrong. You may see obvious things happen to your system, like system lockups, maybe some sluggishness responsiveness issues. You may see those things happen. You also may see processes occupying a lot more CPU time than they should, or taking up a lot more memory than they should.
So if you see those things, those obvious things, then it may be a process issue, and that’s probably where you should start troubleshooting. You may see things also that are not so obvious, and that may be processes running with a much higher priority than they should, such as real time. Real time is a setting that if a process runs at it, it is running super fast and taking up a lot of priority, memory and CPU time.
So usually you don’t want to do that with a process. So if you saw something like that happening, that would be an indicator. There’s an issue. Also, processes that may be owned by the same owner, multiple processes. And when we did our process list a few moments ago, in the last session, we saw how Root, for example, can own multiple processes. And that’s okay, you’ll see that.
But if you see multiple instances of the same process being owned by the same username, that may mean that the process has got away from itself, that it’s creating multiple instances of itself without shutting the other instances down. And so it’s like multiplying itself over and over, and with each instance it’s taking up memory and CPU time. So if you see that happening, you may want to look at stopping those processes.
So how do you troubleshoot processes? There’s different tools we can use, and some of them we already talked about, and you would use these tools to troubleshoot these issues. First, you’d look at the process information using things like PS, Pgrap, PRS, and so forth. You also might use the Slash Proc commands to get detailed information on the processes, and I’ll show you those in a moment. You can also use the Nice command to change the process priority.
If it’s running a high priority, you can drop it to a lower priority if you like, or change it to a higher priority. And finally, if the process doesn’t behave itself and it’s just something bad is happening, you can kill the process if you need to with the Pkill or the Kill Nine command and so forth. So let’s take a look at just a few of these commands and see what they can do for us in terms of troubleshooting process issues. Let’s first look at the PGRP command. We tried to get that one to work earlier and it just didn’t want to, and really is because you need to type it with the name itself that you’re looking for, not the Pit, as I did earlier. Just goes to show that when all else fails, you should use the man or the help commands to look at what really runs the command. So pig reps a fairly new command, by the way.
In our earlier example, we looked at send mail. So if we used send mail in this example, it would actually give us the PIDS. And PIDS are easier to work with than what most of the process commands want to see, versus send mail or Gnome Terminal or whatever. Because there could be several instances of each of these processes going on and we need to pick the right one. So that’s why we look at the PIDS more than anything. So with the PIDS here, I mean, we can look at several things about send mail, we can look at the PRGS and 1768 here, we’ll take a look at it and we get the arguments. And we looked at that earlier, some of these can be configured on different processes and we may find that reconfiguring a process, of course, that’s a little bit of an advanced topic beyond the scope of this course, but reprogramming some of those options, some of those arguments, may help run a process better. We can also use things like the Proc Commands. And Proc is a file system that’s created on the fly.
It’s a virtual file system that’s created when the system boots and it changes every time the system boots. We can use what’s called the Proc Commands to look at different aspects of a process. For example, we can look at Ptree, that’s one of the Proc Commands and look at 1768. And the process tree is what it is and it basically tells us what program or command or application spawned that particular process. So we can go back and we may need to tweak the offending program if necessary. So in this case, Ptree shows us what spawned that particular process. Let’s say we can’t get a process to behave at all. We may have to use the Kill command. And there’s different options with Kill. And typically you can just kill and give it the Pit and it will kill the Pit, it will end the process. Some processes, if they get locked up or if they’re just high priority processes that are taking up a lot of memory and CPU time, don’t want to kill easily, they don’t want to kill gracefully.
So you have to use what’s known as a hard kill and that’s a kill nine. And let’s say that send mail was misbehaving badly, although it typically does not send mail. Fairly benign process. Let’s say that for a moment that it was, we would say kill nine and we could do the PID and it would kill it. So now if we did a PS EF and gripped that, unless the process has respond itself that should go away. And it may have responded, since we see another PID there, but we killed the 1768 PID. So at minimum, we at least stopped it and restarted it. And sometimes that can help free up a process from using too much CPU or memory time, or it can, you know, it can stop a locked process. So sometimes that will help. Some processes will restart another instance of themselves, some will not. Someone will just kill themselves, and that’s it. And you have to go back and restart them after using the kill command. So there’s a few things you can do to troubleshoot processes, just a very few things. And there’s plenty more commands out there, plenty more proc commands and so forth, that you can get information about processes with and commands that you can use to troubleshoot processes with.
5. Schedule Sys Admin Tasks
We’ve seen several assistant administration types of tasks that we’ve performed throughout the course. And some of these are probably routine tasks that we may perform on a nightly, daily, weekly, even monthly basis. And since there may be repetitive tasks involved, it would be nice if we could find a way to have some of these tasks do themselves automatically while using scheduling. We can do that. And there’s two commands that we can use to schedule tasks, and that’s the Cron tab and at commands, which have been around in traditional Unix Linux for quite a while. Now, when we talk about tasks, we’re talking about jobs, that’s another word for them. And really we’re talking about commands and scripts, things that we could run on the command line or scripts that we could have execute. And so we can schedule these commands and scripts to run at various times.
Now, in addition to these two commands, there’s also some system files that we manage and those are the Cron Deny Cron allowing At Deny files. We’ll talk about those a little bit in a moment. Let’s look at at first. Now at schedules basically a single system task or single command or script. And actually it can be a set of commands, but it’s considered one job. Now at stores. These jobs in the VAR spool cron at jobs directory. Now it can be a single job or it can be a script or several commands, and we can specify the time and or date and the commands or scripts we want run. Now, there’s an example of the syntax there at the bottom of the slide, but we’re going to run this command for you in a moment so you can see what it looks like. Now there is a file called the at deny file that if you want people to not be able to use the at command, you simply put their usernames in that file and that’s an explicit deny. Implicitly, anyone who is not in that file is allowed to run the at command. Now, this is a little bit different with the Chronab command.
Crontab actually schedules multiple system tasks at regular intervals, different times and so forth, and they can be repetitive. So instead of only doing it one time, firing and forgetting the way at does, crontab is more flexible, actually can go more in depth and schedule more commands at various times. Now, the Cron tab stores its jobs in the Varspool Cron chron tabs file, and we’ll look at those in a moment as well. Now, the thing about Crontab is, while you have a Cron deny file by default, and anyone who’s in that file is prohibited from running Cron tab, you can also have a Cron allow so that you can explicitly allow people to run Cron jobs. So it’s a little bit different from at. So Cron tab is actually a lot more restrictive than at is. Let’s go ahead and take a look at both commands. We’re at our command shell in solaris eleven and I’ve already opened the Etsycron D directory so you can see what’s inside of it. And by default we have an at deny and a Cron deny file in there. So those files allow us to exclusively and explicitly deny access to at and Cron if the user name is a simple text file. Now let’s go ahead and look at the at command a bit.
We can run at and schedule a job for say, 10:00 A. m. . So we can put that in there and it gives us the at prompt here. And I’m just going to put in a few simple commands, things that really don’t do much. Going to make it switch to my home directory and then print the working directory and then run an LS Al command. Very simple commands. And we could actually do a lot more with this. We could have it delete temporary files, do some house cleaning, perform a lot of other actions, pretty much any action we’re allowed to perform with our username. So let’s go ahead and quit by pressing control D, and it tells us that those commands will be run at 10:00 A. m. The next day. So let’s go ahead and run at l and it will list the queue. It will list jobs in the queue. We have three jobs in there currently, and you can see the user who created them, the job number itself, which is always suffix by A and when it’s going to run. You can also run an at queue to see what’s in the queue, and an At R removes a job. The next thing we’ll take a look at is the Cron tab.
Now, Cron tab basically creates a file using VI that can be very complex and can actually be very lengthy and very complicated to set up. So we’re not going to set up one, but I’m going to show you one that’s already in the Chrontab directory. So if you wanted to create a Cron tab, typically it’s by username and it would be a Cron tab e and then the user name and it would let you edit your file. The default location for Cron tabs is in the Varspool tabs directory. So let’s go ahead and move there. Let’s do an LS and we see that there are several Cron tabs in there and let’s go ahead and just take a look at one.
We can cat them because they’re simple text files. And we see that these are basically skeleton files that can be used by various users. You can include commands and so forth in these and they can run on a routine basis. So that’s what a Cron tab could do for you. You can see that it’s a little bit complex and could be difficult to create unless you know what you’re doing. By and large, if you are a beginner, at is the way to go. But chronab is much more flexible and more robust. It can do a lot for you if you’ve can take the time to get to know it well. So that’s at and cron tab. It shows you how to schedule tasks and jobs.
6. Monitoring Performance
While not specific part of the OCA objectives, monitoring performance is actually very important in that knowledge of performance monitoring may help you answer other questions on the exam. So it’s kind of implicit that you know a little bit about it even though it’s not explicitly called out. Now, performance monitoring is very important for the system health because you can use it to identify trends over time, good and bad, that may indicate hardware failures or software issues, logical issues such as memory usage, CPU usage and so forth by applications and processes. Now, some of the major factors that we look at that affect performance include things like CPU usage, memory disk usage, and I O devices. Memory usage, for example, could express itself in a number of ways. You could have a slow system, you could have processes that simply are struggling or applications that don’t open fast enough. And performance monitoring can tell you whether you need more memory or you need a faster CPU or you need more disk space and so forth.
Now, there are several tools that Solaris Eleven has that you can use to monitor performance with and these are both GUI and Command Line Interface Utilities and we’ll talk about both of those. Now, two of the tools that we’ll look at are actually gooey ones and if you go into Application System tools, you’ll see them there. One is the Disk Usage Analyzer and the other is Performance monitor. Now, new folks to Solaris may find that these are actually very nice to look at and use, but to be honest with you, I’m not sure. Disk Usage Analyzer tells you a lot unless you actually dig down into it. You can scan your file system or a particular folder and get a lot of information out of it. I can tell you that this will take a while when you scan it and it will scan the entire hard drive and all the contents of all the file systems. So you probably only want to do this if you have a lot of time to spend.
But once it’s done, it will give you a really pretty picture. Over here it’s a rings chart or a tree chart about the different usage of the file system and it’s a somewhat limited value I think, but it can give you a pretty picture that kind of shows you visually how the file system is being used. Now, another application that you can use is the system under System Tools is the Performance Monitor. And basically it gives you a lot of information. And there are several tabs here. There’s a system tab that will give you information about the OS. We already know how to look that up under you name we can look at processes and I think I’ve showed you this a little bit earlier when we talked about processes. You can show the different process names, the status, the percentage, CPU time they’re taking up and that’s nice to know for performance, what their priority is with Nice, their process ID and how much memory they’re taking up.
So that’s very useful for monitoring performance. You can also look at resources such as your CPU usage, your memory and swap history and your network utilization. And this is very important because you can watch these in real time almost and you can determine if CPU usage is really high or memory and swap history is really high. And if they are, then you’ll know you’ll need to increase memory or increase your swap space size on the hard drive network usage. Obviously, if it’s very high, you may have an application that’s actually talking on the network too much or you may have to get another network card or a faster network card. File systems here can show you at a glance how much space is being taken up on the hard drive by particular file systems.
So this can help you determine whether you need additional hardware or you need to start cleaning up files somewhere. Let’s go ahead and get out of System Monitor, or Performance Monitor as it’s called when you first click on it. This users Analyzer has already completed its work. So as you can see, there’s a pretty little picture here and you can click on various pieces of the file system and see the pretty colors here. And again, I think this is of limited value. It can tell you a few things like the size of the file system, the particular file system and use. But I think it’s more of a visual aid than actually giving you useful data. So that tool may need some improvement later on in life as Solaris Eleven matures. So now let’s go to the command line and there’s a few tools we can look at. We can look at DF, which I think is more useful than the Disusage analyzer and it tells you a lot of the same information. It tells you the file system objects, how much space they’re taking up and so forth.
There’s different switches obviously you can use with DF. Then there’s Iosat, which can give you useful information about the input output of your system, especially your drives and how fast they’re working. You can also look at virtual memory by using Vmstat and its different switches. And then there are other commands out there, obviously SAR, which it’s of limited use sometimes they can give you some useful information on some other data as well. So there are some actually some good commands out here that that can help you monitor performance and get some good performance data. And there are some other tools out there too that we didn’t mention. Again, this is kind of an extra thing for the course so you don’t have to memorize or know any of this stuff, but it would help if you tried to understand it before you take the exam. It may help you out, understand some other stuff. So just a little extra thing we threw in there. So that’s performance monitoring in a very small nutshell.
Interesting posts
The Growing Demand for IT Certifications in the Fintech Industry
The fintech industry is experiencing an unprecedented boom, driven by the relentless pace of technological innovation and the increasing integration of financial services with digital platforms. As the lines between finance and technology blur, the need for highly skilled professionals who can navigate both worlds is greater than ever. One of the most effective ways… Read More »
CompTIA Security+ vs. CEH: Entry-Level Cybersecurity Certifications Compared
In today’s digital world, cybersecurity is no longer just a technical concern; it’s a critical business priority. With cyber threats evolving rapidly, organizations of all sizes are seeking skilled professionals to protect their digital assets. For those looking to break into the cybersecurity field, earning a certification is a great way to validate your skills… Read More »
The Evolving Role of ITIL: What’s New in ITIL 4 Managing Professional Transition Exam?
If you’ve been in the IT service management (ITSM) world for a while, you’ve probably heard of ITIL – the framework that’s been guiding IT professionals in delivering high-quality services for decades. The Information Technology Infrastructure Library (ITIL) has evolved significantly over the years, and its latest iteration, ITIL 4, marks a substantial shift in… Read More »
SASE and Zero Trust: How New Security Architectures are Shaping Cisco’s CyberOps Certification
As cybersecurity threats become increasingly sophisticated and pervasive, traditional security models are proving inadequate for today’s complex digital environments. To address these challenges, modern security frameworks such as SASE (Secure Access Service Edge) and Zero Trust are revolutionizing how organizations protect their networks and data. Recognizing the shift towards these advanced security architectures, Cisco has… Read More »
CompTIA’s CASP+ (CAS-004) Gets Tougher: What’s New in Advanced Security Practitioner Certification?
The cybersecurity landscape is constantly evolving, and with it, the certifications that validate the expertise of security professionals must adapt to address new challenges and technologies. CompTIA’s CASP+ (CompTIA Advanced Security Practitioner) certification has long been a hallmark of advanced knowledge in cybersecurity, distinguishing those who are capable of designing, implementing, and managing enterprise-level security… Read More »
Azure DevOps Engineer Expert Certification: What’s Changed in the New AZ-400 Exam Blueprint?
The cloud landscape is evolving at a breakneck pace, and with it, the certifications that validate an IT professional’s skills. One such certification is the Microsoft Certified: DevOps Engineer Expert, which is validated through the AZ-400 exam. This exam has undergone significant changes to reflect the latest trends, tools, and methodologies in the DevOps world.… Read More »