NeDi Software Specific > Discovery

Direct update MAC to IP address mapping

(1/1)

ageldenberg:
Hello, NeDi gurus

Is there a way to update IP address of a specific MAC address directly in the database from a command line?

I may be able to use APIs to receive device information from Meraki cloud controller.  I can then use that information to update NeDi database with MAC-to-IP address mappings, if it is possible.

I will greatly appreciate your help.

rickli:
You could create a CSV and import it with an SQL command to the nodarp table (or nodnd for IPv6).

You could also look at the ArpWatch function in libmisc.pm and adapt it to read an output file from that cloud controller...

ageldenberg:
Rickli,

Thanks a lot for your comment.  If you can give me a sample of a sql command to update the table you mention, it would be great.

Regards,

Alek Geldenberg

rickli:
Here's a generic example you can execute on a mysql prompt (make sure the CSV has the same column order as nodarp):

LOAD DATA INFILE '/tmp/discounts.csv'
INTO TABLE discounts
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;

Navigation

[0] Message Index

Go to full version