I did the install from VM and so far i'm loving this! great work, but few questions. I had to put IP addresses in the devicelist.csv file like this 172.18.127.1,arp which works fine, but the field "Last Switch" shows up as 172 how can I get the NetDB to pull the name correctly? we do not have our switches attached to a DNS record or anything like that. Just making sure i'm not missing a step.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If these are Cisco switches, you can try putting this in the netdb.conf file:
gethost = 1
If they are other devices, unfortunately the only way is to either add their names to /etc/hosts and use those in your devicelist.csv file, or to add DNS entries to for your network gear. I know it’s work, but there are many advantages to having your gear in DNS (especially with reverse lookups).
I did the install from VM and so far i'm loving this! great work, but few questions. I had to put IP addresses in the devicelist.csv file like this 172.18.127.1,arp which works fine, but the field "Last Switch" shows up as 172 how can I get the NetDB to pull the name correctly? we do not have our switches attached to a DNS record or anything like that. Just making sure i'm not missing a step.
If the names are populating, it’s going to be a little difficult to rename your old data, but it could be done with a script.
First you would need to drop all the new data, and then rename each old IP to the new name. You would have to write a script to do this though, since the old data is already in the database.
That would drop the new conflicting data, and then rename the old data to the new name. Otherwise they are simply conflicting. Try that for once switch and you might have to see what you can come up with. There’s no built-in method for this unfortunately.
i just checked and gethost = 1 was turned on with # removed. Anything command wise I need to have on the switch? odd thing is it pulled the name for some and not others.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This feature is only partially supported, depending on the switch model. By far the preferred solution is an /etc/hosts entry or a DNS entry. I apologize for the difficulty, but unfortunately this was the way it was designed. gethost was a bit of a hack…
i just checked and gethost = 1 was turned on with # removed. Anything command wise I need to have on the switch? odd thing is it pulled the name for some and not others.
oh no worries! just making sure i'm doing everything correct. I have no issues doing the host file, just to make sure I add the correct entry into the host file should it look like this?
devicelist.csv
172.18.127.1
in /etc/host
172.18.127.1 Switch-1st-Floor
or
172.18.127.1 Switch-1st-Floor.switch.com
?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All good except for the devicelist.csv file, it would need to contain the name now. Then everything should populate with the name. Note that hostnames are unfortunately case-sensitive in NetDB, so make sure your hosts entries match the switch prompt exactly, such as Switch-1st-Floor# Otherwise performance will suffer...
oh no worries! just making sure i'm doing everything correct. I have no issues doing the host file, just to make sure I add the correct entry into the host file should it look like this?
good news is hosts file and using switch name works! here is my next question. Its getting the DNS names for some of the pc's but most of it still shows just the IP of the device that is patched in on the port. What would cause this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This will all depend on your reverse DNS setup locally. On the netdb server, if you do host 1.1.1.1 for one of your IP addresses that is working and on that is not, you should see a response for one and not the other. On your DNS/DHCP server side, you would need to have dynamic DNS enabled across the board for this to work. Otherwise, netdb has no way to resolve the hostname from the IP.
I would talk to your DHCP/DNS admin about this, they should know once you prove that’s what is going on.
good news is hosts file and using switch name works! here is my next question. Its getting the DNS names for some of the pc's but most of it still shows just the IP of the device that is patched in on the port. What would cause this?
yep this was off on the subnet i'm testing on... i just enabled dynamic dns. Will Netdb over write the the IP's for clients from the IP to the correct DNS name? Also how hard would it be to add a feature for logout to the web page?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All the IP addresses should update as long as they are still in the ARP table and there are reverse entries.
As far as the page, it uses Apache for authentication, so it can’t easily be enabled. If you had an existing website that provided this functionality, the tool could be wrapped in it, but currently it’s just not possible without closing the browser.
yep this was off on the subnet i'm testing on... i just enabled dynamic dns. Will Netdb over write the the IP's for clients from the IP to the correct DNS name? Also how hard would it be to add a feature for logout to the web page?
I did the install from VM and so far i'm loving this! great work, but few questions. I had to put IP addresses in the devicelist.csv file like this 172.18.127.1,arp which works fine, but the field "Last Switch" shows up as 172 how can I get the NetDB to pull the name correctly? we do not have our switches attached to a DNS record or anything like that. Just making sure i'm not missing a step.
Jason,
If these are Cisco switches, you can try putting this in the netdb.conf file:
gethost = 1
If they are other devices, unfortunately the only way is to either add their names to /etc/hosts and use those in your devicelist.csv file, or to add DNS entries to for your network gear. I know it’s work, but there are many advantages to having your gear in DNS (especially with reverse lookups).
Good luck,
Jonathan
ok i believe gethost=1 was on by default but i'll look. Also how can I clean out the entire database to start over?
Jason,
If the names are populating, it’s going to be a little difficult to rename your old data, but it could be done with a script.
First you would need to drop all the new data, and then rename each old IP to the new name. You would have to write a script to do this though, since the old data is already in the database.
Here’s how it would work:
echo yes | /opt/netdb/updatenetdb.pl -drop newswitchname
/opt/netdb/updatenetdb.pl -rS ip_address,hostname
That would drop the new conflicting data, and then rename the old data to the new name. Otherwise they are simply conflicting. Try that for once switch and you might have to see what you can come up with. There’s no built-in method for this unfortunately.
Jonathan
i just checked and gethost = 1 was turned on with # removed. Anything command wise I need to have on the switch? odd thing is it pulled the name for some and not others.
Jason,
This feature is only partially supported, depending on the switch model. By far the preferred solution is an /etc/hosts entry or a DNS entry. I apologize for the difficulty, but unfortunately this was the way it was designed. gethost was a bit of a hack…
Jonathan
oh no worries! just making sure i'm doing everything correct. I have no issues doing the host file, just to make sure I add the correct entry into the host file should it look like this?
devicelist.csv
172.18.127.1
in /etc/host
172.18.127.1 Switch-1st-Floor
or
172.18.127.1 Switch-1st-Floor.switch.com
?
Jason,
All good except for the devicelist.csv file, it would need to contain the name now. Then everything should populate with the name. Note that hostnames are unfortunately case-sensitive in NetDB, so make sure your hosts entries match the switch prompt exactly, such as Switch-1st-Floor# Otherwise performance will suffer...
Jonathan
good news is hosts file and using switch name works! here is my next question. Its getting the DNS names for some of the pc's but most of it still shows just the IP of the device that is patched in on the port. What would cause this?
Jason,
This will all depend on your reverse DNS setup locally. On the netdb server, if you do host 1.1.1.1 for one of your IP addresses that is working and on that is not, you should see a response for one and not the other. On your DNS/DHCP server side, you would need to have dynamic DNS enabled across the board for this to work. Otherwise, netdb has no way to resolve the hostname from the IP.
I would talk to your DHCP/DNS admin about this, they should know once you prove that’s what is going on.
Best,
Jonathan
yep this was off on the subnet i'm testing on... i just enabled dynamic dns. Will Netdb over write the the IP's for clients from the IP to the correct DNS name? Also how hard would it be to add a feature for logout to the web page?
Jason,
All the IP addresses should update as long as they are still in the ARP table and there are reverse entries.
As far as the page, it uses Apache for authentication, so it can’t easily be enabled. If you had an existing website that provided this functionality, the tool could be wrapped in it, but currently it’s just not possible without closing the browser.
Jonathan