Running the monitoring agent as root user
By default the nixstatsagent runs under it's own user nixstats. This prevents the monitoring agent to have access to certain data such as process level disk I/O.
Here is how to run the nixstatsagent as root user to unlock these statistics.
If you have a file at /etc/systemd/system/nixstatsagent.service your services run from systemd, else try the init.d method.
Open /etc/systemd/system/nixstatsagent.service and change the line with User=nixstats to User=root
Run systemctl daemon-reload to reload the file change.
Open /etc/init.d/nixstatsagent and edit the line proguser=nixstats to proguser=root
If you don't have this line in your file replace this one
with this:
Open /etc/rc.d/nixstatsagent and chagne the line with : ${nixstats_run_user="nixstats"} to : ${nixstats_run_user="root"}
After making these changes run service nixstatsagent restart.
Check if the agent is running as root:
Here is how to run the nixstatsagent as root user to unlock these statistics.
If you have a file at /etc/systemd/system/nixstatsagent.service your services run from systemd, else try the init.d method.
Systemd
Open /etc/systemd/system/nixstatsagent.service and change the line with User=nixstats to User=root
Run systemctl daemon-reload to reload the file change.
Init.d
Open /etc/init.d/nixstatsagent and edit the line proguser=nixstats to proguser=root
If you don't have this line in your file replace this one
start-stop-daemon --start --quiet --name $NAME --oknodo --pidfile $PIDFILE --chuid nixstats --background --make-pidfile --startas $DAEMON
with this:
start-stop-daemon --start --quiet --name $NAME --oknodo --pidfile $PIDFILE --chuid root --background --make-pidfile --startas $DAEMON
OpenBSD
Open /etc/rc.d/nixstatsagent and chagne the line with : ${nixstats_run_user="nixstats"} to : ${nixstats_run_user="root"}
After making these changes run service nixstatsagent restart.
Check if the agent is running as root:
root@test:~# ps aux | grep nixstats
root 1324 0.2 1.6 564592 16832 ? Ssl May16 293:31 /usr/bin/python /usr/local/bin/nixstatsagent
Updated on: 15/07/2019
Thank you!