0

How to create a bash script that runs periodically through a cronjob to gather readings of a running processes on the current machine (1 sample per process on each run ) from the system the readings are: 1 CPU load percentage. 2 Memory Usage. 3 Open files count. 4 Open ports count.

1 Answers1

0

I gues you could iterate through /proc filesystem analysing files uid and stat*. Then the uid needs to be mapped to /etc/passwd to get real user names. In my opinion a perl script would be more convenient for this need.

dmi
  • 1,424
  • 1
  • 9
  • 9