API, set Attributes via API

Tags: #<Tag:0x00007f3b89fd7958>

Aloha,
introduction:
Im new to LibreNMS and like, how easy it is, to use it for classic SNMP monitoring!
For a new customer project, we need to add around 300 devices from the vendor 128technologies.
This device are not able to monitor via SNMP or even ICMP ping.
The vendor has its own management system called conductor.
This conductor can be polled via Rest API.
So the idea is, to create dummy devices in Libre and . monitor them only via a http service.

I tried testing this via the WebGUI and it works so for,
Now I need to add devices via the API.
What works is to add a device.

What I am missing is, to set 2 fields:

  1. disable ICMP monitoring
  2. device dependencies, so that the device is depended from the actual conductor.

I run the daily and validate scrips:

[email protected]:~$ ./daily.sh
Updating to latest codebase                        OK
Updating Composer packages                         OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK
[email protected]:~$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.54-16-g01a519ef2
DB Schema | 2019_07_03_132417_create_mpls_saps_table (139)
PHP       | 7.2.19-0ubuntu0.18.04.1
MySQL     | 10.1.40-MariaDB-0ubuntu0.18.04.1
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.9.0
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[WARN]  Your local git contains modified files, this could prevent automatic updates.
	[FIX]:
	You can fix this with ./scripts/github-remove
	Modified Files:
	 rrd/.gitignore

When I try to update the attrib field, I receive no error:

curl -X PATCH -d '{"field": "override_icmp_disable", "data": "true"}' -H 'X-Auth-Token: token' http://librenms.org/api/v0/devices/shop-0815


{
    "status": "ok",
    "message": "Device override_icmp_disable field has been updated"
}

But still it is not updated:

curl  -H 'X-Auth-Token: token' http://Librenms.org/api/v0/devices/shop-0815
{
    "status": "ok",
    "devices": [
        {
            "device_id": 65,
            "hostname": "shop-0815",
            "sysName": "shop-0815",
            ..........
            "port_association_mode": 1,
            "max_depth": 2,
            "location": null,
            "lat": null,
            "lng": null,
            "attribs": {
                "override_device_type": "1"
            }
        }
    ],
    "count": 1
}

same is valid, if I try to change the device dependencies,

Im a old network engineer, not a programmer, so forgive me my stupiness, If I just missed any easy syntax error in the API

Thanks
Marcel

Same here. Any way to set the “override_Oxidized_disable” field under attribs using the API?