facundovictor / latency-sensor

Simple latency sensor, useful for remote wireless links.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

latency-sensor

Simple latency sensor, useful for remote wireless links. It parses the latency reported by the ping tool, and if the values exceeds the configured thresholds a mail to the admin will be sent with the html formatted data.

Requirements:

  • sendmail command (As a MTA or as a MUA with ESMTP).

How to use it?

  1. git clone https://github.com/facundovictor/latency-sensor.git

  2. chmod 500 sense.awk

  3. Edit the ip.conf file. The scripts reads it, and for every line, it parses the following fields (separated by one single space):

<Host description> <IP/FQDN> <Tolerance threshold of packet loss> <Tolerance threshold of average packet latency>

  1. Edit the /etc/crontab file to check it. As an example, let's say we need to check it every 15 minutes:

0,15,30,45 * * * * root /opt/sense.awk /opt/ip.conf

  1. Configure the sense.awk script:
# Destination mail
   mail_destination="admin@mydomain.com"
# Amount of echo requests
   attempts=20
# Seconds elapsed between every echo request
   interval=1

Example of an output preview:

Wieless link status (10/01/2016 19:04):

This mail can be received because of an abnormal latency, or a packet lost. The experiment sample is of 20 echo requests .

Description HOST IP Transmitted Received Packet Lost PL Limit Min Max Average Avg Limit Deviation
AP_street_2_3.3 192.168.3.3 192.168.3.3 20 0 100% 0% ∞ ms ∞ ms ∞ ms 8 ms ∞ ms
AP_street_1_2.2 192.168.2.2 192.168.2.2 20 16 20% 0% 1 ms 3 ms 2 ms 8 ms ∞ ms

About

Simple latency sensor, useful for remote wireless links.


Languages

Language:Awk 100.0%