How can I create an output file from ARP in json format?
I have a raspberry pi running openremote2 and want to format an output file that openremote understands - here is an example
{
'command':'ELAPSE',
'value':53680,
'mute':1,
'shuffle':0,
'repeat':0,
'play':1,
'volume':0,
'TotalTime':0,
'favstatus':0
}
so the arp command looks like this:-
sudo arp-scan 192.168.0.5-192.168.0.5
and the output look like this:-
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
1 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 1 hosts scanned in 1.684 seconds (0.59 hosts/sec). 0 responded
when the device is powered up I get this:-
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.0.5 08:eb:74:9e:00:f4 (Unknown)
2 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 1 hosts scanned in 1.405 seconds (0.71 hosts/sec). 1 responded
The plan here is to create an output file that either contains or doesn't contain the IP which denotes whether the device is on the network or not IE-powered up.