On 04/09/2019 11.52, Per Jessen wrote:
Per Jessen wrote:
Carlos E. R. wrote:
On 04/09/2019 11.08, Per Jessen wrote:
Carlos E. R. wrote:
Hi,
Can I find the percent of cpu load for a process inside a script?
At worst, I can find it out from "top", but I wonder if there is a more direct way.
run that process with 'time' ?
Nono. I want, in a script, to find the cpu load value of a different program, at many times.
Yes, so run _that_ program with 'time'.
I.e. inside your script:
#!/bin/bash do this do that time do more do something else do something entirely different.
Again, no. That's the load at the end. I want to monitor a daemon, clamd, at any point. Instant CPU load. "top" must obtain the data from somewhere. I want to obtain the same data top does, with calling another program. If there is no other way, I'll use top and parse the output. -- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)