Topic
2 replies Latest Post - ‏2012-03-03T17:10:59Z by nagger
archeman
archeman
1 Post
ACCEPTED ANSWER

Pinned topic nmon run until told to stop

‏2012-02-11T00:20:27Z |
Is there a way to start nmon, then have it run (in file mode -f) collecting statistics at the indicated seconds until told to stop?
We have a data gathering scenario where we don't know beforhand how long we will need to collect stats, we only know how often to gather stats.
I was hoping to avoid having to gather the process id then kill the process.
Updated on 2012-03-03T17:10:59Z at 2012-03-03T17:10:59Z by nagger
  • Good2Cu
    Good2Cu
    2 Posts
    ACCEPTED ANSWER

    Re: nmon run until told to stop

    ‏2012-02-12T15:05:34Z  in response to archeman
    Have some concerns in terms of the goal you may achieve using what you have asked. Please consider following,

    -in case it is run for no of days in a single go , it would take significant amount of resource/time for nmon analyser to analyse your .nmon file and generating an .xls
    -the purpose of nmon is to do load analysis , in case it is run for an extended period you may miss the data of your interest
    -I know that nmon can collect data for number of days in a single go, but to analyse the data you have to rely MS Excel, which comes with a limitation in terms of number of lines in can process in a single worksheet.
    The standard practice is to generate either 2 files per day (production/non-production hours) or a single file for a day.
    You can schedule the nmon in your crontab to run it at the desired frequency.

    Following string can be inserted in crontab,

    ############################SINGLE FILE per day (sampling interval 60 seconds)####################
    00 00 * * * /usr/bin/topas_nmon -AdfPtV^ -s 60 -c 1440 (full day at a frequency of 60 seconds) #
    ##################################################################################################
    OR
    ######################TWO FILES per day (sampling interval 60 seconds)############################
    00 08 * * * /usr/bin/topas_nmon -AdfPtV^ -s 60 -c 720 ###########################################
    00 20 * * * /usr/bin/topas_nmon -AdfPtV^ -s 60 -c 720 ###########################################
    ##################################################################################################
  • nagger
    nagger
    1632 Posts
    ACCEPTED ANSWER

    Stopping nmon when you want

    ‏2012-03-03T17:10:59Z  in response to archeman
    Hi,
    If you include the -p option nmon will output the pid before dropping into the back ground and detaching from the ksh and terminal.

    You can capture this in a script:

    
    # Rather silly nmon options but just 
    
    for illustration PID=`nmon -f -s1 -c900 -p` echo $PID echo 
    "kill -9 " $PID > kill_nmon chmod +x kill_nmon
    


    Then use: ./kill_nmon

    to stop nmon when needed.

    Note I think some older topas_nmon versions don't include the -p option but the much older classic nmon does.

    I hope this helps, Nigel Griffiths