• Stars
    star
    33
  • Rank 781,234 (Top 16 %)
  • Language
    Go
  • License
    MIT License
  • Created about 4 years ago
  • Updated 28 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

`statoo` is a super simple http GET tool for checking site health

Version Go Documentation Go Report Card Build Status Go Build Status GolangCI-Lint Status Docker Lint Status codecov Docker Pulls Docker Size Docker Build Status

Statoo

A super basic http tool that makes only GET request to given URL and returns status code of the response. Well, if you are curl or http (httpie) user, you can make the same kind of request and get a kind-of same response since statoo is way better simple :)

statoo injects Accept-Encoding: gzip request header to every http request!

Installation

You can install from the source;

go install github.com/vigo/statoo@latest

or, you can install from brew:

brew tap vigo/statoo
brew install statoo

Usage:

statoo -h
usage: ./statoo [-flags] URL

  flags:

  -version           display version information (%s)
  -verbose           verbose output (default: false)
  -request-header    request header, multiple allowed, "Key: Value", case sensitive
  -response-header   response header for lookup -json is set, multiple allowed, "Key: Value"
  -t, -timeout       default timeout in seconds (default: %d, min: %d, max: %d)
  -h, -help          display help
  -j, -json          provides json output
  -f, -find          find text in response body if -json is set, case sensitive
  -a, -auth          basic auth "username:password"
  -s, -skip          skip certificate check and hostname in that certificate (default: false)
  -commithash        displays current build/commit hash (%s)

  examples:
  
  $ ./statoo "https://ugur.ozyilmazel.com"
  $ ./statoo -timeout 30 "https://ugur.ozyilmazel.com"
  $ ./statoo -verbose "https://ugur.ozyilmazel.com"
  $ ./statoo -json https://vigo.io
  $ ./statoo -json -find "python" https://vigo.io
  $ ./statoo -json -find "Python" https://vigo.io
  $ ./statoo -json -find "Golang" https://vigo.io
  $ ./statoo -request-header "Authorization: Bearer TOKEN" https://vigo.io
  $ ./statoo -request-header "Authorization: Bearer TOKEN" -header "X-Api-Key: APIKEY" https://vigo.io
  $ ./statoo -auth "user:secret" https://vigo.io
  $ ./statoo -json -response-header "Server: GitHub.com" https://vigo.io
  $ ./statoo -json -response-header "Server: GitHub.com" -response-header "Foo: bar" https://vigo.io

Let’s try:

statoo "https://ugur.ozyilmazel.com"
# 200
statoo -verbose "https://ugur.ozyilmazel.com"
# https://ugur.ozyilmazel.com -> 200

or;

statoo -json https://vigo.io

response;

{
    "url": "https://vigo.io",
    "status": 200,
    "checked_at": "2021-05-13T18:09:26.342012Z",
    "elapsed": 210.587871,
    "skipcc": false
}

elapsed represents response is in milliseconds.

Let’s find text inside of the response body. This feature is only available if the -json flag is set! length represents response size in bytes (gzipped) when you search something in body!

statoo -json -find "Golang" https://vigo.io
{
    "url": "https://vigo.io",
    "status": 200,
    "checked_at": "2022-01-26T20:08:33.735768Z",
    "elapsed": 242.93925,
    "length": 7827,
    "find": "Golang",
    "found": true,
    "skipcc": false
}
statoo -json -find "golang" https://vigo.io # case sensitive
{
    "url": "https://vigo.io",
    "status": 200,
    "checked_at": "2022-01-26T20:14:03.487002Z",
    "elapsed": 253.665083,
    "length": 7827,
    "find": "golang",
    "found": false,
    "skipcc": false
}

You can add basic authentication via -auth flag

statoo -auth "username:password" https://your.basic.auth.url

Now you can pass multiple -request-header flags:

statoo -request-header "Key1: Value1" -request-header "Key2: Value2" "https://ugur.ozyilmazel.com"

You can query/search for response headers. You can pass multiple values, all case sensitive!. Let’s lookup for Server and Foo response header values. Server value should be GitHub.com and Foo value should be bar:

statoo -json -response-header "Server: GitHub.com" -response-header "Foo: bar" https://vigo.io

Response:

{
    "url": "https://vigo.io",
    "status": 200,
    "checked_at": "2022-07-09T17:51:14.792987Z",
    "elapsed": 305.502833,
    "skipcc": false,
    "response_headers": {
        "Foo=bar": false,
        "Server=GitHub.com": true
    }
}

Server response header matches exactly!

It’s better to pipe -json output to jq or python -m json.tool for pretty print :)

That’s it!

Bash completions is available via;

eval "$(statoo bash-completion)"

New

You can check current build/commit hash via;

statoo -commithash

Rake Tasks

$ rake -T

rake default               # show avaliable tasks (default task)
rake docker:lint           # lint Dockerfile
rake release[revision]     # release new version major,minor,patch, default: patch
rake test:run[verbose]     # run tests, generate coverage
rake test:show_coverage    # show coverage after running tests
rake test:update_coverage  # update coverage value in README

Docker

https://hub.docker.com/r/vigo/statoo/

# latest
docker run vigo/statoo -h
docker run vigo/statoo -json -find "Meetup organization" https://vigo.io

Contributor(s)


Contribute

All PR’s are welcome!

  1. fork (https://github.com/vigo/statoo/fork)
  2. Create your branch (git checkout -b my-feature)
  3. commit yours (git commit -am 'add some functionality')
  4. push your branch (git push origin my-feature)
  5. Than create a new Pull Request!

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.


License

This project is licensed under MIT

More Repositories

1

git-puf-noktalari

Günlük hayatta kullandığımız revizyon kontrol sistemi GIT ile ilgili küçük ipuçlarını anlatan yeni mini kitabım.
Ruby
425
star
2

kommit

Build your commit message without touching or editing your code!
Shell
204
star
3

ruby101-kitap

Türkçe Ruby kitabı
Ruby
197
star
4

dinozorus

1990'lı yıllara damgasını vuran efsane televizyon oyunu Dinozorus. Amiga 1200 - AGA
Assembly
134
star
5

turk-scene-tarihi

80'lerin ortasında başlayan, günümüz bilgisayar kültürünün neredeyse başlangıç noktası olan Türk SCENE/DEMOSCENE tarihçesi
85
star
6

lyk-2017

Linux Yaz Kampı 2017'de anlattığım konular.
41
star
7

django2-project-template

Django project/application starter for lazybones :)
Python
39
star
8

textmate-twitterbootstrap.tmbundle

TextMate bundle for Twitter's Bootstrap
HTML
33
star
9

awesome-c64

Commodore 64 related links such as C64 tools for Mac/Linux/PC, demoscene related stuff, coding tools, C64 utilities etc...
31
star
10

textmate-octopress.tmbundle

TextMate bundle for Octopress blog engine. http://octopress.org/
29
star
11

django-admin-list-filter

Dead simple autocompletion for Django admin `list_filter`.
Python
22
star
12

gh_issues

Manage GitHub issues from command-line (read only!)
Ruby
22
star
13

dotfiles-light

Just another but `lighter` version of BASH environment
Shell
20
star
14

dotfiles-universal

My old BASH dot-files... Try new one!
Shell
13
star
15

textmate2-python-fmt

Python FMT is a python linter/formatter/checker for TextMate.
Ruby
13
star
16

textmate2-gfm-preview

GitHub Flavored Markdown Preview for TextMate 2
CSS
13
star
17

django-project-template

Project starter for Django 1.11.4 ... Batteries included :)
Python
9
star
18

textmate-hosts.tmbundle

TextMate bundle for /etc/hosts file
9
star
19

dotfiles-fever

Elegant BASH environment for macOS, Ubuntu and Gentoo
Shell
8
star
20

textmate-window-manager

Window manager/arranger for oldskool TextMate (1.5)
Shell
7
star
21

apm-bash-completion

Bash completion for Atom Package Manager (apm)
Shell
6
star
22

stormssh-completion

Bash competion for `sshstorm` (https://github.com/emre/storm)
Shell
6
star
23

devpod

Official website of devPod
HTML
6
star
24

textmate2-ruff-linter

Ruff linter for TextMate2. Linter and auto fixer for python!
Perl
5
star
25

ugur.ozyilmazel.com-v5

Kişisel websitem V4.0
HTML
5
star
26

lsvirtualenvs

Small commandline tool for `virtualenvwrapper`
Go
4
star
27

ghstars

Show GitHub stars count for user!
Go
4
star
28

git-init-githubrepo

Create git repository for GitHub style
Go
4
star
29

textmate2-tailwind-css

Tailwind CSS support for TextMate 2
Ruby
4
star
30

golang-notlarim

Golang geliştirme ile ilgili aldığım notlar
Ruby
4
star
31

git-tips

Git versiyon kontrol sistemi ile ilgili Türkçe dökümantasyon ve ipuçları
JavaScript
4
star
32

dox2008

2007-2008 yıllarında İstanbul Bilgi Üniversitesi, web departmanı için hazırladığım javascript ve html/css eğitimleri
JavaScript
4
star
33

textmate2-power-tools

Some useful TextMate2 snippets, commands etc...
Ruby
3
star
34

inspect-go

Ruby-ish Object#inspect tryouts for Golang!
Go
3
star
35

putio

Command-Line client for put.io platform (unofficial)
Go
3
star
36

textmate2-64tass-bundle

64tass Bundle for TextMate 2
2
star
37

sayisal_captcha

Çok basit şekilde iki basamaklı sayılardan random toplama ya da çarpma üreten bir sistem
Ruby
2
star
38

learning-stimulus-02

I'm learning stimulus, this is example 02
JavaScript
2
star
39

vigo

I'm a hustler baby!
2
star
40

textmate2-gomodifytags

TextMate2 implementation of Fatih’s gomodifytags
Shell
2
star
41

ruby101-kitap-kod

Ruby101 kitabında geçen kod örnekleri
2
star
42

els

Unix `ls` command alternative via Ruby :)
Ruby
2
star
43

pg16_django

3. Programlama Günleri / Karabük - Django ile tanışma
Python
2
star
44

vigo.io

Personal website
HTML
2
star
45

learning-stimulus-01

I'm learning stimulus, this is example 01
JavaScript
1
star
46

homebrew-git-init-githubrepo

brew tap for `git-init-githubrepo`
Ruby
1
star
47

textmate2-bootstrap3

Bootstrap 3's helpers for TextMate2
1
star
48

uptimerobot_cmd

Command-line client for Uptimerobot service
Ruby
1
star
49

stringutils-demo

A basic golang package for demo purpose only...
Go
1
star
50

textmate1-twitter-bs3.tmbundle

Twitter Bootstrap 3 bundle for TextMate1 (yes the oldest TextMate)
1
star
51

try_git

1
star
52

dji18njs

Modified and hardcore changed version of Django's i18n-javascript function. Can be usable as JavasScript Template engine. If you familiar with python's "format text" you will love this!
JavaScript
1
star
53

homebrew-lsvirtualenvs

brew tap for lsvirtualenvs
Ruby
1
star
54

amiga-ascii.tmbundle

Oldskool Amiga ascii/azki/nfo/diz support for TextMate with real Amiga fonts
1
star
55

vigo.github.com

My developer home page...
HTML
1
star
56

ugur.ozyilmazel.com

Kişisel web sitem
HTML
1
star
57

textmate-nanorc.tmbundle

.nanorc bundle for TextMate
Ruby
1
star
58

homebrew-statoo

brew tap repo for `statoo`
Ruby
1
star
59

my-custom-textmate1-bundle

Many snippets and my custom scratch-pad for TextMate1.
CSS
1
star
60

homebrew-ghstars

Brew tap for ghstars cli
Ruby
1
star