GithubHelp home page GithubHelp logo

lucasnetau / mqtt-os-status Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oskarhagberg/mqtt-os-status

0.0 2.0 0.0 172 KB

Operating-system related data, published to an MQTT broker at fixed intervals.

JavaScript 35.22% Shell 64.78%

mqtt-os-status's Introduction

MQTT OS Status

Operating-system related data, published to an MQTT broker at fixed intervals.

Example output

$  mosquitto_sub -h 192.168.1.5 -t "+/os/#" -v
pi1/os {"hostname":"jeeves","type":"Linux","endianness":"LE","platform":"linux","arch":"arm","release":"3.10.25+"}
pi1/os/uptime 142.2680236
pi1/os/loadavg [1.07421875,0.68212890625,0.271484375]
pi1/os/mem {"totalmem":508874752,"freemem":396210176}
pi1/os/cpus [{"model":"unknown","speed":700,"times":{"user":373600,"nice":0,"sys":203500,"idle":547300,"irq":3700}}]
pi1/os/networkInterfaces {"lo":[{"address":"127.0.0.1","family":"IPv4","internal":true}],"eth0":[{"address":"192.168.1.5","family":"IPv4","internal":false}]}

Install as a service on Raspberry Pi

These instructions are for Raspbian on Raspberry Pi but could easily be adapted to most Linux distributions.

Source

Install forever.js

npm install -g forever

Install this module

npm install -g mqtt-os-status

Copy the sample etc/init.d/mqtt-os-status file to /etc/init.d and make it executable. Adjust the directory of your node.js installation if necessary.

sudo su
cp /home/pi/node-v0.10.2-linux-arm-pi/lib/node_modules/mqtt-os-status/etc/init.d/mqtt-os-status /etc/init.d/mqtt-os-status
chmod a+x /etc/init.d/mqtt-os-status

Edit the node binary paths, app paths, username and password, and optional adjustments to topic root and update inteval in the script as necessary

After putting the script in place, you should update the system service definitions:

update-rc.d mqtt-os-status defaults

Run or check on the script and its process with the following commands:

service mqtt-os-status start
service mqtt-os-status status
service mqtt-os-status restart
service mqtt-os-status stop

mqtt-os-status's People

Contributors

oskarhagberg avatar

Watchers

 avatar  avatar

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.