Kevin Ratcliff
2009-12-16 04:45:06 UTC
Greetings,
I would like to be able to do a SELECT query that will be given a
known MAC address and return the IP address, subnet, and subnet mask
from the postgresql database. All of this information is in the
Netdisco web interface so I presume it can be extracted via a SQL
query, but I don't know enough about the relationships between tables
to do this myself.
I don't need instructions for actually connecting to postgresql, as I
can already do that, I just need to know what SELECT query to run.
Could anyone help with this?
The reason I would like this information is so that I can run a
wake-on-lan script to wake up a group of computers (of which I know
the MAC addresses, but nothing else). They're on different subnets,
and if I understand WOL correctly I need to know the subnet
information to send the "magic packet". I could be mistaken though.
Maybe Netdisco is the wrong tool to use in this case to get the
information, in which case I'm open to suggestions.
Thanks for any assistance!
Kevin
PS - a few months ago I set up the "stolen device tracking" feature in
Netdisco with the MAC address of a computer that was missing from
inventory, and then promptly forgot about it. Today I was surprised to
get an email alert from Netdisco telling me the computer had been
found, along with it's device switch port location! Way cool! It
wasn't stolen, just temporarily misplaced. I don't think this new
feature got very widely publicized on the mailing lists, so if anyone
hasn't checked it out yet you may wish to look into it.
I would like to be able to do a SELECT query that will be given a
known MAC address and return the IP address, subnet, and subnet mask
from the postgresql database. All of this information is in the
Netdisco web interface so I presume it can be extracted via a SQL
query, but I don't know enough about the relationships between tables
to do this myself.
I don't need instructions for actually connecting to postgresql, as I
can already do that, I just need to know what SELECT query to run.
Could anyone help with this?
The reason I would like this information is so that I can run a
wake-on-lan script to wake up a group of computers (of which I know
the MAC addresses, but nothing else). They're on different subnets,
and if I understand WOL correctly I need to know the subnet
information to send the "magic packet". I could be mistaken though.
Maybe Netdisco is the wrong tool to use in this case to get the
information, in which case I'm open to suggestions.
Thanks for any assistance!
Kevin
PS - a few months ago I set up the "stolen device tracking" feature in
Netdisco with the MAC address of a computer that was missing from
inventory, and then promptly forgot about it. Today I was surprised to
get an email alert from Netdisco telling me the computer had been
found, along with it's device switch port location! Way cool! It
wasn't stolen, just temporarily misplaced. I don't think this new
feature got very widely publicized on the mailing lists, so if anyone
hasn't checked it out yet you may wish to look into it.