Giter Club home page Giter Club logo

monitor-log's Introduction

monitor-log

This script monitors a site and url, optionally checking that it contains a string value.

All output from this command is piped directly to stdout.

Getting Started

Note: this script relies on bash. It cannot be run as sh.

  1. Clone or download this repo.
  2. Copy the .env.example file to .env and configure. Each configuration option is commented inline.
  3. Run the command in a screen session, configure it with systemd, or run with nohup.

Is it working?

You can check if the script is working by sending SIGUSR1 to the process. When the script starts, it politely prints out its PID along with the suggested kill script to send the signal. This will output a handy "It's working" along with a timestamp to stdout (so check whatever log file you're piping to).

What does it run?

The script is designed to run debugging in under 5 seconds. Currently, it executes the following scripts (in order) with optimizations for fast running:

  1. diff to compare the expected string to the returned string
  2. tcpdump to show the traffic during the curl request
  3. traceroute to show the current path to the server
  4. ping to show if the host is up

What will I get?

You'll get the output of these commands, along with timestamps of when things went down and when they came back up.

Here's an example file produced by temporarily overriding the DNS of google.com to 127.0.0.1 in my /etc/hosts file.

monitor-log's People

Contributors

cjcodes avatar

Stargazers

 avatar

Watchers

 avatar

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.