CA Service Management

Expand all | Collapse all

GRLOADER Importing CIs by CSV file to CMDB

Jump to Best Answer
  • 1.  GRLOADER Importing CIs by CSV file to CMDB

    Posted 01-28-2016 02:40 PM

    Hi guys

    we're using SDM 14.1 and trhough GRLOADER i'm pretended to import CIs by CSV file to CMDB. In fact I'm doing something wrong.

     

     

    • The issue is when executing GRLOADER receive this message:

    --------------------------------------------------------------------------------------------------------

    16:00:44.232 CI and Relationship Loader for CA Service Desk Manager R12.9.000

    grCSVrdr9000 Fatal Error - unable to determine object types being imported

     

    Results:

                   Read   Skipped Inserts   Updates    Errors Warnings

    CI                0         0 0         0         0         0

    Relation          0         0         0         0         0         0

     

    GRLoader completed, no data processed.

    16:00:45.639 GRLoader ended

    --------------------------------------------------------------------------------------------------------

     

     

    • This is GRLOADER command execution:

    --------------------------------------------------------------------------------------------------------

    grloader -u account -p password -s http://server:8080 -i c:\temp\prueba.csv -a -n -tf reglas.rul –E

    --------------------------------------------------------------------------------------------------------

     

     

    • This the "prueba.csv" CSV file content:

    --------------------------------------------------------------------------------------------------------

    Este es el contenido del archivo CSV:

    "Type","Name","class","System>Serial Number","GeneralInven_MACAddress_T0016","Network>IP Address"

    1,"CACA-02","Servidor","VMware-42 00 7e b9 eb be 2d 2f-d9 48 93 d6 c3 77 58 ba","00:50:56:80:AB:2E","192.168.0.186"

    1,"xp-client01","Servidor","VMware-56 4d 05 84 13 c3 12 4d-66 99 da 66 86 e5 7c cf","00:0C:29:E5:7C:CF","192.168.0.107"

    1,"xp-client02","Servidor","VMware-56 4d d5 47 5b 8a 1b 32-b2 9c 74 42 fa 50 d1 fe","00:0C:29:50:D1:FE","192.168.0.109"

    --------------------------------------------------------------------------------------------------------

     

     

    • This the "rules.rul" rule file:

    --------------------------------------------------------------------------------------------------------

    <ruleset>

    <rule><attribute>attributename</attribute>

    <from>TYPE</from><to>class</to>

    <from>NAME</from><to>name</to>

    <from>System>Serial Number</from><to>serial_number</to>

    <from>Network Adapter[1st]>MAC Address</from><to>mac_address</to>

    <from>Network>IP Address</from><to>asset_num</to>

    <from>GeneralInven_SerialNumb_T0015</from><to>serial_number</to>

    <from>GeneralInven_MACAddress_T0016</from><to>mac_address</to>

    <from>Network>GeneralInven_IPAddress_T0017</from><to>asset_num</to>

    <rulename>campos</rulename>

    </rule>

    </ruleset>

    --------------------------------------------------------------------------------------------------------

     

     

     

     

    Then, what can be wrong?

    Thank you in advance

    Regards



  • 2.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 01-28-2016 03:40 PM

    Based on your .rul file there is a map for type->class and you have type as the first column in your CSV. It looks like you are asking GRLoader to make a CI with a class named "1", does that exist in your CMDB? There is also a class column in your CSV, that will probably also cause an issue, since you now have two columns mapped to class. I am not sure if you are showing all the column headers in your CSV, but the .rul file has maps for names that don't exist and some map to the same attribute, both may cause GRLoader to not import your data.



  • 3.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 01-28-2016 06:21 PM

    Thank by you reply jmascaro, following your advice i was removed the first column "Type", then tried again but the same error message appear.

    Regards



  • 4.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 01-29-2016 03:12 AM

    In the rules, I see multiple mapping for a few columns, e.g. class, serial_number, mac_address, asset_num.

     

    Any reason this is the case?

     

    How about trying a much simpler rule where there is One-2-One mappings for your fields? This will imply twigging your input CSV file as well.

     

    Let us know if this helps?

     

    Kind Regards,

    Brian



  • 5.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 01-29-2016 09:02 AM

    Totally agree, keep things simple. If you use the actual CI attributes as your column headings you can eliminate the translation file. Something else I noticed about your rules, the ">" is included in some of your strings. In XML ">" is one the special characters and that may be causing an issue as well. I have never used a translation file, but it looks like XML, for that reason I would not use ">" in your column names.



  • 6.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 02-03-2016 04:08 PM

    Thank you jmascaro & Brian_Mathato,

    after to modified mys files i'm try again, but the issue persists:

     

     

    The issue is when executing GRLOADER receive this message:

    --------------------------------------------------------------------------------------------------------

    17:51:42.711 CI and Relationship Loader for CA Service Desk Manager R12.9.000

    grCSVrdr9000 Fatal Error - unable to determine object types being imported

     

    Results:

                   Read   Skipped Inserts   Updates    Errors Warnings

    CI                0         0 0         0         0         0

    Relation          0         0         0         0         0         0

     

    GRLoader completed, no data processed.

    17:51:44.039 GRLoader ended

    --------------------------------------------------------------------------------------------------------

     

     

    This is GRLOADER command execution:

    --------------------------------------------------------------------------------------------------------

    grloader -u account -p password -s http://server:8080 -i c:\temp\prueba.csv -a -n -tf reglas.rul –ad objecttype=ci

    --------------------------------------------------------------------------------------------------------

     

     

    This the "prueba.csv" CSV file content:

    --------------------------------------------------------------------------------------------------------

    Este es el contenido del archivo CSV:

    "TYPE","NAME","GeneralInven_SerialNumb_T0015","GeneralInven_MACAddress_T0016","GeneralInven_IPAddress_T0017","GeneralInven_Host_T0018"

    "Servidores","CACA-02","VMware-42 00 7e b9 eb be 2d 2f-d9 48 93 d6 c3 77 58 ba","00:50:56:80:AB:2E","192.168.0.186","CACA-02"

    "Servidores","xp-client01","VMware-56 4d 05 84 13 c3 12 4d-66 99 da 66 86 e5 7c cf","00:0C:29:E5:7C:CF","192.168.0.107","xp-client01"

    "Servidores","xp-client02","VMware-56 4d d5 47 5b 8a 1b 32-b2 9c 74 42 fa 50 d1 fe","00:0C:29:50:D1:FE","192.168.0.109","xp-client02"

    --------------------------------------------------------------------------------------------------------

     

     

    This the "rules.rul" rule file:

    --------------------------------------------------------------------------------------------------------

    <ruleset>

      <rule><attribute>attributename</attribute>

        <from>TYPE</from><to>class</to>

        <from>NAME</from><to>name</to>

        <from>GeneralInven_SerialNumb_T0015</from><to>serial_number</to>

        <from>GeneralInven_MACAddress_T0016</from><to>mac_address</to>

        <from>GeneralInven_IPAddress_T0017</from><to>asset_num</to>

        <rulename>campos</rulename>

      </rule>

    </ruleset>

    --------------------------------------------------------------------------------------------------------

     

     

    Could you reproduce this issue in your enviroments?

    Best regards



  • 7.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 02-03-2016 05:27 PM

    I copied your csv and rules files to try to replicate your issue in my dev environment, as I suspected the problem is with your rules file. As I stated earlier, I have never used a rules file, but I believe I identified all the issues:

    1. you do not need a translation for "NAME", it's a valid attribute, case is not important

    2. you are missing a translation rule for "GeneralInven_Host_T0018"

    3. each entry is a rule and must be enclosed in it's own <rule> tag

     

    Here is what my rules files looks like:

    <ruleset>

         <rule>

              <attribute>attributename</attribute>

              <from>TYPE</from><to>class</to>

         </rule>

         <rule>

              <attribute>attributename</attribute>

              <from>GeneralInven_SerialNumb_T0015</from><to>serial_number</to>

         </rule>

         <rule>

              <attribute>attributename</attribute>

              <from>GeneralInven_MACAddress_T0016</from><to>mac_address</to>

         </rule>

         <rule>

              <attribute>attributename</attribute>

              <from>GeneralInven_IPAddress_T0017</from><to>asset_num</to>

         </rule>

         <rule>

              <attribute>attributename</attribute>

              <from>GeneralInven_Host_T0018</from><to>host_name</to>

         </rule>

         <rulename>csvrules</rulename>

    </ruleset>

     

    as a result here is what my output XML looks like which confirms the rules file performed the translation:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

    <GRLoader>

        <ci>

            <!--SKIPPING: GRLoader performs no inserts without the -n option-->

            <serial_number>VMware-42 00 7e b9 eb be 2d 2f-d9 48 93 d6 c3 77 58 ba</serial_number>

            <asset_num>192.168.0.186</asset_num>

            <mac_address>00:50:56:80:AB:2E</mac_address>

            <class>Server</class>

            <NAME>CACA-02</NAME>

            <host_name>CACA-02</host_name>

        </ci>

    <GRLoader>

     

    Make these changes to your rules files and hopefully that will resolve your issue. Of course, if you just change your headers in the csv file to match the CI attributes you won't even need a rules file.



  • 8.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 02-04-2016 09:10 AM

    Thank you jmascaro, right now my rule file looks as a your advice but the issue persists with the same message error:

     

    10:54:22.383 CI and Relationship Loader for CA Service Desk Manager R12.9.000
    grCSVrdr9000 Fatal Error - unable to determine object types being imported

     

    i'm trying the execution with this command:

     

    grloader -u account -p password -s http://server:8080 -i c:\temp\prueba.csv -a -n -tf reglas.rul

     

     

    I've present KarenMatoke's advise, and ran the command to this way:

    grloader -u account -p password -s http://server:8080 -i c:\temp\prueba.csv -a -n -tf reglas.rul -ad objecttype=ci

    But the issue persists too.



  • 9.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 02-04-2016 10:06 AM

    Based on the XML created I made some assumptions that were wrong. Since I intentionally left out -n I never actually created any CI's; however when I added -n I discovered the following:

    1. you do need a translation rule for "NAME" to "name"

    2. "host_name" is incorrect, that's the field name, the attribute name is "system_name"

     

    Once I made these changes to my rules file and added -n to the command line I was able to create the CI's. One thing worth mentioning, throughout all my testing I never received the "Fatal Error" that you are seeing. The errors I received were always more informational and indicated what was wrong. I run GRLoader from my PC, not the server and I use a configuration file as follows:

    C:\GRLoader>java -Xmx512M -cp C:\grloader -jar grloader.jar -cfg grl.cfg -E -a -i testci.csv -n -tf rules.rul

     

    I tried a few things to see if I could get the "Fatal Error", but I couldn't. The only attributes required to create a CI are the class and name. I tried leaving those out and using a class that didn't exist (Serverx), but I always received an error message, not "Fatal Error".



  • 10.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Broadcom Employee
    Posted 02-02-2016 03:47 AM

    Hi,

     

    Please try your grloader command again after adding the following parameter:

     

    '-ad objecttype=ci'

     

    Regards,

      Karen



  • 11.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Posted 02-03-2016 03:59 PM

    Thank you KarenMatoke for reply, i'm following your advise but the issue persists.....regards!



  • 12.  Re: GRLOADER Importing CIs by CSV file to CMDB

    Broadcom Employee
    Posted 02-04-2016 09:47 AM

    Hi Eduardo,

    I can't comment on whether or not your rules are correct, but assuming so, you may want to open a support case. Depending on your patch level, you may have hit problem # 3219.

    Regards,

    Karen



  • 13.  Re: GRLOADER Importing CIs by CSV file to CMDB
    Best Answer

    Posted 05-16-2016 05:28 PM

    Hi guys,

    finally this case was solved to this way:

     

    • GRLOADER command

    Grloader -u user -p pass -s http://sdm-server:8080 -csvf Listado_equipos_para_exportar.csv -a -n -tf C:\Uniwork\import v2\zz_reglas.rul -ad class="Hardware" Detectado -ad objecttype=ci -ad is_ci="YES" -T 10 -E

     

    • csv file content

    "NAME","Hostname_Hostname_T0015","Label_Label_T0016","PrimaryMacAd_PrimaryMac_T0017","PrimaryNetwo_PrimaryNet_T0018","SerialNumber_SerialNumb_T0019","GeneralInven_Vendor_T0020","GeneralInven_Model_T0021"

    "8-00023","8-00023","8-00023","00:1A:A0:D9:E5:A9","8-00023.telecel.net.py","F59J0F1","Dell Inc.","OptiPlex 755"

    "8-00024","8-00024","8-00024","00:1A:A0:D9:05:DA","8-00024.telecel.net.py","C59J0F1","Dell Inc.","OptiPlex 755"

    "8-00030","8-00030","8-00030","B8:AC:6F:3B:E9:C8","8-00030.telecel.net.py","1WFWFN1","Dell Inc.","OptiPlex 780"

    "8-00039","8-00039","8-00039","00:24:E8:29:96:7F","8-00039.telecel.net.py","77RKVK1","Dell Inc.","Vostro 420 Series"

    "8-00040","8-00040","8-00040","00:1E:4F:92:6B:11","8-00040.telecel.net.py","CF1WDF1","Dell Inc.","OptiPlex 755"

     

    • rul file content

    <ruleset>

      <rule>

        <attribute>attributename</attribute>

          <from>Hostname_Hostname_T0015</from><to>serial_number</to>

      </rule>

      <rule><attribute>attributename</attribute>

        <from>Label_Label_T0016</from><to>asset_num</to>

      </rule>

      <rule><attribute>attributename</attribute>

        <from>PrimaryMacAd_PrimaryMac_T0017</from><to>mac_address</to>

      </rule>

      <rule><attribute>attributename</attribute>

        <from>PrimaryNetwo_PrimaryNet_T0018</from><to>dns_name</to>

      </rule>

      <rule><attribute>attributename</attribute>

        <from>SerialNumber_SerialNumb_T0019</from><to>serial_number</to>

      </rule>

      <rule><attribute>attributename</attribute>

        <from>GeneralInven_Vendor_T0020</from><to>manufacturer</to>

      </rule>

      <rule><attribute>attributename</attribute>

        <from>GeneralInven_Model_T0021</from><to>model</to>

      </rule>

      <rule>

        <attribute>attributename</attribute>

          <from>NAME</from><to>name</to>

      </rule>

      <rulename>csvrules</rulename>

    </ruleset>

     

    • - fix applied to SDM 14.1:

    CUM #2 and T6D3037

     

     

    Thank you to all by help