[Libwebsockets] linux Collect top command output

Life Life sadlife1990 at gmail.com
Mon Sep 15 14:35:35 CEST 2014


Thanks. How to catch stdout from top command ?

Best Regards.

2014-09-14 20:00 GMT+03:00 Andy Green <andy at warmcat.com>:

>
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20140915/8cfd4f1c/attachment-0001.html>


More information about the Libwebsockets mailing list