Sponsored Content
Operating Systems Solaris Monitoring the output of 'top' command on hourly basis. Post 302345535 by subharai on Wednesday 19th of August 2009 01:36:31 PM
Old 08-19-2009
Monitoring the output of 'top' command on hourly basis.

I need to capture the following data on an hourly basis through cronjob scheduling:-

1. load averages
2. Total no. of processes.
3. CPU state
4. Memory
5. Top 3 process details.

All the above information is available through the command 'top'. But here we need to automate the same and save it in a log file for the purpose of monitoring the server performance.

Please find the below data which exactly I need to capture:-

Code:
 
load averages:  0.30,  0.29,  0.24                                          
90 processes:  88 sleeping, 2 on cpu
CPU states: 97.7% idle,  1.7% user,  0.6% kernel,  0.0% iowait,  0.0% swap
Memory: 16G real, 11G free, 3333M swap in use, 13G swap free
   PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
 29490 oms1      47   0   12  172M  140M cpu/0   55:40  0.75% java
  2436 sroy       1  59    0 7208K 6088K cpu/8    0:54  0.52% top
  2482 avijay     1  32    0 7080K 5960K sleep    0:01  0.26% top

Request you to please provide some idea or any automation script how the above activity can be performed.

Thank you all in advance.

---------- Post updated at 11:06 PM ---------- Previous update was at 10:54 PM ----------

Sorry for not mentioning, the requirement is for Solaris 10 environment.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grabbing value from command output and monitoring for changes

Hi all, Very new to shell scripting so appreciate some help! There is a process count that I need to monitor, I have the AIX command that gives this value and I've cleaned it up with grep/awk so it only spits out the value I'm interested in: echo "psc -i 10050 -s RELOAD_SERVICE" | tmadmin... (14 Replies)
Discussion started by: monty77
14 Replies

2. Shell Programming and Scripting

how to grep string from hourly basis files

dear all, pls help on this script.. i have many files which will be created every mins in particular directory. i want to grep a particular string from only for unique hour files. from the below code i want to grep a string from only 9th hour files . Ex files: -rw-r--r-- 1 root ... (5 Replies)
Discussion started by: steve2216
5 Replies

3. HP-UX

Sorting top command output in HP_UX 11.11

Hello all, I've been woking on Solaris and Linux (Red Hat) so far but now I've inherited an HP-UX system and having minor issues with syntax...Appreciate if you could help me out here.. 1) I'm trying to sort the output of the top command in HP-UX 11.11 by pressing O (capital O) after typing... (2 Replies)
Discussion started by: luft
2 Replies

4. Shell Programming and Scripting

FTP a file on Hourly basis

Hi, I have to upload a file test_201105281100.txt to a ftp location. The files will be created on hourly basis like test_201105281100.txt, test_201105281200.txt & so on. After a file is uploaded successfully, I need to rename the file as test_201105281100.success & if it is not uploaded... (11 Replies)
Discussion started by: SunilB2011
11 Replies

5. Shell Programming and Scripting

Capturing first output from 'top'-likes command

Is this a stupid code?? top > top.out & sleep 2 kill %1 cat top.out Thanks, (6 Replies)
Discussion started by: Shawn, Lee
6 Replies

6. UNIX for Advanced & Expert Users

Conflicts in the output of TOP command

Hi All, In the output of TOP command in my unix system, i monitored that some process has utilization more than 100% even some process has 4000% utilisation. Please help me understand how it is possible to show more than 100% utilization. Please see the screenshot below:... (2 Replies)
Discussion started by: anand2308
2 Replies

7. Shell Programming and Scripting

Crontab on hourly basis

Hi.. I need to run the script on hourly basis. How do I write the crontab on hourly basis i.e, 9:00, 10:00.....22:00.. 23:00 hours Please let me know if the below is correct one for crontab on hourly basis. 00 * * * * ksh myscript.ksh > /dev/null Regards, John (3 Replies)
Discussion started by: scriptscript
3 Replies

8. Shell Programming and Scripting

Calculate avg response time on hourly basis

Hi, I am trying to calculate avg response time on hourly basis from the log file which has millions of records. As of now I am trying with creating temp file which will have lines with unique id and start time and end time and after that another script will run on this temp file to... (7 Replies)
Discussion started by: random_thoughts
7 Replies

9. UNIX for Dummies Questions & Answers

Top Command Output is not coming via Cronjob

Dear All, I created a small script to get the CPU, GIS usage etc automatically. However when i run this script manually its working , but when i run through cronjob i am not getting any output. Can anyone please help me on this. I am using SuseLinux. Thank you in advance. #!/bin/sh {... (2 Replies)
Discussion started by: Nitin Kapoor
2 Replies
UPTIME(1)							   User Commands							 UPTIME(1)

NAME
uptime - Tell how long the system has been running. SYNOPSIS
uptime [options] DESCRIPTION
uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. This is the same information contained in the header line displayed by w(1). System load averages is the average number of processes that are either in a runnable or uninterruptable state. A process in a runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for disk. The averages are taken over the three time intervals. Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time. OPTIONS
-p, --pretty show uptime in pretty format -h, --help display this help text -s, --since system up since, in yyyy-mm-dd MM:HH:SS format -V, --version display version information and exit FILES
/var/run/utmp information about who is currently logged on /proc process information AUTHORS
uptime was written by Larry Greenfield <greenfie@gauss.rutgers.edu> and Michael K. Johnson <johnsonm@sunsite.unc.edu> SEE ALSO
ps(1), top(1), utmp(5), w(1) REPORTING BUGS
Please send bug reports to <procps@freelists.org> procps-ng December 2012 UPTIME(1)
All times are GMT -4. The time now is 03:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy