Results 1 to 3 of 3

Thread: Network availability monitor for load balancing

  1. #1
    Join Date
    Jul 2019
    Beans
    3

    Network availability monitor for load balancing

    Hello everybody!


    I know a bit of linux for a decade and a few years ago I got a NAS which gave me the opportunity to use linux at home. Now I decided to buy a small PC and install Ubuntu on it, and get more used on linux as I move from my Windows server to it some services like Transmission, Tor bridge relay, Squid, OpenDNS and no-ip updaters, etc.


    It's being easier than I expect, but some stuff is trickier. One of them is PRTG, which I use to monitor internet availability.


    I've googled and found some alternative candidates, but I'd like to try to go further. I have 2 IPSs load balanced by a Cisco RV340. I'm looking for some way to distinctly monitor each of them.


    The tricky part is that they don't have (ASAIK) any host I could ping from inside their intranet that's unavailable on the internet. I'd need to find a way to know if a ping is going from the right ISP and not the other.


    In example, a given IP is reached in 3 hops from one ISP, and 10 hops from the other. So, if I make some tool ping every minute and for 5 minutes it never gets there in 3 hops, I know that ISP is down.


    Anybody knows any tool that would do that, or has any idea of how I could accomplish it?

  2. #2
    Join Date
    Dec 2006
    Location
    Hamburg, Germany
    Beans
    149
    Distro
    Lubuntu 19.04 Disco Dingo

    Re: Network availability monitor for load balancing

    ping -i <interval> (in seconds) sets the time between two consecutive pings combined with -c <number of pings> and -W timeout
    Use a timer which calls your ping in the intervals you want. You can use cron/anacron or systemd timers.
    And the output to be redirected to a log and process the stdout/stderr (For systemd timer, ExecStopPost attributee in unit file described in the manual system.service(5) might help). The TTL value coming from ping (in stdout/stderr) could be evaluated as well.

    Could these tools help you?
    Last edited by pencuse; 1 Week Ago at 05:34 AM.
    Dell Latitude E7440 (since Dec 2017). CPU: Intel Core i7-4600U, 2 cores, 4 threads; HDD: PM851 256 GB SSD; RAM: 8 GB DDR3L; Graphics: Intel HD 4400
    Dual-boot /dev/sda5: Lubuntu 19.04, /dev/sda6: Arch Linux

  3. #3
    Join Date
    Jul 2019
    Beans
    3

    Re: Network availability monitor for load balancing

    Thanks!

    I dediced to use hc-ping.com for monitoring, but I may change because it doesn't seem to have any carts or statistics to see availability over time, it's oriented on notifying us if any monitor goes down. Any suggestion would be greatly appreciated.

    Anyway, I used the following code

    Code:
    if fping -c 1 -t 7 187.115.215.xxx &> /dev/null
    then
       curl -s https://hc-ping.com/123456789 &> /dev/null
    fi
    It uses fping into the closest host on one of my ISPs, and gives 7s for timeout. If it doesn't timeout, its WAN was used therefore it's up.

    Sadly my RV340 gives precedence to WAN1 for pings, and all pings and trace routes I run always go to WAN1 unless it's down, so I can't test ISP2.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •