admin管理员组

文章数量:1355710

I have an GLPI Agent installed on a server. I want to have it create an inventory of Web Sites configured in IIS on the server.

I have created a script that queries the server and produces the following XML file:

<?xml version="1.0" ?>
<REQUEST>
  <CONTENT>
    <CUSTOM_IIS>
      <IIS_WEBSITE>
        <NAME>Default Web Site</NAME>
        <STATE>Started</STATE>
        <PHYSICALPATH>C:\inetpub\wwwroot</PHYSICALPATH>
        <BINDINGS>*:80:</BINDINGS>
      </IIS_WEBSITE>
      <IIS_WEBSITE>
        <NAME>MyApp</NAME>
        <STATE>Stopped</STATE>
        <PHYSICALPATH>D:\apps\myapp</PHYSICALPATH>
        <BINDINGS>*:8080:</BINDINGS>
      </IIS_WEBSITE>
    </CUSTOM_IIS>
  </CONTENT>
  <DEVICEID>dummy-device-id</DEVICEID>
  <QUERY>INVENTORY</QUERY>
</REQUEST>

I have configured the agent to include this file when performing an inventory task.

When the task is run, however, I get an error:

[Fri Mar 28 15:49:20 2025][error] [http client] communication error: 400 Bad Request, JSON does not validate. Violations:
Additional properties not allowed: CUSTOM_IIS at #->properties:content
[Fri Mar 28 15:49:20 2025][error] [http client] 8342C9EC: server error: JSON does not validate. Violations:
Additional properties not allowed: CUSTOM_IIS at #->properties:content
[Fri Mar 28 15:49:20 2025][debug] target server0: run event for RemoteInventory task
[Fri Mar 28 15:49:20 2025][debug] new thread 14 to handle task RemoteInventory
[Fri Mar 28 15:49:20 2025][debug] Remote inventory task execution disabled: no remote setup
[Fri Mar 28 15:49:21 2025][info] target server0: next run: Sat Mar 29 15:48:53 2025 - https://REDACTED/front/inventory.php

I have checked the documentation but I can't seem to figure out what is going wrong here. I have an idea it could have something to do w/ the item type (CUSTOM_IIS) not being recognized by GLPI, but I'm not sure.

Anybody got a clue?

/P

本文标签: itilHow to inventory IIS website using the GLPI AgentStack Overflow