1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TimeCapsule does not appear in /proc/net/arp

Discussion in 'Tomato Firmware' started by hpsmartyz, Apr 25, 2009.

  1. hpsmartyz

    hpsmartyz LI Guru Member

    all,

    I would like to monitor (via Cacti) the number of connected clients (wireline and wireless).
    To do so, for the moment, I read /proc/net/arp and retrieve the number of private IP@.
    Everything works fine except that my TimeCapsule, connected via wireline, does not appear in that file (while other devices, also connected via wireline, do appear).

    Stritcly speaking, it seems that the TimeCapsule does appear in that file but only once every hour and for about 5 to 10 minutes, then it disappears (blue peaks on below graph)
    [​IMG]

    And these peaks seem to correspond to background traffic behaviour on the TimeCapsule (small blue peaks on the graph below (ARP requests?)).
    [​IMG]


    Therefore I have two questions:
    • Would you know why does not the TimeCapsule IP@ stay in /proc/net/arp ?
    • In case my method for getting the connected clients is not the most appropriate one, could you advise me of another one?

    Thanks
     
  2. mstombs

    mstombs Network Guru Member

    That's the way arp works, entries fall out of the list if there is no communication after about 5 mins! Guess you could set up a regular task to ping the device to check it is still there
     
  3. hpsmartyz

    hpsmartyz LI Guru Member

    Hi,

    thanks for your answer.
    So ARP explains the behaviour. What puzzles me a bit is that all other devices stay in /proc/net/arp, but I guess they do communicate with my 54gl.

    So, knowing that I still would like to monitor how many devices are connected (dhcp lease) could you tell me if a variable or file or means exists to do so?

    many thanks.
     
  4. mstombs

    mstombs Network Guru Member

    The Tomato device list web gui merges info from the arp table with that from the dhcp lease file which can be viewed with

    Code:
    # cat /tmp/var/lib/misc/dnsmasq.leases
     
  5. hpsmartyz

    hpsmartyz LI Guru Member

    Hi,

    many thanks!
    So in the end what I did is get the list of dhcp leases and ping the listed devices
    to check if they are up or not, as you suggested.

    Here is my script (which most surely can be improved, but works)
    Code:
    alive_devices=0
    list_ip=`awk '{print $3}' /tmp/var/lib/misc/dnsmasq.leases`
    for i in ${list_ip}; do
            ping_reply=`ping -c 3 -w 5 -q ${i}`
            p_received=`echo ${ping_reply} | awk '{print $15}'`
            if [ "$p_received" -ne "0" ]; then
                    alive_devices=`expr $alive_devices + 1`
            fi
    done
    echo ${alive_devices} > /cifs1/stats/cclients
     

Share This Page