The Network Detect plugin is a simple device/module/interface that pings "virtual devices" to see if they are alive.
To enable the module, select under the Interfaces menu "Network Detect":
From DomotiGa 1.0.020 this plugin also supports arp-scan.
For first time usage it is smart to enable Debug apart from "Module Enabled".
Enabling devices to be pinged¶
To have a device, or better said, address to be pinged, you should add an device of the type "Ping" with interface "Network Interface":
Select the Type of the device to the "Ping" and the Interface will be automatically set to "Network Interface".
Under IP Addr. fill in the IP address or host name of the device you want to ping.
|Device||Status||Ping successful||Ping failure|
|Network Device||Status On/Off||On||Off|
|Network Host||Status Up/Down||Up||Down|
|Sony AIBO||Status AIBO||Awake||Sleeping|
Values¶Two values are "returned":
- value 1, "status", can be Up/Down, On/Off or Awake/Sleeping, see above
- value 2 is giving the average ping value that is read from the output of ping:
$ ping -c2 172.20.0.1 PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data. 64 bytes from 172.20.0.1: icmp_req=1 ttl=64 time=0.681 ms 64 bytes from 172.20.0.1: icmp_req=2 ttl=64 time=0.505 ms --- 172.20.0.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.505/0.593/0.681/0.088 msHere value 2 will be 0.593
The status can be used in Events as trigger. You could for instance send an email if a goes down or even power cycle the host.
The average ping value can be used to plot the average ping time using the RRDTool module. For this, see Adding a graphs for a device value.
If you have enabled Arp-Scan, the plugin does a local network scan to see which arp request are answered, it then looks for all devices in the database which are of type Arp-Scan and check if they are found in the arp-scan output, if so their status is set to, Up, On, Home depending on devicetype.
To use arp-scan you have to install the command package, and allow normal users to run it as root by settings the 'sticky bit'
sudo apt-get install arp-scan sudo chmod +s /usr/bin/arp-scan
Note: Arp-Scan can only be used for local networks, no mS time is returned, so it's just there or not there.For the Arp-Scan Device field there are three options:
|Device||Status||Scan successful||Scan failure|
|Network Device Arp-Scan||Status On/Off||On||Off|
|Network Host Arp-Scan||Status Up/Down||Up||Down|
|Mobile Device Arp-Scan||Status Home/Away||Home||Away|
- Enable Debug for Devices: Setup -> Main, activate the Devices checkbox
- Enable Debug for Network Ping, see above
- Wait for a while and open the debug log
- You should see every 300 seconds (5 minutes) something like:
2014/07/26 12:07:24 [Devices] Interface with name 'Ping Socket' has id '5' 2014/07/26 12:07:24 [Ping] Checking 'router' with address '172.20.0.1'. 2014/07/26 12:07:25 [Devices] ValueUpdate called for device with id '77' valuenum '2' and value '0.552' 2014/07/26 12:07:25 [Devices] Device change triggered for device with id '77' and value2 '0.552' 2014/07/26 13:07:25 [Ping] Device with id '77' is 'Up'.
- If you do not see the first line, Network Ping is not enabled
- If you do not see lines with [Ping], no Ping socket devices are enabled, see above how to add them