PHPackages                             dot-mike/nmscustomfields - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dot-mike/nmscustomfields

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dot-mike/nmscustomfields
========================

LibreNMS plugin to add custom fields to devices

1.0.10(1y ago)3326↓50%[2 issues](https://github.com/dot-mike/nmscustomfields/issues)MITPHP

Since Jul 3Pushed 1y ago3 watchersCompare

[ Source](https://github.com/dot-mike/nmscustomfields)[ Packagist](https://packagist.org/packages/dot-mike/nmscustomfields)[ RSS](/packages/dot-mike-nmscustomfields/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

nmscustomfields
===============

[](#nmscustomfields)

*nmscustomfields* - A LibreNMS plugin package to add support for creating custom fields for devices.

Installation
------------

[](#installation)

### Without Docker

[](#without-docker)

Go to the LibreNMS base directory and run the following commands as librenms user:

```
./lnms plugin:add dot-mike/nmscustomfields
php artisan migrate --path=vendor/dot-mike/nmscustomfields/database/migrations
php artisan route:clear
php lnms --force -n migrate
```

### With Docker

[](#with-docker)

If you are using LibreNMS with Docker, you can install the plugin by customizing the Dockerfile.

Example Dockerfile:

```
ARG VERSION=librenms:23.8.2
FROM librenms/$VERSION

RUN apk --update --no-cache add -t build-dependencies php-xmlwriter
RUN mkdir -p "${LIBRENMS_PATH}/vendor"

RUN echo $'#!/usr/bin/with-contenv sh\n\
set -e\n\
if [ "$SIDECAR_DISPATCHER" = "1" ] || [ "$SIDECAR_SYSLOGNG" = "1" ] || [ "$SIDECAR_SNMPTRAPD" = "1" ]; then\n\
  exit 0\n\
fi\n\
chown -R librenms:librenms "${LIBRENMS_PATH}/composer.json" "${LIBRENMS_PATH}/composer.lock" "${LIBRENMS_PATH}/vendor"\n\
lnms plugin:add dot-mike/nmscustomfields\n\
php artisan route:clear\n\
php lnms --force -n migrate\n\
' > /etc/cont-init.d/99-nmscustomfields.sh
```

Usage
-----

[](#usage)

To get started, open LibreNMS and enable the plugin by navigating to Overview-&gt;Plugins-&gt;Plugins Admin and enable the `nmscustomfields` plugin.

### Add and manage Custom Fields

[](#add-and-manage-custom-fields)

Navigate to Overview-&gt;Plugins-&gt;Custom Fields Plugin to start adding custom fields that will be available for devices. Here you will also be able to manage the field values in bulk.

### Editing Custom Fields for a Device

[](#editing-custom-fields-for-a-device)

Navigate to a device page and you will see the custom fields section where you will find a link to edit the custom fields for the device.

Screenshots
-----------

[](#screenshots)

[![Edit Custom Fields](/screenshots/edit-custom-fields.png?raw=true)](/screenshots/edit-custom-fields.png?raw=true)[![Edit Custom Field Values](/screenshots/edit-custom-field-values.png?raw=true)](/screenshots/edit-custom-field-values.png?raw=true)[![Device Custom Fields](/screenshots/device-custom-fields.png?raw=true)](/screenshots/device-custom-fields.png?raw=true)

Helper functions
----------------

[](#helper-functions)

The `get_custom_field_value` helper is used to retrieve a custom field's value for a specific device.

### Usage

[](#usage-1)

You can use the `get_custom_field_value` helper in your Blade templates to access custom fields associated with a device. This is especially useful for displaying dynamic content based on custom field values.

### Syntax

[](#syntax)

```
get_custom_field_value(Device $device, string $fieldName): string|null
```

### Example Usage

[](#example-usage)

```
{{ get_custom_field_value($device, 'custom_field_name') }}

@if ('yes' == get_custom_field_value($device, 'description'))
hello
@endif
```

API Documentation
-----------------

[](#api-documentation)

The plugin also adds API endpoints to manage the custom fields for devices.

### `Devices` API

[](#devices-api)

#### List Custom Fields

[](#list-custom-fields)

```
GET /api/v0/devices/{device}/customfields

```

- **Description**: Retrieves a list of custom fields for a specified device.
- **Parameters**:
    - `{device}`: The identifier of the device.

#### Show Custom Field

[](#show-custom-field)

```
GET /api/v0/devices/{device}/customfields/{customdevicefield}

```

- **Description**: Retrieves details of a specific custom field for a specified device.
- **Parameters**:
    - `{device}`: The identifier of the device.
    - `{customdevicefield}`: The identifier of the custom field.

#### Delete Custom Field

[](#delete-custom-field)

```
DELETE /api/v0/devices/{device}/customfields/{customdevicefield}

```

- **Description**: Deletes a specific custom field for a specified device.
- **Parameters**:
    - `{device}`: The identifier of the device.
    - `{customdevicefield}`: The identifier of the custom field.

#### Update Custom Field

[](#update-custom-field)

```
PATCH /api/v0/devices/{device}/customfields/{customdevicefield}

```

- **Description**: Partially updates a specific custom field for a specified device.
- **Parameters**:
    - `{device}`: The identifier of the device.
    - `{customdevicefield}`: The identifier of the custom field.

    ```
    {
      "value": "value"
    }
    ```

#### Upsert Custom Field

[](#upsert-custom-field)

```
PUT / POST /api/v0/devices/{device}/customfields

```

- **Description**: Creates or updates a custom field for a specified device.
- **Parameters**:
    - `{device}`: The identifier of the device.
    - Request body containing the custom field data.

    ```
    {
      "custom_field": "field_name or field_id",
      "value": "value"
    }
    ```

### `customfields` API

[](#customfields-api)

#### List All defined Custom Fields

[](#list-all-defined-custom-fields)

```
GET /api/v0/customfields

```

- **Description**: Retrieves a list of custom fields defined in the system.

#### Query Custom Fields

[](#query-custom-fields)

```
POST /api/v0/customfields/query

```

- **Description**: Retrieves a list of custom fields with the specified filter in JSON format.
- **Parameters**:
    - Request body containing the filter data.

```
{
    "filters": [
        {"field": "description", "operator": "eq", "value": "testing2"},
        {"field": "isok", "operator": "eq", "value": "exists"},
        {"field": "nonexistant", "operator": "eq", "value": "not_exists"},

    ],
    "fields": ["device_id", "hostname", "sysName"],
    "perPage": 15,
    "page": 1
}
```

Possible parameters for the filter are:

- `field`: The field name to filter on.
- `operator`: The operator to use for the filter. Possible values are `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `like`, `not_like`, `exists`, `not_exists`.
- `value`: The value to filter on if the operator is not `exists` or `not_exists`.

Example output:

```
{
    "current_page": 1,
    "data": [
        {
            "device_id": 1,
            "device": {
                "device_id": 1,
                "hostname": "snmpsim",
                "sysName": "zeus",
                "ip": null,
                "display": null,
                "overwrite_ip": null,
                "disabled": 0,
                "ignore": 0
            },
            "custom_fields": [
                {
                    "field_name": "description",
                    "value": "testing2"
                },
                {
                    "field_name": "isok",
                    "value": "yes"
                }
            ]
        }
    ],
    "from": 1,
    "last_page": 1,
    "per_page": 15,
    "to": 1,
    "total": 1
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Recently: every ~36 days

Total

10

Last Release

425d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73e79cf503a3b5a3f2847caa7d6da8939feb965449075ba828b946ea81082904?d=identicon)[dot-mike](/maintainers/dot-mike)

---

Top Contributors

[![dot-mike](https://avatars.githubusercontent.com/u/586280?v=4)](https://github.com/dot-mike "dot-mike (35 commits)")

### Embed Badge

![Health badge](/badges/dot-mike-nmscustomfields/health.svg)

```
[![Health](https://phpackages.com/badges/dot-mike-nmscustomfields/health.svg)](https://phpackages.com/packages/dot-mike-nmscustomfields)
```

###  Alternatives

[mage-os/module-theme-optimization

Page transitions and speculative loading rules for Magento

418.0k](/packages/mage-os-module-theme-optimization)[gerkirill/parallel-processing

Php library for easy object-oriented parallel processing

144.6k](/packages/gerkirill-parallel-processing)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
