Hi folks
I finally have my second node installed and running here in Central Virginia (www.cvadn.net)! As I open the net up for local hams to connect, I would like to know who is using the network. Has anyone figured out how to get an alert when a node connects to the mesh?
Thanks much. Mike KQ9P
I finally have my second node installed and running here in Central Virginia (www.cvadn.net)! As I open the net up for local hams to connect, I would like to know who is using the network. Has anyone figured out how to get an alert when a node connects to the mesh?
Thanks much. Mike KQ9P
What alert mechanism are you thinking about???
Thanks. Mike KQ9P
Mike KQ9P
#!/usr/bin/python
import urllib, json, sys
url = "http://" + sys.argv[1] + ":8080/cgi-bin/sysinfo.json?hosts=1"
sysinforaw = urllib.urlopen(url)
sysinfo = json.loads(sysinforaw.read())
hosts = sysinfo['hosts']
hosts.sort()
for i in hosts:
if i['name'] != 'localhost':
print i['name'],
Mike,
Looking at the json report from the node as well as the output of your script, you should be aware that both node names and advertised hosts are included. Thus, you will see not only nodes coming and going, but hosts that become advertised and unadvertised. This may not be a problem for you now, but as your network grows, you could get a lot of chatter.
Mark
For testing purposes I added a node (temporarily) that is a neighbor to my other two nodes here at the QTH. I used its IP address to enter a subnet as (10.96.143.0/24) and set the scan to every hour. to test the DISCOVERY plugin. So far it has not been discovered but I'll wait another hour to see but as I said I don't think the DISCOVERY plugin is a realistic tool.
Cacti also has an unsupported (user provided) plugin called DPDISCOVERY. It does not require the entry of the subnet. I have it installed but not sure how correctly configure it or what its method of discovery is. Poor documentation. I also set it to scan every hour but so far nothing shows up in the discovered list.
I know of no new nodes that have been set up on our overall network so I reset CACTI after adding my temporary node into the mix to see if either of these discovery tools work. I will post results here.
Honestly, I don't think either of these tools is suitable as they both have to scan and report where something like KQ9P has set up makes more sense. Maybe I should install ZABBIX and do the same. I'm not a programmer and have limited familiarity to Linux and tools. It would be nice if someone were to develop something we all could use.
--
Bob, W7REJ
--
Bob, W7REJ
(I specifically called the logo, as, a request for it does not invoke the cgi processor like /cgi-bin/sysinfo.json (or similar) would.)
If it returns with a response 200, then, it's a NODE! Yes, there's a remote chance that some could have a webserver running on port 8080 and have a file /AREDN.png, but, it's slim.
You would need to maintain a list of "NOT nodes" for your script so that you don't continually test the same non-nodes (for efficiency)
Just an idea.
Here is a bash script I put in cron to periodically generate a list of nodes on the network from the OLSR topology list. I run this on a raspberry pi. If you use a different flavor of linux you might have to fix some of the paths to the commands.
If you keep the previous list of names this script generates and compare it with "diff olsrname.out olsrname.out.previous", it'll tell you who was added and who left. Nodes with "<" were added, nodes with ">" left. You can use this output to notify someone via email, snmp trap, whatever you like.
For example:
$ diff olsrname.out olsrname.out.previous
4d3
< N1NEW.local.mesh
17a17
> K9BYE.local.mesh
John N9ZL
#!/bin/bash
# Script pulls a copy of the topology database from NODE and builds a list of topology destination IPs in olsrip.out.
# It then builds a list of unique node names from the DNS entries for those ips and puts them in olsrname.out.
# John N9ZL 2/1/2017
#
NODE="localnode.local.mesh"
>olsrname.out
#get the topology dump from olsr
/usr/bin/wget -O olsr.out $NODE:9090 2>/dev/null
if [ $? -eq 0 ]; then
#pull out the topology destination ips
/bin/grep "destinationIP" olsr.out | /usr/bin/cut -d: -f2 | /bin/sed 's/"//g' | /bin/sed 's/,//' > olsrip.out
cat olsrip.out | /usr/bin/sort | /usr/bin/uniq | while read IP
do
RESULT=`host -t PTR $IP`
if [ $? -eq 0 ]; then
NAME=`echo "$RESULT" | awk '{print $NF}' | sed 's/.$//'`
echo $NAME
fi
done | /usr/bin/sort | /usr/bin/uniq > olsrname.out
fi
Unfortunately this no longer works with the new (Nightly) builds.
- Mike ab4yy
Thank's
Andre, K6AH