Giter Club home page Giter Club logo

pinger's Introduction

pinger

Takes a text file of IPs/hostnames to ping as an argument, and runs ping against all of them. Alternatively, uses cURL in the case of URLs. Runs timers for anything that is 'down'.

Use

  1. Clone this repo: git clone https://github.com/Starttoaster/pinger.git && cd pinger/

  2. Make a text file to run the tests on. Can be named anything, and store the IPs/hostnames/URLs on new lines.

  3. Run the script: ./pinger.sh <filename>

Example text file and output:

8.8.8.8
1.1.1.1
8.8.4.4
https://google.com
https://example.com
https://cloudflare.com
network-switch1
network-switch2
corerouter01

In order we have a few examples of valid IP addresses, a few valid URLs (for best results please use the full URL including http/https), and some network hosts if configured on your private network. Here is the output after running the script against this example document:

Hostname              : Status    : Method    : Timer
8.8.8.8               : ONLINE    : ping      :
1.1.1.1               : ONLINE    : ping      :
8.8.4.4               : ONLINE    : ping      :
https://google.com    : ONLINE    : cURL      :
https://example.com   : ONLINE    : cURL      :
https://cloudflare.com: ONLINE    : cURL      :
network-switch1       : OFFLINE   : ping      : 00:00:16
network-switch2       : OFFLINE   : ping      : 00:00:16
corerouter01          : OFFLINE   : ping      : 00:00:16

Obviously, the internal hostnames show as "OFFLINE" because they don't exist in my local network. But if I had something named "corerouter01" specified in my /etc/hosts file then it would return ping.

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.