Menu

#370 Importing XLS appends extra 0 to IP numbers

1.0
open
nobody
None
1
2019-10-07
2015-11-20
Viktor
No

Importing an Excell appends extra zero to the IP number. See pictures.

Also Swedish characters åäö ÅÄÖ can't be imported.

1 Attachments

Discussion

  • Viktor

    Viktor - 2015-12-10

    Would be nice if this could be fixed. Tested and the bug still persists on 1.19 rev 044

     
  • Miha Petkovsek

    Miha Petkovsek - 2015-12-10

    Hi Viktor, I do not have this issue, just tested, please see attachments after import.

    Regarding swedisc characters I think it is a excel problem (direct input is possible), I remember having them some time ago (unable to support UTF8 or similar).

     

    Last edit: Miha Petkovsek 2015-12-10
  • Viktor

    Viktor - 2015-12-14

    Sadly, it doesn't work for me. Neither with XLS or CSV. I'm using Compatibility mode on the XLS, 97-2003 mode. Same as the template one can download via IPAM.

    If I try using CSV all the rows gets marked as invalid, if I try to import anyways I get some scalar value error. Nothing is imported.

    And if I use XLS I get an extra 0 in the end of the IPs.

    See the pictures I'll include.

    Here's how my CSV looks like:
    ip address;ip state;description;hostname;mac;owner;device;port;note;Customer number
    192.168.100.1;Active;Gateway;;;1234567890;;;Address 1, City 1;12345
    192.168.100.2;Active;Testcompany 1;;;1234567891;;;Address 1, City 2;12346
    192.168.100.3;Active;Testcompany 2;;;1234567892;;;Address 1, City 3;12347
    192.168.100.4;Active;Testcompany 3;;;1234567893;;;Address 1, City 4;12348
    192.168.100.5;Active;Testcompany 4;;;1234567894;;;Address 1, City 5;12349
    192.168.100.6;Active;Testcompany 5;;;1234567895;;;Address 1, City 6;12350
    192.168.100.7;Active;Testcompany 6;;;1234567896;;;Address 1, City 7;12351
    192.168.100.8;Active;Testcompany 7;;;1234567897;;;Address 1, City 8;12352
    192.168.100.9;Active;Testcompany 8;;;1234567898;;;Address 1, City 9;12353
    192.168.100.10;Active;Testcompany 9;;;1234567899;;;Address 1, City 10;12354
    192.168.100.11;Active;Testcompany 10;;;1234567900;;;Address 1, City 11;12355
    192.168.100.12;Active;Testcompany 11;;;1234567900;;;;12356
    192.168.100.13;Active;Testcompany 12;;;1234567902;;;Address 1, City 13;12357
    192.168.100.14;Active;Testcompany 13;;;1234567903;;;Address 1, City 14;12358
    192.168.100.15;Active;Testcompany 14;;;1234567904;;;Address 1, City 15;12359
    192.168.100.16;Active;Testcompany 15;;;1234567905;;;Address 1, City 16;
    192.168.100.17;Active;Testcompany 16;;;1234567906;;;Address 1, City 17;
    192.168.100.18;Active;Testcompany 17;;;1234567907;;;Address 1, City 18;
    192.168.100.19;Active;Testcompany 18;;;1234567908;;;Address 1, City 19;
    192.168.100.20;Active;Testcompany 19;;;1234567909;;;Address 1, City 20;
    192.168.100.21;Active;Testcompany 20;;;1234567910;;;Address 1, City 21;
    192.168.100.22;Active;Testcompany 21;;;;;;;12366
    192.168.100.23;Active;Testcompany 22;;;1234567912;;;Address 1, City 23;12367
    192.168.100.24;Active;Testcompany 23;;;1234567913;;;Address 1, City 24;12368
    192.168.100.25;Active;Testcompany 24;;;1234567914;;;Address 1, City 25;12369
    192.168.100.26;Active;Testcompany 25;;;1234567915;;;Address 1, City 26;12370
    192.168.100.27;Active;Testcompany 26;;;1234567916;;;Address 1, City 27;12371
    192.168.100.28;Active;Testcompany 27;;;1234567917;;;Address 1, City 28;12372
    192.168.100.29;Active;Testcompany 28;;;1234567918;;;Address 1, City 29;12373
    192.168.100.30;Active;Testcompany 29;;;;;;Address 1, City 30;12374
    192.168.100.31;Active;Testcompany 30;;;1234567920;;;Address 1, City 31;12375
    192.168.100.32;Active;Testcompany 31;;;1234567921;;;Address 1, City 32;12376
    192.168.100.33;Active;Testcompany 32;;;1234567922;;;Address 1, City 33;12377
    192.168.100.34;Active;Testcompany 33;;;1234567923;;;Address 1, City 34;12378

     
  • Anonymous

    Anonymous - 2015-12-15

    I've had a similar issue it ended up being a problem with not specifying a device in the import file. When I added a "dummydevice" and added that to the import file everything was ok.

     
  • Viktor

    Viktor - 2015-12-16

    Miha, would really appreciate it if you could look into this. The template example you gave "
    phpipam_template_2015-12-10.csv" doesn't match what I get from Import -> Download template in IPAM.

     
  • Viktor

    Viktor - 2015-12-16

    Tested your template, didn't work either. Is there perhaps some problem with the Apache settings?

    I load IPAM this way:

     

    Last edit: Viktor 2015-12-16
  • Viktor

    Viktor - 2015-12-16
    <VirtualHost *:80>
            ServerAdmin noc@myurl.com
            ServerName myurl.com
            ServerAlias ipam.myurl.com
            Documentroot /home/ipam/phpipam-code/
            <Directory /home/ipam/phpipam-code/>
                    AllowOverride all
                    require all granted
            </Directory>
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    
     
  • Miha Petkovsek

    Miha Petkovsek - 2015-12-22

    Viktor, please do the following:

    import 1 host to phpipam, after it is imported click on IP address and note address ID in URL in browser (last number).

    Go to mysql and send me output of:
    select `ip_addr` from `ipaddresses` where `id` = ID;

     
  • Viktor

    Viktor - 2015-12-22

    mysql> select ip_addr from ipaddresses where id = 3156;
    +------------+
    | ip_addr |
    +------------+
    | 3232261121 |
    +------------+
    1 row in set (0.00 sec)

     
  • Miha Petkovsek

    Miha Petkovsek - 2015-12-22

    IP number 3232261121 is equal to IP address 192.168.100.1

    I have no idea where additional 0 comes from. If you look at html code (view source) what do you see for this field ?

     
  • Viktor

    Viktor - 2015-12-23

    Thank you for helping with this weird problem :)

    When I go into the IP it's the correct number but not if I check the subnet (see images). I've tested both Firefox and Chrome, both shows the same.

    There must be some presentation bug in a PHP file? Which should I check?

     
  • Viktor

    Viktor - 2016-02-02

    Tested adding dummydevice, or test to devicename. Didn't work. As you can see the code returns a "0". It's even black.

    So there's some echo which fails.

     
  • Eric

    Eric - 2016-03-18

    I am having the exact same issue, have you found a fix?

    I also have tried importing from CSV and XLS, same issue.

     
  • Anonymous

    Anonymous - 2016-03-21

    It's the "ip state" field what gives you that issue, when you set the tag for an object, replace "Active" for "Used".

    I Hope this solve your problem.

    Claudio.

     
  • Anonymous

    Anonymous - 2016-04-06

    I, too, am having this issue. Using Chrome browser to upload the template.

     
  • Anonymous

    Anonymous - 2016-06-14

    I'm getting this same issue with importing IP Addresses. It only appends a 0 to IP Addresses that are in 'Active' state. Those that are 'Inactive' and 'Reserved' show up correctly. I'm working on the debug.

     
  • Anonymous

    Anonymous - 2019-10-07
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel