Node checking shell one-liner

1 view
Skip to first unread message

Russell Senior

unread,
Feb 15, 2018, 5:19:43 AM2/15/18
to ptp...@googlegroups.com
As discussed/requested at the meeting tonight, here is the one-liner I
use to check for changes to node-upness status:

for i in $(seq 10 95) ; do echo $i $(ssh ro...@10.11.252.$i 'cat
/proc/sys/kernel/hostname ; uname -mrsv ; cat /tmp/sysinfo/model') ;
done > nodes-online-$(date +"%Y-%m-%d").log

It needs to be run from a device on a PTPnet network, that is, a
device that can ping 10.11.252.x addresses, and it should have a valid
ssh key deployed on the routers.

For addresses that aren't reachable, you can look up the corresponding
host on iris:/etc/openvpn/leases

A sample day-to-day diff shows changes since last time:

$ diff -u nodes-online-2018-02-13.log nodes-online-2018-02-15.log
--- nodes-online-2018-02-13.log 2018-02-13 02:07:36.722533563 -0800
+++ nodes-online-2018-02-15.log 2018-02-15 02:12:10.319621437 -0800
@@ -2,7 +2,7 @@
11 poop Linux 4.9.77 #0 Tue Jan 30 06:36:44 2018 mips Buffalo
WZR-HP-AG300H/WZR-600DHP
12 turd Linux 4.9.70 #0 Mon Dec 25 18:06:53 2017 mips TP-Link TL-WDR3600 v1
13 when Linux 4.9.70 #0 SMP Mon Dec 25 18:06:53 2017 mips D-Link DIR-860L B1
-14 cat Linux 4.14.18 #0 Sun Feb 11 20:51:24 2018 ppc Meraki MR24 Access Point
+14
15 drank Linux 4.9.72 #0 Fri Dec 29 22:18:45 2017 mips NETGEAR WNDR3800
16 ouch Linux 4.9.58 #0 Tue Nov 14 21:36:46 2017 i586
17
@@ -25,7 +25,7 @@
34 vital Linux 4.9.58 #0 Fri Nov 3 19:04:52 2017 mips TP-Link TL-WDR3600 v1
35 maw Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800
36 wave Linux 4.9.58 #0 Mon Nov 6 02:49:58 2017 ppc Meraki MR24 Access Point
-37
+37 frick Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips TP-Link TL-WDR3600 v1
38 glow Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips Buffalo
WZR-HP-AG300H/WZR-600DHP
39 snow Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800
40 ruby Linux 4.9.58 #0 Tue Nov 14 21:36:46 2017 i586
@@ -36,7 +36,7 @@
45 woof Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800
46 frack Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800
47 vine Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800
-48
+48 dime Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips Buffalo
WZR-HP-AG300H/WZR-600DHP
49 buzz Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800
50 fir Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800
51 ivy Linux 4.9.58 #0 Sun Nov 5 17:52:14 2017 mips NETGEAR WNDR3800

--
Russell
Reply all
Reply to author
Forward
0 new messages