[Libwebsockets] linux Collect top command output

Andy Green andy at warmcat.com
Mon Sep 15 14:45:31 CEST 2014



On 15 September 2014 05:35:35 GMT-07:00, Life Life <sadlife1990 at gmail.com> wrote:
>Thanks. How to catch stdout from top command ?

https://www.google.com.tw/search?q=redirect+stdout+system

-Andy

>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
>>
>>




More information about the Libwebsockets mailing list