Turning a Raspberry Pi into a network monitoring device - Page 1
Forum section: electronics / general

author: Halcyon
author_rank: Unknown
timestamp: June 14, 2017, 08:59:25 am
content: I have a RPi model B which I want to turn into a network monitoring device. I mainly want it to record any instances where internet access is down (via a simple ping to a number of IP addresses) but also monitor internal servers.I've had a play with both Nagios and Icinga and both seem to be fairly complex and overkill for what I need.I'm not a Linux person so I'd rather not have to go editing config files everytime I want to add a device to be monitored or make a change (everything should be accessible via a web console).Does anyone have any recommendations?

author: Lord of nothing
author_rank: Super Contributor
timestamp: June 14, 2017, 09:36:45 am
content: How about a linux/ pi community?

author: borjam
author_rank: Unknown
timestamp: June 14, 2017, 10:57:28 am
content: I would recommend Smokeping.It can ping several hosts (you will still have to edit a configuration file, but it's not difficult) and it keeps nice graphs of packet loss and delay.It's also capable of checking other services such as DNS servers, web servers, etc.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 14, 2017, 11:07:08 am
content: https://uptimerobot.com/For local network maybe Nagios, but I think most people use SNMP for this. Since when you're looking for uptime of local devices you're probably looking at costly downtimes, so you do not want to mess around with an rpi.Maybe you get most luck when you ask here:https://softwarerecs.stackexchange.com/orhttps://superuser.com/

author: technix
author_rank: Super Contributor
timestamp: June 14, 2017, 11:10:49 am
content: cron + a shell two-liner?

author: BradC
author_rank: Super Contributor
timestamp: June 14, 2017, 12:22:53 pm
content: I use mon, mainly to keep an eye on some cheap CCTV cameras that need periodic restarts, some remote servers, VMs and misc stuff (like SMTP). Dead easy to set up. Bugger all features, but then all I want is a mail when things are down with when they went down and what is down, then when they come back up.

author: Red Squirrel
author_rank: Super Contributor
timestamp: June 15, 2017, 12:46:55 am
content: I did this but with an Arduino which plugs into a server, I eventually want to expand this project as everything in my case is mostly hard coded. I want to make it more expandable so you can just add more "cards" for expansion and longer distance links with more expansion etc and monitor a multitude of things. Basically Netguardian without the Netguardian price tag.For now I monitor battery voltage, AC power failure, hydrogen levels and mouse traps. Have a separate other board for hvac control and temperature. Eventually I'll combine it all into my project. Have not started on it yet though. My current monitoring screen looks like this:It also shoots emails depending on how I setup the alarm points. That part of the software is quite modular, I can setup any type of alarm point I want as long as I can get the input from a Linux command. It can be reading/parsing a file, or pretty much anything, as long as it returns a number, I can monitor it. The physical sensors simply consist of a basic python script (I don't even know python, I just googled for what I needed to do lol) that reads the serial output of the arduino and the hvac controller and puts it in a file. It also puts the date. I can then monitor for poll failure if the date is too old.If you don't want to code your own solution for network monitoring there's lot of tools like Pandora, Nagios, Observium, etc.

author: Halcyon
author_rank: Unknown
timestamp: June 15, 2017, 08:33:43 am
content: Thanks for all your suggestions guys.Quote from: borjam on June 14, 2017, 10:57:28 amI'll check it out. Thanks.Quote from: Jeroen3 on June 14, 2017, 11:07:08 amGood suggestion but testing hosts every 5 minutes is too long. For my application I need maximum 30 seconds between pings.Quote from: technix on June 14, 2017, 11:10:49 amYou're talking another language. I'm really a Linux noob. I only know the very basics.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 15, 2017, 09:04:36 am
content: Pingdom.comcan do 1 minute. But it's not free anymore.Sure you can do some python, can't you?Code:import osimport timewhile(1):hostname = "google.com" #exampleresponse = os.system("ping -c 1 " + hostname)#and then check the response...if response == 0:print hostname, 'is up!'else:print hostname, 'is down!'sleep(30)Python is very popular, you can literally copy&paste your program together by searchingthe bible.