# Need Help!

**URL:** <https://www.ruby-forum.com/t/need-help/164892>\
**Category:** Rails\
**Created:** [April 7, 2009, 4:31am UTC](https://www.ruby-forum.com/t/need-help/164892 "2009-04-07T04:31:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vgenjr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/9dc877/32.png) [@vgenjr](https://www.ruby-forum.com/u/vgenjr)\
**Post date:** [April 7, 2009, 4:31am UTC](https://www.ruby-forum.com/t/need-help/164892/1 "2009-04-07T04:31:10Z")

</div>

hi…

i’m new at ruby on rails…  
first i have a table with a column named status(this column use to store  
a status of an access point (“online” or “offline”) after my application  
have done pinging the access point)

i use a net-ping library…

## how can i update the data in column status “automatically”.

can somebody explain this code?

```
  @nodestat = Node.all.map do |node|{
      :Status => PingExternal.new(node.ipadd)? "Online" : "Offline"}
  end

```

and why the status always “Online”

Any ideas would be very gratefully received!

Thank You.

---

<div class="post-metadata">

**Author:** ![vgenjr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/9dc877/32.png) [@vgenjr](https://www.ruby-forum.com/u/vgenjr)\
**Post date:** [April 7, 2009, 9:47am UTC](https://www.ruby-forum.com/t/need-help/164892/2 "2009-04-07T09:47:22Z")

</div>

Few things come to mind here.  
I’ve done this exact app before.  
I keep my devices in a table. The Rails app just displays the  
information  
from the table. A background daemon does the actual monitoring.  
I get alot more details in my version, including mapping what mac/ip  
address are on  
which switch port, and using SNMP to the switch to do discovery of  
devices.

The moral of this is break you ping into a separate process/task. Then  
poll yours AP’s  
and update there status with ActiveRecord.

If you need some help, I can certainly give you some pointers.

glennswest at yahoo dot com dot sg

> **[Mental Paging Space](http://mentalpagingspace.blogspot.com)**
>
> A place to park ideas, inspire suggestions and makes notes for the future.

On Apr 7, 10:31 am, Junior Junior wangsa \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![vgenjr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/9dc877/32.png) [@vgenjr](https://www.ruby-forum.com/u/vgenjr)\
**Post date:** [April 7, 2009, 9:53am UTC](https://www.ruby-forum.com/t/need-help/164892/3 "2009-04-07T09:53:15Z")

</div>

On Apr 7, 3:31 am, Junior Junior wangsa \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> can somebody explain this code?
> 
> ```
> @nodestat = Node.all.map do |node|{
> :Status => PingExternal.new(node.ipadd)? "Online" : "Offline"}
> end
> 
> ```

A brief overview of the docs (and general convention) suggests that  
PingExternal.new doesn’t do a ping, it just creates a pinger object -  
all you are testing is whether that new object was nil or not.

Fred

---

<div class="post-metadata">

**Author:** ![vgenjr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/9dc877/32.png) [@vgenjr](https://www.ruby-forum.com/u/vgenjr)\
**Post date:** [April 7, 2009, 10:08am UTC](https://www.ruby-forum.com/t/need-help/164892/4 "2009-04-07T10:08:29Z")

</div>

I’ve added a blog article of my network scanner.  
If you need further help let me know.

> **[Network Monitor as a Windows Service in Ruby](http://mentalpagingspace.blogspot.com/2009/04/network-monitor-as-windows-service-in.html)**
>
> In reading thru the Ruby Google Group, there seems to be a lot of misconceptions about what should be done inside of a Rails process and wha...

On Apr 7, 10:31 am, Junior Junior wangsa \<rails-mailing-l…@andreas-
