Code Monkey home page Code Monkey logo

pocketchip-sysmonitor's Introduction

Collect informations of a PocketCHIP system and save it to a text file to use that data in other code projects.

No root permissions required!

Installation

mkdir -p /home/chip/code/sysmonitor
git clone https://github.com/perryflynn/pocketchip-sysmonitor.git /home/chip/code/sysmonitor

Manual call

# update all informations
~/code/sysmonitor/sysmonitor.sh --file ~/code/sysmonitor/monitorstatus --all
# update wan ip status
~/code/sysmonitor/sysmonitor.sh --file ~/code/sysmonitor/monitorstatus --wan
# update wifi status
~/code/sysmonitor/sysmonitor.sh --file ~/code/sysmonitor/monitorstatus --wifi
# update battery status
~/code/sysmonitor/sysmonitor.sh --file ~/code/sysmonitor/monitorstatus --battery

Cron

I wanted to update wifi and wan every minute, battery every five minutes. Exactly this does the script cronrun.sh. Simply put this script into your crontab:

# exexute on reboot
@reboot /home/chip/code/sysmonitor/cronrun.sh
# execute every minute
* * * * * /home/chip/code/sysmonitor/cronrun.sh

Example data

  • One property per line
  • Key and value separated by TAB
chip@chip:~$ cat ~/code/sysmonitor/monitorstatus
BAT_STATUS	0
CHARG_IND	0
BAT_EXIST	1
CHARGE_CTL	0xc9
CHARGE_CTL2	0x45
BATT_VOLT	3909.4mV
BATT_DISCHARGE_CURR	266.5mA
BATT_CHARGE_CURR	0mA
TEMP	37.1°C
BATT_PERCENT	76%
BATT_LASTUPDATE	2017-08-27T23:45:05+02:00
WIFI_NET	freifunk-einbeck.de
WIFI_IP	10.49.2.240
WIFI_LASTUPDATE	2017-08-27T23:48:02+02:00
WAN_IP	193.138.219.233
WAN_ORG	mullvad.net
WAN_LASTUPDATE	2017-08-27T23:48:04+02:00
LASTUPDATE	2017-08-27T23:48:04+02:00

Credits

pocketchip-sysmonitor's People

Contributors

perryflynn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

biek markoni985

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.