Monday, May 30, 2022
In Linux there's a great reporting tool that can look in the past for performance issues, it's an activity reporter call sar, it's an accounting tool which records the information on a cumulative and interval basis.
We can run sar to report on the CPU information with this command sar -u
Monday, May 23, 2022
In this post we are going to go over the steps to install the Ssysstat tool in Linux. Log in as root or su then run the command yum install -y sysstat, you might already have it installed so you might get this message
Now that we know sysstat is installed we can start the service with the command systemctl start sysstat then enable it with the command systemctl enable sysstat and finally we can check to see the that service is running by checking the status with this command systemctl status sysstat
Monday, May 16, 2022
vmstat is used to report virtual memory stats on your Linux system. It is helpful to see how much free memory you have left on your system.
As with top you can run the command by typing vmstat, it defaults to kilobytes
You can change the default measure unit by specifying the unit like this vmstat -S m, this will run the command in millibytes, we can see that we have 372 MB of memory free and 1 MB of buffer
You can also run vmstat in intervals by typing the following command vmstat 3 5, the command tells vmstat to run every 3 seconds for five times
Monday, May 9, 2022
The top command is an essential tool in any Linux administrator's toolbelt. Let's take a deeper look at the command.
First thing you can do is get the version of top we are using
If you just type top with no options you will get the following information, the information will update every 3 seconds by default. The top area is a summary of resources and CPU usage while the bottom portion are information about the processes. The information is sort by CPU utilization by default.
Press q to quit, you can also run the top command in batch mode by specifying how many times you want it to run by typing the command like this top -b -n1 the command uses the -b option for batch and -n for the number of iterations, in this case it's one
As you can see it only runs once and you get your prompt back, you use your mouse to scroll back up. You can also write the results to a file like this top -b -n1 > top-stats
Monday, May 2, 2022
So to use the for/in loop to iterate through the object let's use our product object again.
var product = new Object();product.name = "Chai";product.category = "Tea";product.country = "India";product.supplier = {name: "ACME Tea Of India",location: "New Delhi"};
Now type in the following to loop through the object with the for/in loop and outputs the property name and property value to the console