Menu

Help with new CIs

2021-01-13
2021-01-22
1 2 > >> (Page 1 of 2)
  • R Desrosiers

    R Desrosiers - 2021-01-13

    I am struggling here and it may very well be a simple fix...
    I was successfully able to add the Monitor extension following the documentation! However, when I go to make a new custom CI modifying that, it does not show in the drop down menu for new CI, nor does it show in the overview. actually in the overview i get an error (attached image)

    Here is my XML:

    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
      <classes>
        <class id="DUO Token" _delta="define">
          <parent>PhysicalDevice</parent>
          <properties>
            <category>bizmodel,searchable</category>
            <abstract>false</abstract>
            <key_type>autoincrement</key_type>
            <db_table>duotoken</db_table>
            <db_key_field>id</db_key_field>
            <db_final_class_field/>
            <naming>
              <format>%1$s</format>
              <attributes>
                <attribute id="name"/>
              </attributes>
            </naming>
            <display_template/>
            <icon>images/DUO.png</icon>
            <reconciliation>
              <attributes>
                <attribute id="name"/>
                <attribute id="org_id"/>
                <attribute id="organization_name"/>
              </attributes>
            </reconciliation>
          </properties>
          <fields>
          </fields>
          <methods/>
          <presentation>
            <details>
              <items>
                <item id="name">
                  <rank>10</rank>
                </item>
                <item id="org_id">
                  <rank>20</rank>
                </item>
                <item id="status">
                  <rank>30</rank>
                </item>
                <item id="business_criticity">
                  <rank>40</rank>
                </item>
                <item id="location_id">
                  <rank>50</rank>
                </item>
                <item id="brand_id">
                  <rank>60</rank>
                </item>
                <item id="model_id">
                  <rank>70</rank>
                </item>
                <item id="serialnumber">
                  <rank>80</rank>
                </item>
                <item id="asset_number">
                  <rank>90</rank>
                </item>
                <item id="description">
                  <rank>100</rank>
                </item>
                <item id="contacts_list">
                  <rank>110</rank>
                </item>
                <item id="documents_list">
                  <rank>120</rank>
                </item>
                <item id="tickets_list">
                  <rank>130</rank>
                </item>
                <item id="services_list">
                  <rank>140</rank>
                </item>
              </items>
            </details>
            <search>
              <items>
                <item id="name">
                  <rank>10</rank>
                </item>
                <item id="org_id">
                  <rank>20</rank>
                </item>
                <item id="status">
                  <rank>30</rank>
                </item>
                <item id="business_criticity">
                  <rank>40</rank>
                </item>
                <item id="location_id">
                  <rank>50</rank>
                </item>
                <item id="brand_id">
                  <rank>60</rank>
                </item>
                <item id="model_id">
                  <rank>70</rank>
                </item>
                <item id="serialnumber">
                  <rank>80</rank>
                </item>
                <item id="asset_number">
                  <rank>90</rank>
                </item>
              </items>
            </search>
            <list>
              <items>
                <item id="org_id">
                  <rank>10</rank>
                </item>
                <item id="status">
                  <rank>20</rank>
                </item>
                <item id="business_criticity">
                  <rank>30</rank>
                </item>
                <item id="location_id">
                  <rank>40</rank>
                </item>
                <item id="brand_id">
                  <rank>50</rank>
                </item>
                <item id="model_id">
                  <rank>60</rank>
                </item>
                <item id="serialnumber">
                  <rank>70</rank>
                </item>
              </items>
            </list>
          </presentation>
        </class>
      </classes>
    <menus>
      <menu id="ConfigManagementOverview" xsi:type="DashboardMenuNode" _delta="must_exist">
        <definition>
          <cells>
            <cell id="2" _delta="must_exist">
              <dashlets>
                <dashlet id="100" xsi:type="DashletBadge" _delta="define">
                  <rank>9</rank>
                  <class>DUO</class>
                </dashlet>
              </dashlets>
            </cell>
          </cells>
        </definition>
      </menu>
    </menus>
      <profiles>
      </profiles>
    </itop_design>
    
     

    Last edit: R Desrosiers 2021-01-13
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-01-13

    Can you share the entire extension? Also, it's advised not to use spaces in "id" . Rather make it DuoToken.

    Within the menu node tag, you also suddenly seem to refer to DUO instead?

     
    • R Desrosiers

      R Desrosiers - 2021-01-13

      Nothing else is customized outside of this section, but I will upload them just in case.

      When reviewing the monitor one, it seemed that the later refence in the menu translated to a display name to me (they used Monitor, instead of monitor). Maybe capitalization doesn't matter? I will attempt to have them match.

       
      • R Desrosiers

        R Desrosiers - 2021-01-13

        I have changed it to DUOToken in both locations, but still have the same result.

         
      • Pierre Goiffon

        Pierre Goiffon - 2021-01-18

        Nothing else is customized outside of this section

        Is your module.*.php file containing a unique identifier ? Or have you got bit the Monitor and custom class modules having the same code ?

         
        • R Desrosiers

          R Desrosiers - 2021-01-18

          Unsure what you are asking. The DUO module i made was with the tool iTop provides. So it was just blank made from when I entered the DUO name and dependencies. Looking through i see nothing more than labels that were auto generated in them, (i have my file above if you wanted to double check)

           
          • Pierre Goiffon

            Pierre Goiffon - 2021-01-19

            In the module creation form, the module identifier is the "Module name" field.

            In the module descriptor file, it is the second argument in the \ModuleDiscovery::AddModule call.
            For example in the backup embedded module, in datamodels/2.x/itop-backup/module.itop-backup.php, the module code is located in the 'itop-backup/3.0.0' string, it is itop-backup.

             
            • R Desrosiers

              R Desrosiers - 2021-01-21

              This is still not clear to me. The only major changes between my file and the Monitor sample is that i changed the name from sample add class to Duo Token Module, and then changed names from monitor to DUOToken in the xml. (i published updated versions on a comment below).

               
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-01-14

    Is your extension visible when you click the "power" button (top right in iTop) and check the support details (you'll see all extensions/modules listed there)?

     
    • R Desrosiers

      R Desrosiers - 2021-01-14

      It does appear to be. Snip attached.

       
      • Jeffrey Bostoen

        Jeffrey Bostoen - 2021-01-14

        OK. Have you tried to write the class ID without a space? So id="DuoToken" ?

         
        • R Desrosiers

          R Desrosiers - 2021-01-14

          Yes, in the replies above I uploaded the updated XML with the space removed, same result.

          I have this in a test environment and use snapshots to cleanly redo it each time.

           
        • R Desrosiers

          R Desrosiers - 2021-01-18

          Any other thoughts?

           
  • R Desrosiers

    R Desrosiers - 2021-01-18

    As a hypothetical. Does anyone have a simple non monitor example they could upload and I could test seeing it I can add that? Trying to isolate the why.

     
  • Anton Kuznetsov

    Anton Kuznetsov - 2021-01-20

    Hi, R Desrosiers!

    The error in the itop interface on Untitled.png you've attached clearly says what is wrong: DBObjectSearch::construct called for an invalid class :"DUO" means that you have created class with the name <class id="DUO Token">, but you want to see a dashlet for a class <class>DUO</class> in Configuration Management Overview which iTop could not find.

    You should call <class>DUO Token</class> in dashlets section inside menu section of your datamodel.xml extension.

     
    • R Desrosiers

      R Desrosiers - 2021-01-20

      That makes sense for the dashlet and will attempt that fix. However that wouldn't effect it showing in the list of new CIs though right?

       
      • Anton Kuznetsov

        Anton Kuznetsov - 2021-01-20

        As long as you have extension installed, i.e. new class of CI created, added to DB you should be able to create New CI of that type and Search for CI of that type under Configuration Management Menu.
        You also should be able to manually add dashlet of that new CI onto Configuration Management Overview via Edit This Page button.

         

        Last edit: Anton Kuznetsov 2021-01-20
        • R Desrosiers

          R Desrosiers - 2021-01-20

          Right but the original issue is that it does not show in the drop down under the current configuration. That is my problem. The dashlet is a side issue that I believe will be resolved with the change. But that still does not explain why it does not show in the drop down menu when i go to create a new CI.

           
  • Anton Kuznetsov

    Anton Kuznetsov - 2021-01-20

    Ok, got that about dashlet.
    Before you post dashlet into Configuration Management Menu you must add your new class into Model field which contains list with classes in order for it to show there and work as it is supposed to:

    <class id="Model" _delta="must_exist">
        <fields>
            <field id="type" xsi:type="AttributeEnum">
                <values>
                    <value id="DUO Token" _delta="define">DUO Token</value>
                </values>
        </fields>
    </class>
    

    Just as it's described in tutorial.

     

    Last edit: Anton Kuznetsov 2021-01-20
  • Pierre Goiffon

    Pierre Goiffon - 2021-01-21

    Oh, I've just see that your class id attribute has the DUO Token value... Try to remove this space !

     
    • R Desrosiers

      R Desrosiers - 2021-01-21

      A few posts above I did update the xml with this change, and had the same result.

       
      • Pierre Goiffon

        Pierre Goiffon - 2021-01-21

        Oh ok sorry
        Are you referring to this post ?

         
        • R Desrosiers

          R Desrosiers - 2021-01-21

          Yeah that one. In there I removed the space.

           
        • R Desrosiers

          R Desrosiers - 2021-01-21

          Any chance you have a working custom End user module that i can try and compare?

           
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.