AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  get CPU statistics without root permissions on AIX

    Posted Tue October 11, 2022 09:05 AM

    I want to get the per processor statistics for my AIX machines. I can use the 'sar -P ALL 1 1' (Documentation) command but it requires root privileges. Output of the same:



    Is there a command that can give me PER PROCESSOR statistics WITHOUT requiring root privileges?



    ------------------------------
    Purven Dudhaiya
    ------------------------------


  • 2.  RE: get CPU statistics without root permissions on AIX

    Posted Tue October 11, 2022 10:07 AM
    Mpstat will show you the individual cores, down to the smt threads

    Try mpstat -a   





  • 3.  RE: get CPU statistics without root permissions on AIX

    Posted Wed October 12, 2022 05:18 AM
    Not one command. You may create a new role for running sar and give it to the user. Then the user should log in again to get access to sar.

    As root:

    # create a new role for statistic tools
    $ mkrole authorizations=aix.system.stat aixstat
    # load the role definition into kernel
    $ setkst
    # give the role to the user
    $ chuser roles=aixstat default_roles=aixstat user

    Then login (or re-login) as normal user:

    # check if the role is there
    $ rolelist -e
    ​aixstat
    $ sar -P ALL 1 1

    You must have AIX 6.1 at least with enabled enhanced RBAC (by default it is enabled).

    Best regards
    Andrey
     ​​​

    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------