rackerlabs/ohai-plugins — pull request #10 by brint (2013-12-13 18:48:32+00:00)
Title: Adding plugin to list all routes on a system

Provides all Linux system routing information in an array of hashes.

Example output:

```
root@ohai-plugins-vagrant:~# ohai -d /vagrant/plugins routes
[
[
"inet",
[
{
"gateway": "10.0.2.2",
"iface": "eth0",
"genmask": "0.0.0.0",
"mss": "0",
"flags": "UG",
"destination": "0.0.0.0",
"window": "0",
"irtt": "0"
},
{
"gateway": "0.0.0.0",
"iface": "eth0",
"genmask": "255.255.255.0",
"mss": "0",
"flags": "U",
"destination": "10.0.2.0",
"window": "0",
"irtt": "0"
},
{
"gateway": "0.0.0.0",
"iface": "eth1",
"genmask": "255.255.255.0",
"mss": "0",
"flags": "U",
"destination": "33.33.33.0",
"window": "0",
"irtt": "0"
}
]
],
[
"inet6",
[
{
"metric": "256",
"ref": "0",
"iface": "eth0",
"use": "0",
"flags": "U",
"destination": "fe80::/64",
"next_hop": "::"
},
{
"metric": "256",
"ref": "0",
"iface": "eth1",
"use": "0",
"flags": "U",
"destination": "fe80::/64",
"next_hop": "::"
},
{
"metric": "-1",
"ref": "1",
"iface": "lo",
"use": "121",
"flags": "!n",
"destination": "::/0",
"next_hop": "::"
},
{
"metric": "0",
"ref": "1",
"iface": "lo",
"use": "10",
"flags": "Un",
"destination": "::1/128",
"next_hop": "::"
},
{
"metric": "0",
"ref": "1",
"iface": "lo",
"use": "0",
"flags": "Un",
"destination": "fe80::a00:27ff:fe5c:5eb7/128",
"next_hop": "::"
},
{
"metric": "0",
"ref": "1",
"iface": "lo",
"use": "0",
"flags": "Un",
"destination": "fe80::a00:27ff:fe88:ca6/128",
"next_hop": "::"
},
{
"metric": "256",
"ref": "0",
"iface": "eth0",
"use": "0",
"flags": "U",
"destination": "ff00::/8",
"next_hop": "::"
},
{
"metric": "256",
"ref": "0",
"iface": "eth1",
"use": "0",
"flags": "U",
"destination": "ff00::/8",
"next_hop": "::"
},
{
"metric": "-1",
"ref": "1",
"iface": "lo",
"use": "121",
"flags": "!n",
"destination": "::/0",
"next_hop": "::"
}
]
]
]
```