Giter VIP home page Giter VIP logo

netupmon's People

Contributors

danozdotnet avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

netupmon's Issues

OSX Support

To make it work on OSX:
Add this to the detect OS thingy:

    darwin*)
      OS="darwin";
      [[ "$FPING" ]] && PING="fping -c 1 -t $TIMEOUT -u -q" || PING="ping -c1 -t1";; 

here's the OSTYPE if you need it:

[duck@Adria] Scripts$ echo $OSTYPE
darwin15

Also for the date in the ConvertDATE function:
[[ "$OS" == "darwin" ]] && printf "%s" "$(date -r "$1" +"%d/%m/%Y %H:%M:%S")"
(the date command is the same as the BSD one)

fping detection is broken too.

[duck@Adria] Scripts$ type fping 2>/dev/null 2>&1
fping is hashed (/opt/local/sbin/fping)
[duck@Adria] Scripts$ type fping2 >/dev/null 2>&1
[duck@Adria] Scripts$

Changing the line: FPING=$(type fping 2>/dev/null 2>&1)
to: FPING=$(type fobviouslywrongping 2>/dev/null 2>&1)
to make it fail, it still seems to return true. For now I'm running it in ping only mode.

Reset option

An option to reset the counters.

eg. ./netupmon.sh --reset

fping detection

Possible typo on line 34: FPING=$(type fping2 >/dev/null 2>&1)

EdgeRouter:

vbash-4.1$ type fping2 >/dev/null 2>&1
vbash-4.1$ type fping 2>/dev/null 2>&1
fping is /usr/bin/fping

OSX

[duck@Adria] Scripts$ type fping2 >/dev/null 2>&1
[duck@Adria] Scripts$ type fping 2>/dev/null 2>&1
fping is hashed (/opt/local/sbin/fping)

Bonus points: When running the script, announce that it's using fping instead of ping, if the above fails for any reason, it'll go back to using ping, but without letting you know.

When you make the above change, fping will output to the console like so:

vbash-4.1$ ./danozping.sh -t
8.8.8.8 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 10.9/10.9/10.9
4.2.2.2 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 165/165/165
208.67.222.222 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 10.8/10.8/10.8
8.8.8.8 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 10.8/10.8/10.8
4.2.2.2 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 165/165/165
208.67.222.222 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 11.9/11.9/11.9
8.8.8.8 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 9.99/9.99/9.99
4.2.2.2 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 165/165/165
208.67.222.222 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 9.28/9.28/9.28
8.8.8.8 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 9.86/9.86/9.86
4.2.2.2 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 165/165/165
208.67.222.222 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 11.2/11.2/11.2

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.