Code Monkey home page Code Monkey logo

peekaboo's Introduction

Expose hardware info using a REST API written in Go and a Front-End written in AngularJS.

FrontEnd

http://myserver.example.com:5050

BackEnd

Endpoints

/api/docker
/api/docker/containers
/api/docker/images
/api/network
/api/network/interfaces
/api/network/routes
/api/storage/disks
/api/storage/lvm/logvols
/api/storage/lvm/physvols
/api/storage/lvm/volgrps
/api/storage/mounts
/api/system
/api/system/cpu
/api/system/ipmi
/api/system/memory
/api/system/os
/api/system/pcicards
/api/system/rpms
/api/system/sysctls
/api/system/kernel/config
/api/system/kernel/modules

Methods

GET

curl -i -X GET http://<host>:<port>/api/system?envelope=true

PURGE

Purge cache i.e. next get request will refresh the cache.

curl -i -X PURGE http://<host>:<port>/api/system?envelope=true

Options

envelope

Include an envelope with error, cache and status information.

?envelope=true

Example:

{
  "cache": {
    "lastUpdated": "...",
    "timeoutSec": 0,
    "fromCache": false
  },
  "data": {
  },
  "error": [],
  "status": 200
}

refresh

Refresh cache.

?refresh=true

indent

Don't indent JSON.

?indent=false

Example:

curl http://myserver.example.com:5050/api/system

Usage

Peekaboo

Usage:
  peekaboo daemon [--debug] [--bind=<addr>] [--static=<dir>]
  peekaboo list
  peekaboo get <hardware-type>
  peekaboo -h | --help
  peekaboo --version

Commands:
  daemon               Start as a daemon serving HTTP requests.
  list                 List hardware names available.
  get                  Return information about hardware.

Arguments:
  hardware-type        Name of hardware to return information about.

Options:
  -h --help            Show this screen.
  --version            Show version.
  -d --debug           Debug.
  -b --bind=<addr>     Bind to address and port. [default: 0.0.0.0:5050]
  -s --static=<dir>    Directory for static content. [default: static]

Setup Go on Linux

sudo yum install -y golang
mkdir ~/go
export GOPATH=~/go
export PATH=$GOPATH/bin:$PATH
go get github.com/constabulary/gb/...

Build and run

gb build
sudo bin/peekaboo daemon -d

Build RPM

Fiest make sure you have Docker configured.

make rpm

Change configuration

systemctl stop peekaboo
vi /etc/sysconfig/peekaboo

Change port to 8080.

Example:

OPTIONS="--bind 0.0.0.0:8080"

Reload SystemD and then restart Peekaboo.

systemctl start peekaboo

Install using Brew on Mac OS X

brew tap mickep76/funk-gnarge
brew install peekaboo
ln -sfv /usr/local/opt/peekaboo/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.peekaboo.plist

Change configuration

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.peekaboo.plist
vi ~/Library/LaunchAgents/homebrew.mxcl.peekaboo.plist

Change port to 8080.

Example:

...
    <string>--bind</string>
    <string>0.0.0.0:8080</string>
..

Restart Peekaboo.

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.peekaboo.plist

peekaboo's People

Contributors

belooussov avatar grubbins avatar pbh101 avatar

Watchers

 avatar  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.