[Solved] Setup Nmon on Suse Enterprise 11

Ok, so my previous query has had more views than response (yeah, thanks alot for that)

I am trying to figure out how to run nmon on suse linux but the script I had googled only works on AIX.

I stored the binary file on (I had downloaded it directly from Nigel's website)

my-xftp0:/var/log # ls -lrt /usr/local/bin
total 8
-rwxrwxr-x 1 root root 354 Nov 17 17:21 nmon

And the logs are meant to go to a separate dir in /tmp (not the best place to store it, I know but I just want to test it!)

Nmon should run daily for a month...I could use some serious help here. Damn google keeps coming up with AIX scripts

Of course. Most people will read your question, but not everyone might be able to help you with that. No need to get snarky about that, especially in a forum run by volunteers

Why? Does the script require special tools only found on AIX? Any hard evidence that it's only runable on AIX, and no amount of adapting would make it run on Linux? Have you tried adapting it?

Hi pludi

Sorry about that, was kind of stressed out yesterday. Now lets see, script I was working on is this :

print "'date +%H:%M' -Performance Monitoring Report" > /dev/console
APPLDIR=/usr/local/bin/
 LOGDIR=/tmp/nmon-reports/
ls $LOGDIR | grep -v "nmon.Z" | grep -v "lost+found" | while read LINE;
do
compress -F $LOGDIR/$LINE
done
find $LOGDIR -name 'hostname'.'date +%d'.nmon.Z -exec rm {} \;
$APPLDIR/nmon -F $LOGDIR/'hostname'.'date +%d'.nmon -t -s $1 -c $2

but the error messages I get when i run this script are "print in line 1 and compress in line 6 are not found" but I know compress works because I just compressed a file this morning

I'm not very good at scripting so I guess I'll have to start afresh and set a cronjob for this :frowning:

---------- Post updated at 11:53 PM ---------- Previous update was at 05:54 PM ----------

Ok, so this is what I did

I added a crontab entry which reads:

my-xftp0:/tmp/nmon_reports # crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXrwrPNq installed on Fri Nov 18 14:42:49 2011)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
0 0 * 11 * /usr/local/bin/nmon -fr "Performance Report:myxftp0" -s 300 -c 288 -m /tmp/nmon_reports
my-xftp0:/tmp/nmon_reports # date
Fri Nov 18 15:51:35 MYT 2011

my-xftp0:/tmp/nmon_reports # ll
total 132
-rw-r--r-- 1 root root 37231 Nov 18 14:37 my-xftp0_111118_1432.nmon
-rw-r--r-- 1 root root 36581 Nov 18 14:40 my-xftp0_111118_1440.nmon
-rw-r--r-- 1 root root 49898 Nov 18 15:48 my-xftp0_111118_1443.nmon
my-xftp0:/tmp/nmon_reports # date
Fri Nov 18 15:53:14 MYT 2011

this basically gathers all the basic info I need with the default values and then i use nmon analyzer to transform all that into human readable xls sheet:

..lol i pretty much answered my own questions...

1 Like

print really can't be found on most Linux machines. An alternative would be rewriting that line to use man printf (Linux) or echo . Same with compress , the replacement would be man gzip (Linux) or man bzip2 (Linux).

And that you managed to answer your own question is great!

1 Like

Hi pludi

You can close this thread now, thanks for the advise, I might implement the script in future to purge the files at the end of every month. For now, the cron is running alright and I have my daily reports generated fine:

my-xftp0:/tmp/nmon_reports # ls -lrt
total 1184
-rw-r--r-- 1 root root  36581 Nov 18 14:40 my-xftp0_111118_1440.nmon
-rw-r--r-- 1 root root 329412 Nov 19 14:38 my-xftp0_111118_1443.nmon
-rw-r--r-- 1 root root 329305 Nov 19 23:55 my-xftp0_111119_0000.nmon
-rw-r--r-- 1 root root 329466 Nov 20 23:55 my-xftp0_111120_0000.nmon
-rw-r--r-- 1 root root 163004 Nov 21 10:20 my-xftp0_111121_0000.nmon
my-xftp0:/tmp/nmon_reports # date
Mon Nov 21 10:30:32 MYT 2011