opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
136 stars 35 forks source link

Extend lenght subnets name attribute #132

Open romano80 opened 6 years ago

romano80 commented 6 years ago

Hi all I need to have more lenght for subnet name, I just changed the lenght on db table but still have a limited lenght. I use a dcm.pl module but it use a standard function of ONA subnet.inc.php file

bye Romano

mattpascoe commented 6 years ago

I'm curious why the current limits are not meeting your needs?

Currently the database allows for 127 characters, and the GUI interface has a limit of 100 characters. I just placed the following subnet name "THIS-IS-MY-REALLY-LONG-SUBNETNAME-AND-IT-SHOULD-BE-ABOUT-THE-LENGTH-OF-100-BUT-I-NEED-25-CHARACTERS" in and it allowed me to put those 100 characters in.

This name is quite long and causes things to align in potentially undesired ways in the display of subnets.

I'm curious to know why this is too short for your use case. At this point I'm not sure I see a need to make it longer.

Thanks

romano80 commented 6 years ago

Hi Matt, I can have subnet name like this

RAT DC D2 NAT POOL ENTRY IS READ BY ANT GBI DWH for 127.0.0.1 | VLAN=VLAN320| VRF=VRF1 VR=grt | S1=de2fff012345s | S2=FwBCat-H4123_4 | SEC=NAT | SECZONE: APPLICATION, ps I don't have problem to insert it by graphics interface but with dcm.pl In any case for my use I need to use name to implement a security zone parameter, I just tried to use a separate custom attribute but I need to load in massive way about 3000-4000 subnets.

mattpascoe commented 6 years ago

My suggestion here would be to not place all of this information into the name field of the subnet. The subnet name will enforce upper case and hyphenated spaces which is likely not desired for this data. The subnet name should be a human friendly description of the subnet.

Most of this information should be defined as a custom attribute. The custom attribute definition also allow you to enforce some standard values if appropriate. Each of these sections in your example would become their own attribute. You will first need to define a custom attribute type (in the admin menu) such as SECZONE.. then you will assign a value to that type for that subnet.

Then if you have thousands to do, I would simply create a script to take a csv or similar input and create the specific dcm.pl commands to add the subnet, then add each of the custom attributes. This can easily be done with the dcm.pl tool.

If you still want to update the field length in the database then you would also need to update the following line in the GUI setup. https://github.com/opennetadmin/ona/blob/master/www/winc/edit_subnet.inc.php#L173