Need help to get the parsed output of "iostat" command
Hi,
I have a requirement where parsed output from various linux commands like top, netstat, iostat, etc. will be the input for one javascript with the parsed output from these commands converted to JSON format
For "iostat" command, since there are two outputs - one w.r.t CPU utilization and another w.r.t device statistics, ex.:
and
My requirement here is to have a shell script or perl script which can awk the output for the above two usages of iostat command (i.e., for CPU and device statistics) but without any sampling interval taken into account (sampling interval will be done later by calling the code multiple time. For now, output displayed once is enough)
There should be two parsed outputs, one for CPU statistics and one for Device statistics both of which shall later be used as input data for conversion to JSON format (in node.js)
Can someone help me out here?
Last edited by Don Cragun; 05-31-2016 at 02:03 AM..
Reason: Add CODE and ICODE tags.
Hello all,
I have a weird issue when trying to substitute the slashes into backslashes.
If I execute this on the command-line (bash / ksh) I get the path correctly translated with backslashes instead of slashes.
> echo $PWD | sed 's/\//\\/g'
However, when I put this in my script to... (3 Replies)
Hi All,
I am running my application on a dual cpu debian linux 3.0 (2.4.19 kernel).
For my application:
<sar -U ALL>
CPU %user %nice %system %idle
...
10:58:04 0 153.10 0.00 38.76 0.00
10:58:04 1 3.88 0.00 4.26 ... (0 Replies)
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Hi all,
I am new to Linux/shell scripting having moderate knowledge.
In my script, I need to get execution time of a command (say 'ls') in mili seconds level. For this i tried using "time" command to retrieve the total execution time in milli seconds. But, the problem is that, how to save... (9 Replies)
Hi,
I am trying to get the system RAM size from "top" command's output by the following but it is not working.
top | sed "s/^Mem.**\(*\), *//" (10 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi, everyone.
I need to write a program to get io info based on libperfstat.
But the "write time" of a disk is just half of the value get from iostat.
I'm confused and can't explain. Help please.
How I calculate "write service time per sec":
In iostat:
write service... (0 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi,
I have to redirect output of the command "perldoc perllocal" to new file which
contains all the perl module installed.
Currently using
perldoc perllocal >> mod_data
This does not contain all perl modules installed locally on machine, and each character is doubled.
Please... (3 Replies)
Discussion started by: asak
3 Replies
LEARN ABOUT OSF1
dxdw
dxdw(8) System Manager's Manual dxdw(8)NAME
dxdw - Runs and repeats command line commands
SYNOPSIS
/usr/bin/X11/dxdw [-c initial_command]
OPTIONS
Specifies the command to run. The command string must be enclosed in double quotes if it contains any spaces or special characters inter-
preted by the shell.
Display Window accepts all of the standard X Toolkit command line options, which are documented in the OPTIONS section of the X(1X) refer-
ence page.
DESCRIPTION
The Display Window application, dxdw, can be used to run commands at specified time intervals.
You can use Display Window to: Run a command and display a transcript of the output Repeat a command at regular intervals Print the output
to the default printer Save the output to a file
You can use Display Window to run common commands without starting up a full xterm. The optional -c option specifies an initial command.
The Display Window application presents a transcript containing the current command, its output, and its command-line error messages. You
can change the command after the application starts. The transcript area is output-only, so you cannot use Display Window to run commands
that require user interaction on the command line.
The Display Window application can be invoked from the CDE Application Manager from the following categories:
Application Group: System_Admin
System Admin Subgroup: Daily Admin
When the Display Window main window invoked, the transcript is empty because there is no command running. Enter a command to run in the
Command input text field.
Because Display Window can be started with a default initial command, several launchpoints have been created in the Application Manager to
run specific command-line applications. These applications include I/O Statistics (iostat), Network Statistics (netstat), Virtual Memory
Statistics (vmstat), and Who? (who).
To start one of the preceding applications within Display Window from the CDE desktop: Click on the Application Manager icon on the CDE
front panel. Double click on the System_Admin application group icon. Double click on the Tools application group icon. Double click on
the icon for the command you want to run in the Display Window application.
The Display Window application invokes the command once. The output from the command is displayed in the transcript area.
You can also start Display Window from the command line. To start Display Window from the command line, enter the following:
/usr/bin/X11/dxdw [-c initial_command]
The -c option specifies the command string to run when Display Window is started. On the command line, the command string must be enclosed
in double quotes if it contains any spaces or special characters interpreted by the shell.
The command string can be any of the following: A single command A series of commands in a pipeline (|) A series of commands separated by
semicolons
After Display Window starts, a new command string can be entered in the Command input text field. In the graphical user interface, it is
not necessary to enclose the command string in double quotes.
To enter a new command string: Clear the Command input text field if a command is already present. Enter a new command string in the Com-
mand input text field. Press the Return key in the Command input text field to run the command.
EXAMPLES
The following example runs the iostat command one time in the Display Window application. You can use the Repeat Every dialog box to repeat
the command at regular intervals. dxdw -c iostat The following examples show how to use Display Window from the command line. dxdw -c df
dxdw -c "ps -aef" dxdw -c "ps -aef | grep dxdw" dxdw -c "mount; showmount" You can view the Display Window online help volume without run-
ning the application. To open the Display Window help volume from the command line, enter the following command: /usr/dt/bin/dthelpview -h
/usr/dt/appconfig/help/C/Dxdw.sdl
FILES
Contains the Display Window application executable Contains the Display Window help volume Contains the default values for the applica-
tion's X resources
SEE ALSO
Commands: iostat(1), netstat(1), vmstat(1), who(1), X(1X)dxdw(8)