GithubHelp home page GithubHelp logo

rcpu's Introduction

rCPU

A minimal webserver for remote CPU monitoring (on Linux). Everything is embedded in the executable, so you just need to run the program. I'm planning to run it on my Raspberry Pi 2 to monitor the use of each core. Although it should run on other Linux machines too.

The program will automatically adjust the display according to the number of CPU cores.

UPDATE: this latest version (February 2016) changes the graph plotting library from Smoothie Charts to [Flot] (http://www.flotcharts.org/) in the hope of having better browser support.

NOTE: the code to display the core temperature is designed for the Raspberry Pi, it might not work on other machines.

How to build and run

On the Raspberry Pi (and other Debian based systems probaby)

You should be able to do this:

git clone https://github.com/davidsblog/rCPU
cd rCPU/rCPU/
sudo make install

...which will build everything and install it as a service (it will run at system start-up). The server will run on port 8111. That means you can view the graphs by visiting http://192.168.1.2:8111/ (you need to substitute your Raspberry Pi's IP address). You can remove it from your system like this (assuming you are still in the rCPU/rCPU/ directory):

sudo make uninstall

NOTE: the sudo before calling make above is important, since you're installing services.

Runing manually (or on different Linux versions)

Just do this:

git clone https://github.com/davidsblog/rCPU
cd rCPU/rCPU/
make
sudo ./rcpu 80

You might have a webserver already running on port 80, in which case you can specify a different port by passing a different parameter than 80 in the last line above.

Embedded content

The html and javascript files are embedded in the executable. Each resource file becomes a C header file. The makefile updates the header files as dependencies during the build process.

Thanks

I am using the following javascript libraries:

Thanks to all involved with those projects.

rcpu's People

Contributors

bryant1410 avatar davidsblog avatar friscomad avatar ric96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rcpu's Issues

Not working on Raspberry Pi 3 running CentOS

Hi, this is the output I'm getting.

[root@worker-1 rCPU]# make install
xxd -i index.html index.h
make: xxd: Command not found
make: *** [index.h] Error 127

Any ideas what I should do? I've ensured I have the Development Tools installed.

How to reinstall ?

Hi ... rCPU is really brilliant and I have it working on several pi's, however I had a problem with static ip address (raspberry pi2 it had 2 ip addresses) I sorted that our, but now rCPU does not work,
example: sudo ./rcpu 80 ... htpp://xxx.xxx.x.xx:80 - This web page is not available
I convince myself that I need to rei-install rCPU but even after deleting the files and folder when I try to install again I get ... make: 'rcpu' is up to date.
I am manually installing rCPU with sudo make not as a service with sudo make install
How can I un-make or de install the current rCPU installation so that I can re-install it again.

Thanks for your help on this

Toshi Bass

No Graph

I just installed rCPU on my Pi2 using your directions. CPU and temp are showing fine, but there is no graph showing the activity of all four cores. Did I miss something? Appreciate any help!

Not working for arch linux on pi 2

[root@alarmpi rCPU]# make
xxd -i index.html index.h
make: xxd: Command not found
Makefile:11: recipe for target 'index.h' failed
make: *** [index.h] Error 127
[root@alarmpi rCPU]#

Does not work anymore on Raspberry Pi5 Bookworm

pi@rpi5:~ $ git clone https://github.com/davidsblog/rCPU
Cloning into 'rCPU'...
remote: Enumerating objects: 356, done.
remote: Total 356 (delta 0), reused 0 (delta 0), pack-reused 356
Receiving objects: 100% (356/356), 374.92 KiB | 2.27 MiB/s, done.
Resolving deltas: 100% (237/237), done.
pi@rpi5:~ $ cd rCPU/rCPU/
pi@rpi5:~/rCPU/rCPU $ sudo make install
xxd -i index.html index.h
make: xxd: No such file or directory
make: *** [Makefile:11: index.h] Error 127

unable to uninstall

Hello David,

I was able to download install and run rCPU with no problems. However, I'm unable to uninstall the server at this point, I am sure that I'm in /rCPU/rCPU when I run "sudo make uninstall". Any advice? Please know that I am fairly new to linux and raspberry pi and it is a possibility that it is user error. Any information would be super helpful.
Many Thanks,
dtan84

Canvas dissapears on latest Android chrome after switching tabs/apps

On the latest Chrome for android it can happen that the canvas will dissapear after switching between tabs/apps and switching back to rCPU tab. This seems like a Chrome bug (you can find references about this problem on the web) but since it was bothering me I created a fix for it in my own fork (where I mangled up your project a bit since there's stuff in there that only works on Pi and not on a generic x86/64 Ubuntu box, see https://github.com/joszz/rCPU/tree/master/rCPU).
This hack works for me;

add this to document onload

document.addEventListener("visibilitychange", function () {
    window.dispatchEvent(new Event("resize"));
});

PS.
Thanks for this cool tool. I'm creating a project around it where rCPU is part of;
https://github.com/joszz/Chell-PHP-Portal

PS2
My current install is based on the older chart library though (smoothie chart). This might not be a problem with the new one (although I expect it will be, since the whole canvas is gone when this happens)

Does not work anymore on Raspberry Pi5 Bookworm

pi@rpi5:~ $ git clone https://github.com/davidsblog/rCPU
Cloning into 'rCPU'...
remote: Enumerating objects: 356, done.
remote: Total 356 (delta 0), reused 0 (delta 0), pack-reused 356
Receiving objects: 100% (356/356), 374.92 KiB | 2.27 MiB/s, done.
Resolving deltas: 100% (237/237), done.
pi@rpi5:~ $ cd rCPU/rCPU/
pi@rpi5:~/rCPU/rCPU $ sudo make install
xxd -i index.html index.h
make: xxd: No such file or directory
make: *** [Makefile:11: index.h] Error 127

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.