Topic
5 replies Latest Post - ‏2013-01-21T07:22:20Z by dzodzo
dzodzo
dzodzo
6 Posts
ACCEPTED ANSWER

Pinned topic Scheduling nmon at jobs from crontab entry

‏2013-01-04T14:49:01Z |
Greetings,

we use following crontab entry to run nmon in performance data collection mode:


# nmon capacity planning mode 0 7 * * * /var/adm/nmon/nmon -x -m /var/adm/nmon > /dev/

null 2>&1


this will schedule at job for each hour that collects performance data and is run in following format:


======================== root.1357311600.a       Fri Jan  4 16:00:00 GMT+01:00 2013 ======================== /var/adm/nmon/nmon -R -F /tmp/nmon_grapher.data.1007707 -c 12 -s 300


is it possible to influence this at job configuration somehow so i can redirect its output to /dev/null?

With current configuration it will just send a mail to root each hour about the at job and it's filling up root's mailbox with unnecessary spam. Thanks for help.
Updated on 2013-01-21T07:22:20Z at 2013-01-21T07:22:20Z by dzodzo
  • nagger
    nagger
    1620 Posts
    ACCEPTED ANSWER

    Re: Scheduling nmon at jobs from crontab entry

    ‏2013-01-08T09:07:04Z  in response to dzodzo
    Hi,
    Self inflicted errors, mate!!

    What is /var/adm/nmon/nmon ?
    There is no such file on my AIX 6100-07-03-1207

    I guess it is some script of yours? You need to check your script.
    Also what AIX release (oslevel -s) and nmon are you using.

    I think this is a typical cron running my script error rather than anything to do with nmon
    but I could be wrong.

    I would also redirect output to a log file - then you can check for errors and delete the log file say once a month.

    cheers, Nigel
    • dzodzo
      dzodzo
      6 Posts
      ACCEPTED ANSWER

      Re: Scheduling nmon at jobs from crontab entry

      ‏2013-01-10T16:11:18Z  in response to nagger
      Greetings, this file is a ksh script:

      
      root@r4238 [/var/adm/nmon] file nmon nmon: shell script  - ksh (Korn shell)
      


      Depending on what oslevel you have it decides what binary to run, there are following present:

      
      -rwxr-xr-x    1 root     system       382798 Jul 17 15:12 nmon12d_aix51 -rwxr-xr-x    1 root     system       443175 Jul 17 15:12 nmon12d_aix522 -rwxr-xr-x    1 root     system       431727 Jul 17 15:12 nmon12d_aix527 -rwxr-xr-x    1 root     system       465855 Jul 17 15:12 nmon12d_aix530 -rwxr-xr-x    1 root     system       508707 Jul 17 15:12 nmon12d_aix534 -rwxr-xr-x    1 root     system       508894 Jul 17 15:12 nmon12d_aix535 -rwxr-xr-x    1 root     system       532696 Jul 17 15:12 nmon12d_aix536 -rwxr-xr-x    1 root     system       535948 Jul 17 15:12 nmon12d_aix537 -rwxr-xr-x    1 root     system       554024 Jul 17 15:12 nmon12d_aix61 -rwxr-xr-x    1 root     system       388992 Jul 17 15:12 nmon12e_aix51 -rwxr-xr-x    1 root     system       449315 Jul 17 15:12 nmon12e_aix522 -rwxr-xr-x    1 root     system       438145 Jul 17 15:12 nmon12e_aix527 -rwxr-xr-x    1 root     system       472071 Jul 17 15:12 nmon12e_aix530 -rwxr-xr-x 1 root     system       515179 Jul 17 15:12 nmon12e_aix534 -rwxr-xr-x    1 root     system       515368 Jul 17 15:12 nmon12e_aix535 -rwxr-xr-x    1 root     system       539536 Jul 17 15:12 nmon12e_aix536 -rwxr-xr-x    1 root     system       542388 Jul 17 15:12 nmon12e_aix537 -rwxr-xr-x    1 root     system       560628 Jun 07 2012  nmon12e_aix61 -rwxr-xr-x    1 root     system       554024 Jul 17 15:12 nmon_aix53
      


      but i suppose it uses the "nmon12e_aix61" since we use it on AIX 6.1, oslevel is 6100-06-09-1228. From help to this binary, i read:

      
      Capacity planning mode - use cron to run each day -x            sensible spreadsheet output 
      
      for CP =  one day every 15 mins 
      
      for 1 day ( i.e. -ft -s 900 -c 96)
      


      Also the -m option is used to change to specified directory before saving the file. So i think this binary is planning the at job. But i don't see where i could configure the way at job is created. It produces .nmon files containing performance data in time (daily):

      
      root@r4238 [/var/adm/nmon] file r4238_130110_0700.nmon r4238_130110_0700.nmon: commands text root@r4238 [/var/adm/nmon] tail r4238_130110_0700.nmon NETERROR,T0041,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 IOADAPT,T0041,0.0,42.9,5.9,33.6,42.9,6.8 JFSFILE,T0041,68.4,21.0,69.6,52.1,46.8,0.2,40.4,0.1,14.2,24.8,20.3,18.4,33.5,0.0,90.9,37.7,22.8,5.6,5.0,5.6,5.0 JFSINODE,T0041,28.1,2.0,17.9,10.7,1.3,0.0,3.2,0.0,0.3,3.1,1.7,0.7,0.2,0.0,4.3,3.1,0.7,0.0,0.0,0.0,0.0 DISKBUSY,T0041,0.3,0.3 DISKREAD,T0041,0.0,33.5 DISKWRITE,T0041,42.9,42.9 DISKXFER,T0041,5.9,6.8 DISKBSIZE,T0041,7.3,11.2 TOP,39059612,T0041,0.18,0.14,0.05,1,87212,21200,30036,2599,4.599,40,disp+work,Unclassified
      


      We use it to collect data for nmon_grapher, that is running on machine with httpd so we can see machine statistics to analyze performance data.

      Perhaps the way of collecting data has changed with switching to topas_nmon? Could you suggest proper way how to collect these data? Thanks for help.
      • SystemAdmin
        SystemAdmin
        2404 Posts
        ACCEPTED ANSWER

        Re: Scheduling nmon at jobs from crontab entry

        ‏2013-01-11T09:18:17Z  in response to dzodzo
        Version 12e? Its ancient! I suggest that run supported topas_nmon instead to get much better results. You can schedule it using "smitty topas".

        If you want to stick in the 12e version, .forward the mail to the /dev/null or use procmail. I do not know what creates the hourlt "at" commands, to me it sounds like a script of your own creation.
        • dzodzo
          dzodzo
          6 Posts
          ACCEPTED ANSWER

          Re: Scheduling nmon at jobs from crontab entry

          ‏2013-01-15T12:23:22Z  in response to SystemAdmin
          Greetings, thanks for the tip, i'll be experimenting with that. Is there any guide how to set up what you want to monitor? I just tried some basic local recording, there was some errro however the command ended ok.

          
          Command: OK            stdout: yes           stderr: no   Before command completion, additional instructions may appear below.   ERROR nmon: invalid NMON_ONE_IN shell variable Successfully started persistent recording.
          
  • dzodzo
    dzodzo
    6 Posts
    ACCEPTED ANSWER

    Problem solved

    ‏2013-01-21T07:22:20Z  in response to dzodzo
    Hello, you can mark this thread as solved, i've discovered the cause. On our central node that collects the data resides a shell script called /var/adm/nmon_grapher/nmon_grapher. It contains the scheduling at command but it only sends stderr to /dev/null so i adjusted it to send also stdout

    
    $RSH $node 
    "echo $nmon -R -F /tmp/nmon_grapher.data.$seq -c $samples -s 300 | at -t $nexttime 1>/dev/null 2>/dev/null"
    


    No more pesky mails in root mailbox.