Code:
Hi, i gor some questions about using linux in DM:
1. How i can check my cpu ussage?(the whole cpu ussage).
2. How i can run bash script?
3. Is there a way, to show cpu ussage, made by xx procces, daemon?
Copyright © 2024 BYOND Software.
All rights reserved.
This proc allows you to execute any arbitrary command that you would normally be able to type in the Linux terminal. IIRC the response from the command is returned as the result, though the reference implies the exit code is used instead (can someone elaborate? I don't have a test environment at the moment).
Either way you'll be able to get it to work. If shell() doesn't give the response but an exit code instead you can write the result of the command to a file and use the file2text() proc to read that file.
Taking this into account, answering your questions is just a matter of providing the Linux commands you need to get the result you want.
ps -eo pcpu,pid,args --no-headers | grep DreamDaemon | grep -v grep
This should list the CPU usage of all running DreamDaemon processes and their PID's.
Additionally you should be able to list only the current DreamDaemon process by executing the following command from shell():
ps -eo pcpu,pid,args --no-headers | grep $$ | grep -v grep
(The $$ variable is converted to the PID of the process you're executing the command from.)