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------------------------------
Original Message:
Sent: Tue October 11, 2022 05:58 AM
From: Purven Dudhaiya
Subject: get CPU statistics without root permissions on AIX
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
------------------------------