[Libwebsockets] linux Collect top command output

Andy Green andy at warmcat.com
Sun Sep 14 19:00:15 CEST 2014



On 14 September 2014 08:45:56 GMT-07:00, Life Life <sadlife1990 at gmail.com> wrote:
>Hello,
>
>I'm trying libwebsockets to collect linux top command outputsuch as cpu
>and
>memory usage to show small website. is it possible to libwebsockets?

Sure... if you literally want to run top you can redirect stdout from it and send the results down an established websocket link.

Otherwise you can walk /proc and report stats from that directly, without spawning top.

-Andy

>
>Thanks.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://ml.libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list