Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    JSON API - Abfrage Objekt mit IP-Adresse, …

    Scheduled Pinned Locked Moved Entwicklung
    3 Posts 2 Posters 1.7k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      Christian_Wirtz
      last edited by

      Hallo zusammen,

      ich versuche gerade mit Hilfe de RPC-Clients https://bitbucket.org/dstuecken/i-doit-api-clients/overview Abfragen zu bauen um Hosts in unserem Monitoring System anzulegen.
      Was ich habe, ist die Abfrage von Objekte von gewünschten Objekttypen.
      Was ich nicht schaffe, ist die Abfrage der zugehörigen IP-Adresse (Primär würde schon reichen).
      Als Nächstes würden Abfragen kommen wie zugerordnete DNS-Domain, Contacts, Virtual-Machine Parent, …

      Der Weg bisher ist folgender:

      use idoit\Api\Client as ApiClient;
      use idoit\Api\CMDB\Object as CMDBObject;
      use idoit\Api\CMDB\Category;
      use idoit\Api\Connection as ApiConnection;
      ...
      $l_objectApi = new CMDBObject($l_apiClient);
      ...
      Hole objecttype_const aus einer Liste (C__OBJTYPE__SERVER, ...)
      ...
      Hole alle Objekte dieses Objekttyps mit Schleife um:
      $objects = $l_objectApi->search('%', $objecttype_const);
      ...
      Sammle Daten wie id, title, cmdb-status, ...
      ...
      JETZT hole die primäre IP-Adresse, Contacts, ...
      ...
      Daten mit weiteren Infos aus anderen Quellen verknüpfen und über API im Monitoring anlegen.

      Kann mir da jemand helfen?

      Viele Grüße und Danke
      Christian Wirtz

      1 Reply Last reply Reply Quote 0
      • dsD Offline
        ds
        last edited by

        Hi Christian,

        also IP Adressen kannst du dir z.B. einfach so holen:

        $apiClient                      = new ApiClient(
                new ApiConnection(
                    $api_entry_point, $api_key
                )
            );
            $category = new Category($apiClient);
            $ips      = $category->get(2286, 'C__CATG__IP');

        Wobei 2286 die ID des Objektes ist und C__CATG__IP die Konstante der Kategorie, eine Liste aller Konstanten findest du in der Datei CategoryConstants.php.

        Grüße,
        Dennis

        1 Reply Last reply Reply Quote 0
        • C Offline
          Christian_Wirtz
          last edited by

          Hallo,

          Vielen Dank für die Info!

          Ich werde das in den nächsten Tagen testen.

          Viele Grüße
          Christian

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post