npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hping

v0.0.5

Published

HTTP ping CLI with Node.js that sends HEAD or GET or POST requests to web or api servers and checks if they alive

Downloads

17

Readme

hPING (HTTP ping)

Node.js CLI that sends HTTP HEAD or GET or POST requests to any web or api servers.

hPING is the fastest and easiest way to check or quickly monitor for http servers availability.

Installation

The latest hPING version is installable via NPM:

$ npm install hping -g

If the above fails try this:

$ npm install git://github.com/kurdin/hping#master -g

or

$ git clone https://github.com/kurdin/hping
$ cd hping 
$ npm install 
$ npm link 

Usage

hPING single server www.google.com:

$ hping www.google.com 

hPING server www.google.com with 10 seconds interval:

$ hping www.google.com -i 10 

hPING single server with GET method:

$ hping get www.google.com

hPING multiple servers www.google.com and www.apple.com and www.microsoft.com):

$ hping www.google.com www.apple.com www.microsoft.com

hPING group of servers from config file (default config: ~/.hping/hping.conf.yaml):

$ hping "apple production"

hPING can mix group of servers and separate hosts with single command:

$ hping "apple production" www.github.com

Settings

hPING default settings, default ~/.hping/hping.conf.yaml:

interval: 1 # (seconds) interval between hPING requests
type: HEAD # (type or requests): HEAD, GET, POST, PUT
timeout: 5000 # (milliseconds) request connection timeout
use_colors: true # (true || false), use colors for hPING output
show_stats_for_last: 100 # (number of requests) show hPING statistics for last X number of requests, set 0 to disable
max_run_time: 600 # (seconds) hPING maximum running time, set 0 to disable

log_status_change: false # (true || false) if true, hPING will log status changes to log file
log_file: logs/hping.log # (path) to hPING log file, default path in users home .hping folder
log_stats_on_exit: true # (true || false) if true, hPING will log statistics to file on exit

display_in_output: # use true || fasle to turn on/off log output sections
  status: true 
  url: true
  ip: true
  type: false
  status_code: true
  status_info: true
  server: true
  content_length: false
  response_time: true

Show hPING server groups from config file, default ~/.hping/hping.conf.yaml:

$ hping servers
 "microsoft live": 
  "http://www.live.com"
  "http://www.live.fr"
  "http://www.live.de"
  "http://www.live.ru"
  "http://www.live.com/api"
 
 "apple production": 
  "http://www.apple.com"
  "http://www.icloud.com"
  "https://itunes.apple.com"
 
 "eurohosting": 
  "http://www.leaseweb.eu"
  "http://www.hetzner.de"
  "http://www.1and1.co.uk"

Display hPING current settings:

$ hping settings

hPING server www.goolge.com and use settings from config file /etc/hping.conf.yaml:

$ hping www.google.com -c /etc/hping.conf.yaml 

Help

hPING quick usage help:

$ hping 
usage: hping [head|get|post] [http(s)://]www.webserver.com[:port] [another host] [server group]

hPING full help:

$ hping -h
  Usage: hping [head|get|post] [http(s)://]www.webserver.com[:port] [another host] [server group]

  Commands:

    servers 
       Show server groups information from config file
    
    settings 
       Show hPING settings from config file
    
    get 
       Sends HTTP GET requests to web or api server (set default in ~/.hping/hping.conf.yaml)
    
    post 
       Sends HTTP POST requests to web or api server (set default in ~/.hping/hping.conf.yaml)
    
    head 
       Sends HTTP HEAD requests to web or api server (set default in ~/.hping/hping.conf.yaml)
    

  Options:

    -h, --help                                   output usage information
    -V, --version                                output the version number
    -c, --config [~/.hping/hping.conf.yaml]  hping config file in YAML format
    -i, --interval [1] 

Log to file

You can setup hPING to log status change to separate log file. Default log file located in ~/.hping/logs folder, you can change it with log_file option.

To enable log output, you need to edit ~/.hping/hping.conf.yaml config file and set: log_status_change : true

Also, you can make hPING to output statistics to log file with option log_stats_on_exit : true

##License The MIT License (MIT) Copyright (c) 2014 Sergey Kurdin