Sponsored Content
Top Forums Shell Programming and Scripting Script to clean nmon logs on AIX Post 302232135 by dennis.jacob on Thursday 4th of September 2008 01:00:41 AM
Old 09-04-2008
Quote:
Originally Posted by outtacontrol
I use NMON (Nigels Monitoring) in AIX. It creates a daily nmon log with the naming conventions of:
hostname_YYMMDD_0000.nmon
or
myserver_080902_0000.nmon

What I am interested in doing is creating a script that is executed on the first of each month to clean up last months *nmon files. . .what I mean by clean up is that it would create a directory in the format of yyyymm and move all of last months files in that newly created directory.

The problem is that each hostname is of different lengths (since I would be using this on different hosts). . .so it's difficult to use the "cut" command because the length of characters will differ from box to box.

I would appreciate any assistance you can lend.

outta.


Give a try on this:

Code:
find dir -name "*$(date +%m%y -d "1 month ago")_0000.nmon" -mtime+1 -exec mv {} new_dir/  \;

And add it in the cron table to run on 1st of everymonth.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

clean up script

I have a script which would monitor a given directory and delete any files which are older than 10 days. I was going to set the 10 crob jobs to perform this operation for 10 different directories (some are actually sub-directories), but my boss doesn't like that idea, so I need to do that in one... (1 Reply)
Discussion started by: mpang_
1 Replies

2. AIX

location of logs on AIX 4.3 and 5.3

Hi All, I would like to know where's the location of ALL system error logs on AIX43 and AIX53. Thanks, itik (1 Reply)
Discussion started by: itik
1 Replies

3. AIX

nmon in aix

Hi, I want to know how to use nmon in aix? I have donwloaded nmon (2 Replies)
Discussion started by: manoj.solaris
2 Replies

4. AIX

Top command in AIX 4.2 (no topas, no nmon, no top)?

Is there a 'top' command equivalent in AIX 4.2 ? I already checked and I do not see the following ones anywhere: top nmon topas (1 Reply)
Discussion started by: Browser_ice
1 Replies

5. AIX

need help on NMON in AIX

HI, I have downloaded nmon 3.3c nmon analyzer, and run the command on aix ./nmon -f After that I have terminated the process and found .nmon file. when i have tried to open that file in nmon analyzer i.e in excel I am getting the error "no valid input data nmon run may have failed" ... (8 Replies)
Discussion started by: manoj.solaris
8 Replies

6. Shell Programming and Scripting

How to clean this script?

Hello guys, this script partially works but it's still pretty ugly and, moreover, if the month is jan/feb/mar... it doesn't work at all. Could anyone say me how to correct, cut and clean a little bit? #!/usr/bin/ksh egrep -v -e "^\s*#" /file/permission | awk '{ print $1 }' | sort | uniq... (3 Replies)
Discussion started by: gogol_bordello
3 Replies

7. AIX

aix and nmon

Hi All, First of all, I am a DBA and not an AIX admin. I am new at using this NMON tool. In interactive mode, I can start nmon, push 't' to have the list of process with their statistic (ie cpu% etc.). I would like to know if there is a way to redirect that screen output into a log... (1 Reply)
Discussion started by: Nayas
1 Replies

8. AIX

ORACLE Database running slow on AIX ( nmon / topas )

Hello, How can I know if ORACLE Database is running slow due to Memory or due to processing power ? I have only Oracle Database running on a P4 with 4GB RAM. Could anyone suggest any tools which can help me determine exactly if it is memory issue or processor issue. (43 Replies)
Discussion started by: filosophizer
43 Replies

9. AIX

Run nmon on other server through script

Hai All, Iam new to AIX unix. Im just tryin to automate my monitoring work and hence i have writen a basic script in which i am running nmon on multiple nodes from a main node. say for ex: From server a : ssh server b nmon -MB -s1 -c1 > nmon_now.txt gave the password and... (7 Replies)
Discussion started by: jayadeava
7 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
NMON(1) 							   User Commands							   NMON(1)

NAME
nmon - systems administrator, tuner, benchmark tool. DESCRIPTION
This manual page documents briefly the nmon command. This manual page was written for the Debian distribution because the original program does not have a manual page. nmon is is a systems administrator, tuner, benchmark tool. It can display the CPU, memory, network, disks (mini graphs or numbers), file systems, NFS, top processes, resources (Linux version & processors) and on Power micro-partition information. OPTIONS
nmon follow the usual GNU command line syntax, with long options starting with two dashes (`-'). nmon [-h] [-s <seconds>] [-c <count>] [-f -d <disks> -t -r <name>] [-x] A summary of options is included below. -h FULL help information Interactive-Mode: read startup banner and type: "h" once it is running For Data-Collect-Mode (-f) -f spreadsheet output format [note: default -s300 -c288] optional -s <seconds> between refreshing the screen [default 2] -c <number> of refreshes [default millions] -d <disks> to increase the number of disks [default 256] -t spreadsheet includes top processes -x capacity planning (15 min for 1 day = -fdt -s 900 -c 96) AUTHOR
nmon was written by Nigel Griffiths <nag@uk.ibm.com> This manual page was written by Giuseppe Iuculano <giuseppe@iuculano.it>, for the Debian project (but may be used by others). nmon August 2009 NMON(1)
All times are GMT -4. The time now is 03:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy