Need to monitor Ubiquiti Unifi wifi access points via shell script - AP runs linux and busybox (ash shell)

Need to monitor Ubiquiti Unifi wifi access points via shell script - AP runs linux and busybox (ash shell)

What we are after is the status of the ath1 or wifi0 interface which can be got via ifconfig on the device.  OpManager is running on windows.  Not sure where to start but it sounds like we want to run the ifconfig on the device and parse the output for "up" appearing close to/within one line of "ath0"
An idea of how to do this will give me clues to look at other stats from the device eg with the athstats command which gives detailed packet stats for the wifi interface.
 
Output of ifconfig below
 
BZ.v2.2.5# ifconfig
ath1      Link encap:Ethernet  HWaddr 06:27:22:5F:F5:D0
          UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:5974644 errors:1 dropped:0 overruns:0 frame:0
          TX packets:8820035 errors:0 dropped:3754 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:512625415 (488.8 MiB)  TX bytes:2830912823 (2.6 GiB)





br0       Link encap:Ethernet  HWaddr 00:27:22:5E:F5:D0
          inet addr:172.16.3.39  Bcast:172.16.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:38982341 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1202105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2298522531 (2.1 GiB)  TX bytes:522909018 (498.6 MiB)





br0.85    Link encap:Ethernet  HWaddr 00:27:22:5E:F5:D0
          inet addr:192.168.31.15  Bcast:192.168.31.255  Mask:255.255.255.0
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:1076812 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:60561525 (57.7 MiB)  TX bytes:5290 (5.1 KiB)





eth0      Link encap:Ethernet  HWaddr 00:27:22:5E:F5:D0
          UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:14697933 errors:51880 dropped:51658 overruns:0 frame:55
          TX packets:6503619 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1679197467 (1.5 GiB)  TX bytes:1077580586 (1.0 GiB)




eth0.85   Link encap:Ethernet  HWaddr 00:27:22:5E:F5:D0
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:8524455 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5301514 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2701938924 (2.5 GiB)  TX bytes:519431524 (495.3 MiB)




lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:27 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6491 (6.3 KiB)  TX bytes:6491 (6.3 KiB)





wifi0     Link encap:Ethernet  HWaddr 00:27:22:5F:F5:D0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:39329 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:48 Memory:b0000000-b0010000






 
                New to ADManager Plus?

                  New to ADSelfService Plus?