> For the complete documentation index, see [llms.txt](https://help.glpi-project.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.glpi-project.org/doc-plugins/plugin-glpi-network/agent_config.md).

# Agent Config

## Requirements (self-hosted)

| GLPI Version | Minimum PHP | Recommended |
| ------------ | ----------- | ----------- |
| 11.0.x       | 8.2         | 8.4         |
| 12.0.X       | 8.3         | 8.5         |

{% hint style="info" %}
A [GLPI Network BASIC](https://services.glpi-network.com/#offers) subscription (or higher) is required. This plugin is also available for all GLPI Network [Cloud instances](https://glpi-network.cloud).
{% endhint %}

***

## Limitation

### Concerned Version

Since Android 10 (API level 29)

### Limitation

Since Android 10 (API level 29), Google has strengthened restrictions related to accessing sensitive device information, such as IMEI and serial numbers, to protect user privacy. These changes are part of Google’s efforts to limit access to sensitive data and prevent permission abuse by applications.

Here is why we can no longer retrieve this information directly:

#### 1. IMEI and Permission Restrictions

* The IMEI is considered sensitive and private information.
* Since Android 10, only applications with the special permission **`READ_PRIVILEGED_PHONE_STATE`** can access the IMEI. This permission is only available to system applications or those preinstalled by the manufacturer.
* Third-party applications, even with the **`READ_PHONE_STATE`** permission, can no longer access the IMEI.

#### 2. Serial Number

* The serial number is also restricted. Before Android 8 (Oreo), applications could retrieve it via **`Build.SERIAL`**.
* Since Android 8, accessing the serial number requires the **`READ_PHONE_STATE`** permission.
* From Android 10 onward, applications cannot access the serial number unless they are system applications.

A system application is one installed directly in the system partition of an Android device. It is an integral part of the operating system (directly integrated by the manufacturer into the OEM firmware) and enjoys special privileges that standard applications (installed by users) do not have.

Installing an application as a system app is technically possible. However, it involves specific conditions and technical skills:

* **Root Access Required:**\
  The target device must be rooted to allow access to and modification of the system partition, where system applications are installed.
* **Using ADB:**\
  The method requires basic knowledge of using the Android Debug Bridge (ADB) tool to properly copy and configure the APK in the system directory of the device.

We are fully aware of the limitations imposed by Android regarding access to sensitive information (such as the IMEI or serial number) from the inventory agent.

To address these constraints and ensure proper data reporting from the agent, we are currently exploring several alternative approaches, including:

* **Collaboration with Manufacturers (OEMs):**\
  We are considering partnerships with manufacturers to integrate our application directly into the firmware as a system application, which would allow access to the necessary APIs.
* **Obtaining the Required Permissions from Google:**\
  We are analyzing procedures to acquire special permissions (such as **`READ_PRIVILEGED_PHONE_STATE`**) while complying with Google’s privacy and security policies.
* **Alternative Technical Solutions:**\
  We are also exploring technical approaches such as using administrator profiles through Android Enterprise or using non-sensitive identifiers that could replace the IMEI or serial number for our specific requirements.

***

## Install the plugin

* Go to the marketplace. Download and install the **Agent config** plugin.

<div align="left"><figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2FJCkLsWUSylhXiLd1R66B%2Finstall_plugin.png?alt=media&amp;token=0582d454-dd81-459e-abdc-08bc64bbe3f8" alt="images/install_plugin.png"><figcaption></figcaption></figure></div>

## Setting up the plugin

In **`Setup`** > **`General`** > **`GLPI Agent Contiguration`**, select the options you want :

* By default, the URL of the inventory is indicated
* To secure your instance and limit feedback from your mobile devices, you can enter a **login** and **password** for each mobile device to be inventoried
* You can use a **tag entity** (choose **Yes** and indicate your **tag** if needed)
* Choose the **asset type** by default (computers or phones, this information indicates the type of device by default, but can be modified individually from each device)
* Display **QR Code** (on central page)
* Display **Deeplink** (on central page)
* Manage **automatic inventory and frequency** for android

<div align="left"><figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2Fgit-blob-6f1a9d61cb58ba3209b5c2c1a59d73c5831bc9f8%2Fsetup_plugin.png?alt=media" alt="images/setup_plugin.png"><figcaption></figcaption></figure></div>

### Central page

* On **`Home`** > **`GLPI Agent Config`** use Deep link or QR Code to preconfigure the agent :

<div align="left"><figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2Fgit-blob-1c597d02b0f5a93f0cedcc6f84f3e1991bb03e32%2Fasset.png?alt=media" alt="images/asset.png"><figcaption></figcaption></figure></div>

{% hint style="info" %}
When a factory reset is performed on the phone, the serial number automatically generated by the agent changes You can use **Deep Link** / **QR Code** to configure the agent with the serial number previously generated and inventoried in GLPI.
{% endhint %}

#### Create the OAuth Client

In GLPI, create a new OAuth client dedicated to the Android Inventory Agent.

Configure the following grants:

* **Client Credentials**
* **Authorization Code**

Configure the following scope:

* **Inventory**

Using a dedicated OAuth client makes it possible to limit the permissions granted to the Android Inventory Agent to the operations required for inventory management.

<figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2FE0WAynp5kRdhgOmFzBWd%2Fimage.png?alt=media&amp;token=53de2700-e8d7-466a-9516-6dbcc1355efa" alt=""><figcaption></figcaption></figure>

#### Configure the Android Inventory Agent Plugin

Once the OAuth client has been created, configure the Android Inventory Agent plugin to use this OAuth client.&#x20;

Select the OAuth client created in the previous step and save the configuration.

<figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2FRNi5EiyFlHy2DCMFkgMn%2Fimage.png?alt=media&amp;token=ec4e5e53-07cf-4872-b322-bea033bd4260" alt=""><figcaption></figcaption></figure>

#### Configure the Inventory

Configure the inventory settings to explicitly indicate that the inventory must use the OAuth client for authentication.

Make sure that the `Oauth - Client credentials` authentication option is enabled.

<figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2FFKJpP6ynvUyQZThyyQnE%2Fimage.png?alt=media&amp;token=ffa8d68b-0f5b-4f31-ad93-0be10a245751" alt=""><figcaption></figcaption></figure>

#### Configure the Android Inventory Agent

The configuration can now be distributed to the Android Inventory Agent using the generated QR code.

Simply scan the QR code using the Android Inventory Agent application.

Once the QR code has been scanned, the application will automatically retrieve the OAuth configuration and use the dedicated OAuth client to authenticate with GLPI.

The Android Inventory Agent is then ready to perform inventory operations against your GLPI instance.

#### Security considerations

The QR code and deep link generated by the Android Inventory Agent plugin may contain the OAuth `client_id` and `client_secret` required to authenticate the agent.

For security reasons, access to this information is now protected by a **dedicated permission** in the Android Inventory Agent plugin.

<figure><img src="https://3573604317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUCcURk2xlvtpVGbiRZf%2Fuploads%2FW3jAxq5PViQys78gGM2Y%2Fimage.png?alt=media&amp;token=f84a018f-2055-4c7c-8a12-ba3c8da109b3" alt=""><figcaption></figcaption></figure>

Access to the QR code and deep link from the GLPI home page is restricted as follows:

* **Self-Service profiles** do not have access to the QR code or deep link.
* Other profiles must have the dedicated permission enabled to access the QR code or deep link.
* Access to these credentials should only be granted to trusted users who are authorized to configure Android Inventory Agents.

This permission should therefore be granted according to the **principle of least privilege**, as the QR code / deep link may expose OAuth credentials in plain text.

Make sure that only authorized users have access to the generated QR code or deep link and avoid sharing them through untrusted channels.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.glpi-project.org/doc-plugins/plugin-glpi-network/agent_config.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
