Posts

Showing posts with the label graph

Hack : Monitoring CPU usage from Your Mobile

Image
Background Sometimes I need to run a long-running background process in the server, and I need to know when does the CPU usage returns to (almost) 0, indicating the process finished. I know there are other options, like sending myself an email when the process finished, but currently I am satisfied with monitoring the CPU usage. The old way I have an android cellphone, which allows me to : Launch ConnectBot, type ssh username and password connect to the server type top watch the top result The new way Because I am more familiar with PHP than with anything else right now (ok, there are times I am more familiar with C Sharp, but it is another story), I  do a quick google search for 'php cpu usage' and found  http://stackoverflow.com/questions/13131003/get-cpu-percent-usage-in-php . Using stix's solution I created this simple JSON web service using PHP : For displaying the CPU as a graph, another google search pointed me to Flot, a javascript l...