CPU monitoring query


 
Thread Tools Search this Thread
Operating Systems AIX CPU monitoring query
# 1  
Old 06-08-2012
CPU monitoring query

Hi all,
I am a DBA , I want to take the output of topas command result in every 1minute to write on the output file. If I redirected the file it attached with some control M characters. Nmon and sar commands are not working. only topas working in my AIX environment.
Please suggest me on this.

Thanks in advance.

Regards,
Kumar
# 2  
Old 06-08-2012
# 3  
Old 06-09-2012
First off, i don't think that topas is a good tool for non-interactive use. My suggestion is to define what you want to know exactly and then achieve this with a collection of tools better suited to batch use, such as vmstat, iostat, ps -Alo vsz,cmd and similar.

In fact the information you want to get are being published by the OS to some interfaces, from which "topas" takes them and presents them to you - like the other mentioned tools too. So "topas" doesn't tell you more than any other tool, just in a different form. One, which is best suited for interactive use and this is not what you have in mind.

So tell us what you want to know and we surely can provide you with a way to get this.

You can of course - if you insist to do so - try to "massage out" all the control characters from the topas-output. This can probably be done by a series of sed-statements, like the following, which would remove the "^M"-characters. Here is how to find and remove these characters.

First, open the raw topas-output in "vi" and press <CTRL>-<i> to display all the non-printing, control-characters in unambiguous form. If you go with the cursor over a "^M" you will notice that it is in fact one character. It is the <CTRL>-<m> key kombination (or <ENTER>, which is in fact the same).

Notice, that you can enter such combinations into "vi" by pressing <CTRL>-<v> in insert mode and then pressing the combination in question.

Now exit the raw file and prepare a small script. Enter the control characters the way i explained above:

Code:
#!/bin/ksh

sed 's/^M//g' /path/to/raw-topas-output > /path/to/output

exit 0

Save this to a file, make it executable and run it. Then look at the output file to find out if this is what you want. Probably there are other control-sequences which you want to remove too (again, <CTRL>-<i> in vi will tell you), say i.e. "^[" (<CTRL>-<ESC>). You will want to extend your script by replacing

Code:
sed 's/^M//g' /path/to/raw-topas-output > /path/to/output

with

Code:
sed 's/^M//g; s/^[//g' /path/to/raw-topas-output > /path/to/output


Again, look at the output and find out if the bothering control characters are gone or if you have to extend your script with yet another statement. Repeat this until you are satisfied, then use your script to process raw topas output into a readable form.

Again, i discourage such a method, because you will probably end with information still not well suited for analysis even if the control characters are out, but here you are.

I hope this helps.

bakunin

Last edited by bakunin; 06-09-2012 at 09:02 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Understanding & Monitoring CPU performance (Load vs SAR)

Hi all, Been reading a lot of the cpu load and its "analogy of it to car traffic path of expressway" From wiki Most UNIX systems count only processes in the running (on CPU) or runnable (waiting for CPU) states. However, Linux also includes processes in uninterruptible sleep states... (13 Replies)
Discussion started by: javanoob
13 Replies

2. Infrastructure Monitoring

freeBSD CPU monitoring using nagios

Hi all, I am not being able to monitor CPU of freeBSD machine from my CentOS server. I have used check_aix_cpu but always gives garbage value, seems wrong in scripting. i want to monitor CPU usage of my freeBSD machine from my centOS server. I am able to monitor many services of that machine... (0 Replies)
Discussion started by: gsuwal
0 Replies

3. Infrastructure Monitoring

Monitoring CPU Usage with SNMP

Can someone please tell me how to calculate the CPU usage from what one gets back from snmpwalk? I have searched and dug through the internet and apparently, no one has the answer to this? i can use snmpwalk to pull out relevant information about cpu. but i have no clue what values are to be... (1 Reply)
Discussion started by: SkySmart
1 Replies

4. UNIX for Advanced & Expert Users

Monitoring cpu usage of mysql processes/threads/queries without any tool

hi all, i want to monitor mysql processes/threads/queries with respect to cpu usage.how can i do it? show processlist is of no use as no information abt cpu usage is given. plz help (7 Replies)
Discussion started by: rohitmahambre
7 Replies

5. Programming

Solaris CPU/memory status monitoring (Shell script or c++)

i'm trying to find a way to monitor the CPU/Memory status of a solaris station using vmstat. I like to write a small script to periodically run vmstat and store the output. Can anyone show me how (preferrably in C++ if possible)? Thanks in advance. (6 Replies)
Discussion started by: shingpui
6 Replies

6. HP-UX

HPUX monitoring and alerting script per CPU

Hi Guys, Hopefully someone would be able to help me out. Basically I have an HPUX 11.11i system which is backed up by Data Protector 4.5. Every so often the vdba process hangs and chews up 100% of one of the systems CPU resources. As our monitoring tool can only monitor on a per system basis... (3 Replies)
Discussion started by: fulhamfcboy
3 Replies

7. UNIX for Dummies Questions & Answers

monitoring cpu and memory of the unix box

Hi all, Unix has the TOP and SAR command to monitor machine's performance. Can it be used in a script to alert if the cpu utilization is more than 80 or memory used is more than 90. Is SAR preferable than TOP? Please advise. (3 Replies)
Discussion started by: er_ashu
3 Replies

8. Solaris

monitoring cpu

I have a windows snmp server running prtg. I have a solaris 8 v440R server and only see the network statistics for the server. When I try to add a new service to watch for the CPU, I am not offered the results. There is the default sun.mib installed. SNMPDX is not running but mibiisa is. I... (1 Reply)
Discussion started by: csross
1 Replies

9. UNIX for Advanced & Expert Users

CPU monitoring script

I looking for a very basic, script that monitors the load on the cpu and writes it to a text file. Can anyone help please? (4 Replies)
Discussion started by: alpha_manic
4 Replies

10. UNIX for Advanced & Expert Users

Monitoring CPU usage on AIX 5.3 with SNMP

Hi I would like to monitor CPU usage ( %) , memory utilization and such on an AIX 5.3 with snmp. How would I do that ? :confused: If I do "snmpwalk -c public -v1 hosttomonitor" I get nothing about the CPU. I've done this on Linux ( not much trouble doing it on linux ) but I'm having a hard... (2 Replies)
Discussion started by: art
2 Replies
Login or Register to Ask a Question