Giter VIP home page Giter VIP logo

checkup's Introduction

checkup

Run and visualize status checks

Show your health checks as a statusbar icon, and watch it update in realtime.

Check your network service. check your system daemons. check your hardware. check heartbeats, or check workflows. check with scripts, check with binaries, check with docker, check with <whatever>. we don't care what you check, we just provide a small interface and ui to present those checks in :)

install

Download the application from the releases page, here, for your operating system.

usage

Upon installation, you already have a working instance, with dummy checks installed and running. let's add your own.

  • open the app, and click the configure button
  • open the config.js file in the opened directory
    • a template is included to help you get started
  • write some checks. config.js should export a function named configure that returns an array of checks:
// minimal config
module.exports.configure = (ctx) =>
  [{ name: 'random-check', fn: () => Math.random() > 0.5 }]
  • save.
  • click the checkup tray icon, and open/close the window
    • toggling the window should reload your checks
    • observe your new checks loaded!
  • enjoy

launch on startup

if you would like checkup to start when your mac starts up, go to System Preferences > Users and Groups and add checkup.app to "Login Items" for your user

api

config.js

See the default, template config here.

  • export a configure function with signature:

    • module.exports.configure = (toolkit) => [ ...jobs ], or
    • module.exports.configure = (toolkit) => { iconTheme: ..., jobs: [ ...jobs ] }
      • iconTheme: 'stencil_dark', 'stencil', 'github'
      • jobs: each `Job has the following type signature:
type Job = {
  name: string
  fn: (jobCtx: JobCtx) => JobResponsePrimative | Promise<JobResponsePrimative>
  pollDurationMs?: number // default: 10 minutes (60000 * 10)
  state: { ... } // @private. do not try to set or use `state`
}
type JobResponsePrimative = boolean | string
type JobCtx = { log: Logger } // log({ level: 'warn|info|error', message: 'my job is the best!' })

see above for examples.

toolkit

configure receives a toolkit object, which has a few modules embedded:

because so many health check operations are centered around local and remote i/o, these dependencies are injected for your convenience.

// config.js
module.exports.configure = (toolkit) => [/* ... */]

// config.js
module.exports.configure = ({ fs, execa, fetch }) => [/* ... */]

not into javascript?

Not a js fan? Perhaps you just want to run some other binary for a health check? We get it. No problem--just fire off a subprocess to run your thing. You can require('child_process') and use that, but it's advised to use the execa function, which is passed in for you:

// config.js
// @example - child process
module.exports.configure = ({ execa }) => [{
  name: 'disk-check',
  fn: () => execa('fsck', ['-fy', '/dev/sda2'])
}]

contributing

bootstrap

  • nvm use
  • yarn
  • yarn build:watch
    • starts the compiler and the web bundler
  • yarn electron from another shell. alternatively, use the VSCode launch configuration to boot the app

checkup's People

Contributors

cdaringe avatar dependabot-preview[bot] avatar dependabot[bot] avatar swashcap avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

checkup's Issues

Conditional testing

Problem

I want only want to run my test if a specific condition is met (I'm not on company VPN).

Potential Solution

Add a preFn to the Job interface that returns either boolean or Promise<boolean>

make lighter weight, maybe

problem

electron is dope, but everybody looovvvves to rail on it because it's like bringing a bazooka to a knife fight.

node-qt isn't really viable. revery-ui/revery#322 is almost, but w/out tray support, not yet.

even with all that said, JS for checks is >> better than some crummy DSL, and we can DI great dependencies for our users. embedding lua wont be an option. luas cool, but doesn't outweigh ^. in the event that revery becomes viable, we may still embed node, or deno, or opt out of scripting altogether. maybe!

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.