Git Product home page Git Product logo

pi_monitor's Introduction

Pi Monitor

Python utility to get Raspberry Pi metrics. This is an experimental utility, use at your own risk :)

This is just a very simple Python script using a http server to provide some Raspberry Pi metrics via REST calls, like temperature, load average and more.

Usage

The server will make a single endpoint available on the default port 8088: http://YOUR_IP:8088/monitor.json that will return a JSON like this:

{
  "soc_temperature": 50.5,
  "uptime": 18551.34,
  "load_average": [0.0, 0.2, 0.1],
  "kernel_release": "5.4.51-v7+",
  "memory": {
    "total_memory": 441416,
    "free_memory": 90536,
    "available_memory": 279512
  }
}

Installation

Automatic

wget -O - https://raw.githubusercontent.com/Bunn/pi_monitor/master/install.sh | sudo bash

Manual

You can download the files manually and run it the way you like. If you don't want Pi Monitor to run as a service you can just run as python3 pi_monitor.py

Configuration

If you're running it using the automatic installation you can change the username and default port in which Pi Monitor is running by changing the following settings on your pi-monitor.service

[Service]
ExecStart=/usr/bin/python3 -u /usr/local/bin/pi-monitor.py 8088
User=pi

Before doing so, make sure to stop the service with sudo systemctl stop pi-monitor.service and then start it again after your changes with sudo systemctl start pi-monitor.service

If you're running it manually you can just change the default port by sending it as a parameter like: python3 pi_monitor.py 8181

Compatibility

This was tested on Raspberry Pi OS (32 bit), kernel 5.4.51-v7+

pi_monitor's People

Contributors

bunn 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pi_monitor's Issues

Possible to run in docker?

Hi,

This might be a stupid question but is it possible to run script with PiHole in Docker?
When I try to install and run it I get this error:

Removing old files files...
rm: cannot remove '/usr/local/bin/pi-monitor.py': No such file or directory

rm: cannot remove '/etc/systemd/system/pi-monitor.service': No such file or directory

Moving files...

Starting pi-monitor service...
bash: line 26: systemctl: command not found
bash: line 27: systemctl: command not found
bash: line 28: systemctl: command not found

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.