Git Product home page Git Product logo

phck's Introduction

PHCK

PHCK is process health checker web server.

Install & Listen web server

$ go get github.com/ngc224/phck/cmd/phck
$ phck -c phck.sample.conf

Usage

check process & result success

HTTP status code 200

$ curl -i http://127.0.0.1:8939/
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Wed, 15 Jun 2016 08:16:41 GMT

{
  "datetime": "2016-06-15 16:38:27",
  "hostname": "localhost",
  "status": true,
  "process": [
    {
      "label": "nginx",
      "pidfile": "/var/run/nginx.pid",
      "running": true,
      "detail": {
        "name": "nginx",
        "pid": 10709,
        "ppid": 1,
        "command": "nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf",
        "stat": "S",
        "thread": 1,
        "use_memory": 0.10912581
      }
    },
    {
      "label": "td-agent",
      "pidfile": "/var/run/td-agent/td-agent.pid",
      "running": true,
      "detail": {
        "name": "ruby",
        "pid": 22499,
        "ppid": 1,
        "command": "/opt/td-agent/embedded/bin/ruby /usr/sbin/td-agent --log /var/log/td-agent/td-agent.log --use-v1-config --group td-agent --daemon /var/run/td-agent/td-agent.pid",
        "stat": "S",
        "thread": 2,
        "use_memory": 1.3995278
      }
    }
  ]
}

check process & result error

HTTP status code 500

$ curl -i http://127.0.0.1:8939/
HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=utf-8
Date: Wed, 15 Jun 2016 08:15:22 GMT

{
  "datetime": "2016-06-15 16:38:27",
  "hostname": "localhost",
  "status": false,
  "process": [
    {
      "label": "nginx",
      "pidfile": "/var/run/nginx.pid",
      "running": true,
      "detail": {
        "name": "nginx",
        "pid": 10709,
        "ppid": 1,
        "command": "nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf",
        "stat": "S",
        "thread": 1,
        "use_memory": 0.10912581
      }
    },
    {
      "label": "td-agent",
      "pidfile": "/var/run/td-agent/td-agent.pid",
      "running": false,
      "message": "PID file not open",
      "detail": {}
    }
  ]
}

CLI mode

$ phck -cli -c phck.sample.conf

Help

Usage: phck [options]
  -c string
        set cfgiguration file (default "phck.conf")
  -cli  CLI mode
  -h    this help
  -v    show this build version

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.