Sponsored Content
Top Forums Shell Programming and Scripting Using kSar for short sar reports , failed to parse Post 303001606 by umen on Tuesday 8th of August 2017 02:58:23 AM
Old 08-08-2017
no still can't see any thing
this is the out put :
Code:
Linux 4.4xxxxxxxx.x86_64 (ip-10-0-1-248) 	08/08/2017 	_x86_64_	(4 CPU)

06:46:23 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
06:46:25 AM     all     40.05      0.00     17.52      0.00      0.00     42.43
06:46:25 AM       0     34.00      0.00     66.00      0.00      0.00      0.00
06:46:25 AM       1     16.08      0.00      0.00      0.00      0.00     83.92
06:46:25 AM       2     13.07      0.00      0.50      0.00      0.00     86.43
06:46:25 AM       3     96.48      0.00      3.52      0.00      0.00      0.00

06:46:25 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
06:46:27 AM     all     46.17      0.00     16.94      0.00      0.00     36.89
06:46:27 AM       0     37.19      0.00     62.81      0.00      0.00      0.00
06:46:27 AM       1     33.00      0.00      0.00      0.00      0.00     67.00
06:46:27 AM       2     19.50      0.00      0.00      0.00      0.00     80.50
06:46:27 AM       3     95.50      0.00      4.50      0.00      0.00      0.00

06:46:27 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
06:46:29 AM     all     47.19      0.00     18.23      0.00      0.00     34.58
06:46:29 AM       0     30.85      0.00     68.66      0.00      0.00      0.50
06:46:29 AM       1     27.14      0.00      0.00      0.00      0.00     72.86
06:46:29 AM       2     34.83      0.00      0.50      0.00      0.00     64.68
06:46:29 AM       3     96.00      0.00      3.50      0.00      0.00      0.50

06:46:29 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
06:46:31 AM     all     82.37      0.00     15.87      0.00      0.00      1.76
06:46:31 AM       0     87.44      0.00     11.06      0.00      0.00      1.51
06:46:31 AM       1     50.50      0.00     49.00      0.00      0.00      0.50
06:46:31 AM       2     96.00      0.00      0.00      0.00      0.50      3.50
06:46:31 AM       3     95.43      0.00      2.54      0.00      0.00      2.03

06:46:31 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
06:46:33 AM     all     41.38      0.00     17.50      0.00      0.00     41.12
06:46:33 AM       0     16.50      0.00      0.50      0.00      0.00     83.00
06:46:33 AM       1     33.00      0.00     67.00      0.00      0.00      0.00
06:46:33 AM       2     22.00      0.00      0.50      0.00      0.00     77.50
06:46:33 AM       3     93.50      0.00      3.00      0.00      0.00      3.50


And the kSar doesn't show any think but it do load the text file
 

2 More Discussions You Might Find Interesting

1. AIX

SFTP Failed---Request for subsystem 'sftp' failed on channel 0

Hi, While I am trying SFTP my machine to another unix machine , it was working fine till 10 min back. But now i am getting the below error "Request for subsystem 'sftp' failed on channel 0" Could you please someone help me to solve or analyise the root cause... Cheers:b:, Mahiban (0 Replies)
Discussion started by: mahiban
0 Replies

2. Shell Programming and Scripting

help with a script to have monthly sar reports

Hi I am still learning shell scripting, so for complex stuff, I need help. I would like to have a script that produces sar monthly reports, so that I can produce a graph from it! The idea is to use /var/adm/sa/<dir of sa files>Looking to hear from you. regards (4 Replies)
Discussion started by: fretagi
4 Replies
sg_get_cpu_stats(3)					     Library Functions Manual					       sg_get_cpu_stats(3)

NAME
sg_get_cpu_stats, sg_get_cpu_stats_diff, sg_get_cpu_percents - get cpu usage SYNOPSIS
#include <statgrab.h> sg_cpu_percents *sg_get_cpu_percents(void); sg_cpu_stats *sg_get_cpu_stats(void); sg_cpu_stats *sg_get_cpu_stats_diff(void); DESCRIPTION
sg_get_cpu_stats() and sg_get_cpu_stats_diff() both return static pointers of type sg_cpu_stats. sg_get_cpu_stats() returns the total amount of "ticks" the operating system has spent in each of the different states. sg_get_cpu_stats_diff() returns the difference in "ticks" for each of the states since last time sg_get_cpu_stats_diff() or sg_get_cpu_stats() was called. If it has never been called, it will return the result of sg_get_cpu_stats(). The value stored (the "ticks") will vary between operating systems. For example Solaris has a total of 100 per second, while Linux has sub- stantially more. Also, different operating systems store different information - you won't find nice cpu on Solaris for example. Because of this, you will ideally always want to work on a scale against the total, or in percentages. sg_get_cpu_percents() returns a pointer to a static sg_cpu_percents. The function calls sg_get_cpu_stats_diff() and changes the values into percentages. If it has never been called before (and nor has sg_get_cpu_stats() or sg_get_cpu_stats_diff()), the returned percentages will be the systems total ever since its uptime. (Unless the counters have cycled) RETURN VALUES
There are two structures returned by the CPU statistics functions. typedef struct{ long long user; long long kernel; long long idle; long long iowait; long long swap; long long nice; long long total; time_t systime; }sg_cpu_stats; typedef struct{ float user; float kernel; float idle; float iowait; float swap; float nice; time_t time_taken; }sg_cpu_percents; user kernel idle iowait swap nice The different CPU states. systime time_taken The time taken in seconds since the last call of the function, or the system time. SEE ALSO
statgrab(3) WEBSITE
http://www.i-scream.org/libstatgrab/ i-scream $Date: 2005/04/25 11:25:45 $ sg_get_cpu_stats(3)
All times are GMT -4. The time now is 12:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy