Remote Office Connection Monitor



  • Not really related to pfSense but has anyone run across a free/cheap cloud based connection monitor that monitor connectivity to a remote agent? Such as if you have ever used a Nest Cam and you unplug it then you will get an email/push notification that it hasn't check in shortly after. I've seen fingbox and monitor-io but reviews are not great.



  • @ex1580 uptimerobot.com is what I use for lots of things like that. Notifications, and CSV exports.
    Good for things like forcing isp to do their job.🙂



  • Yeah, uptimerobot is good for website monitoring but I was looking for something more like a local agent that would check in with a website so it can monitor an internal servers ability to connect to the web without having to open any firewall ports. Does that make sense?



  • @ex1580 OK, so to be clear. You want a server to run a process that will do a port 80/443 connection periodically to a site or sites, and report back on success/failure?

    If so, and you are running windows, I maintain a repository of scripts and other goodies for MSPs to use in monitoring their customer assets here. It accompanies our slack.

    I wrote a PS script to do exactly this a while back located here, that has specific port functionality as a command-line switch. In the script you define your SMTP gateway to have alerts sent to.

    At the time of writing, I did it for a NinjaRMM user (hence the text you can edit out), but it also writes to the Event Log-which you can also customize to meet your needs.

    The part that the destination/target port is defined is here (line 118):

        $Socket = New-Object Net.Sockets.TcpClient
        $Socket.Connect($hostName, $port)
        $ErrorActionPreference = 'Continue'
        if ($Socket.Connected) {
            if ($debugging -eq $true) {
                echo "port $port is open!"
            }
        $Socket.Close()
    

    As you can see at the top, where the commend-line arguments are, the script defaults to 80, but can be overridden like the rest:

    #####
    #
    # usage: .\Test-ConnectionPort.ps1 <-h|-hostName fred> <-p|-port 123> [-e|-email] [-d|-debugging]
    #
    # notes: 
    # - The command line options -e (or -email) and -d (or -debugging) are optional flags/switches
    # - The command line options -h (or -host) and -p (or -port) are mandatory values
    #
    param (
     	[alias("h")]
     	[Parameter(Mandatory = $true)]
     	[string]$hostName = "localhost",
     	[alias("p")]
     	[Parameter(Mandatory = $true)]
     	[ValidateRange(0,65535)]
     	[int]$port = 80,
     	[alias("e")]
     	[switch]$email = $false,
     	[alias("d")]
     	[switch]$debugging = $false
    )
    #
    #####
    

    If this suits your needs, let me know if you need help with it.

    pat
    :)



  • @BogusException If I were running Windows it would be easy because there are lots of tools for this, haha. I am trying to do it on a Raspberry Pi though. So I would want a script on the pi that would logon to a cloud server and touch a file (there are probably better ways to do this with an API) and if the file hasnt been touched in say 10 min an email alert is sent to me that my pi hasnt checked in. I could probably spin up a VPS for this but it seemed easier to look for something a little more purpose built.



  • @ex1580 Oh! Well, a microprocessor platform like the RPi is certainly a good way to go. I thought you said you wanted to run an agent on the machine.

    If this is all that you are doing with the raspberry pi, you might want to consider the ESP-32, which has Wi-Fi capability dual processors and can do a little bit of real time signal processing, which is what I'm designing it for as a remote device, hanging off a USB port for power.

    What I am making is able to determine if Wi-Fi access points are up or not, as well as normal networking, etc. Depending on the core and the platform that you're using, the raspberry pi could be considered overkill, especially when you consider it's heavy power requirements and price. The ESP platform is a fantastic way to get into this without having the expense of the raspberry pie. I don't have any code handy to do exactly what you're asking. But it is certainly easy enough to throw together if you know what you're doing on that thing.

    Sorry for the confusion



  • I think i'm going to try this Raspberry Pi SMS project to solve this issue because I dont like the idea of the recurring cost for a VPS. https://escapologybb.com/send-sms-from-raspberry-pi/

    I can easily create a script to ping google.com through my primary gateway and if it fails send a text message through a 3G modem with prepaid SIM. If I had more to monitor or wanted to spend more money there are a ton of other solutions but very few for this one simple task of making sure things on my internal network can reach the internet and alert me if they cannot. I got the idea after looking at SMSEagle.



  • @ex1580 the RPi it's basically a computer, there isn't much you can't do with it. I write c++ code a la the Arduino core, and can run that code even on an ESP 8266 (though the amazing ESP32 is dropping in price). I try to create devices that can be powered by USB for data center applications.

    But you can use a dirt cheap ESP 8266 to do this via Wi-Fi, the whole unit would be far smaller than your typical wall wart. In fact, you could actually take a USB charger that plugs into the wall, and still fit an ESP 8266 into that same housing, then plug it in wherever you want that has signal.

    Wi-Fi connectivity to the gateway or even a DMZ off pfSense as a firewall has the benefit of also reporting when the wired LAN is down, or if an alternate Wi-Fi gateway or access point comes up. I saw in my project the need-which is similar to the Cisco Meraki-in that it identifies and creates alerts when a new Wi-Fi device is available. The Merakii, though, only does this for Wi-Fi devices that it has identified as also being on the wired LAN.

    I think it is also extremely useful to know when any access point goes up that is not on a list, or goes down from a list of non-access points that should be up.

    As a microcontroller geek, I'm very interested in the progress that you make on the Raspberry PI. I don't program them or own one, because it's less a microcontroller than a computer (and more expensive than a microcontroller), and while I do a lot of PC programming for all the OS' out there, I tend to stick to pure microcontrollers for things like remote sensors and test devices.

    Finally, if you are going with a remote device like this, I will tell you that there is a need for a device even less capable than the raspberry pie that can use the typical sensors that we are used to working with in microcontrollers. For example, knowing when there is water on the floor, or if the temperature coming out of a fan on a particular PC reaches a certain threshold, or [relative] humidity level. I am even developing the ability for the micro controller to analyze ambient noise filtering out fan noise and determining if there is an audible alarm going off in its vicinity. You'd be surprised how many things alarm like that but are not connected to the network.

    There are other things, of course, like being able to detect very large noise, like a boom or a bang to indicate that something has broken or even exploded in the vicinity, which is extremely valuable. You could easily add value to the RPi device by adding more features, is why I mention these.

    But this isn't the place to discuss all of that, so feel free to contact me about this and other things that can extend the sensors used in a data closet.

    pat
    :)



  • @BogusException Yeah, i'm going with the Pi because i'm familiar with it. I know I can stick a 3G modem in there and send SMS messages and a bunch of other stuff if I wanted. You could definitely do this with a PLC but it would be more for me to learn today and my time is limited to say the least. I just want something like an iSocket3G but for my internet, haha. Kickstarter anyone?



  • Just an update on what I ended up doing. I only want to know if the internet is down at my house because there are things that send email notifications and they wont work with no internet, that is all. I had a raspberry pi that wasnt busy so I added rclone and configured it along with a cron script to touch a specific empty file in my google drive every 2 min. I then wrote a google script to check the modified time on that file every 5 minutes and email me if it had not been updated within the past 5 min. A gmail filter can easily forward that to text my phone. Good enough! Although I could have just set the Nest Cam I have back up, I think they push a notification if they havent heard from the camera in 10 min, but I didnt want to use the camera anymore.

    I really wanted something like SMSEagle but the ROI just wasnt there. I dont mind spending some time to learn something and this is just for home. The code was easy but the documentation for some of these things is not great so it's easy to get stuck trying to figure out why something isnt working and it's just "because Google".

    Also, it would have been super easy to just have an open port to monitor with uptimerobot.com. I tend to remove those things if I dont use them however and right now I have no ports open.


Log in to reply