rakshazi/fping 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rakshazi/fping

Composer 安装命令:

composer require rakshazi/fping

包简介

Simple microservice / function to check target health

README 文档

README

Simple microservice / function to check target server, site, etc status.

Table of Contents

Usage

Docker

docker run -d -p 8080:8080 rakshazi/fping

curl -X POST -d "type=HTTP&address=https://google.com" localhost:8080

#response
{"status_code":200,"time":0.448615,"should_contain":true,"should_not_contain":true,"status":true}

OpenFaaS

Coming soon...

Composer (optional)

If you want to use fping "as-is", without docker, you can install it with composer:

composer require rakshazi/fping

API

Request

fping built on top of OpenFaaS Watchdog to provide simple API and integration with OpenFaaS.

To call fping, you should send POST request to fping address (in example above - localhost:8080) with following body structure:

json:

{
    "type": "Check type",
    "address": "Target server/site address",
    "timeout": 5, //integer timeout in seconds
    "optional": {} //optional params, specific for each check type
}

raw form:

type=Check type&address=Target address&timeout=5&optional[param1]=val1&optional[param2]=val2

Response

json:

{
    "status_code":200, //HTTP response status code
    "time":448, //response time in ms
    "should_contain":true, //optional for HTTP
    "should_not_contain":true, //optional for HTTP
    "status":true //check status - is target up or down
}

Check types

HTTP

Check HTTP(-s) targets.

optional params:

  • should_contain - Check response body for that string, check passed if string was found
  • should_not_contain - Check response body for that string, check failed if string was found

Example:

curl -X POST -d "type=HTTP&address=https://example.com&timeout=5&optional[should_contain]=healthy&optional[should_not_contain]=error" localhost:8080

统计信息

  • 总下载量: 58
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固