Hello, first time here…
I am having trouble updating the ipmi_hostname attribute on a given host using the API.
Most of the output below can be ignored, just giving you an idea of my issue.
So this is the current information about a server that has been added to librenms, using the API.
curl -k -H 'X-Auth-Token: APITOKENHERE' 'https://librenms.help/api/v0/devices/24'
{
"status": "ok",
"devices": [
{
"device_id": "24",
--- OUTPUT OMITTED ---
"notes": "",
"attribs": {
"ipmi_hostname": "10.10.10.10",
"ipmi_type": "imb"
},
"os_group": "unix"
}
],
"count": 1
}
What I want is to change the “ipmi_hostname” within “attribs”:
curl -k X PATCH -d '{"field": "ipmi_hostname", "data": "172.16.16.16"}' -H 'X-Auth-Token: APITOKENHERE' https://librenms.help/api/v0/devices/24
{
"status": "ok",
"message": "Device ipmi_hostname field has been updated"
}
But nothing happened to “ipmi_hostname”?
curl -k -H 'X-Auth-Token: APITOKENHERE' 'https://librenms.help/api/v0/devices/24'
{
"status": "ok",
"devices": [
{
"device_id": "24",
--- OUTPUT OMITTED ---
"notes": "",
"attribs": {
"ipmi_hostname": "10.10.10.10",
"ipmi_type": "imb"
},
"os_group": "unix"
}
],
"count": 1
}
And I do the same for “notes”:
curl -k -X PATCH -d '{"field": "notes", "data": "IPMI IS: 172.16.16.16"}' -H 'X-Auth-Token: APITOKENHERE' https://librenms.help/api/v0/devices/24
{
"status": "ok",
"message": "Device notes field has been updated"
}
It updates the “notes” field as expected.
curl -k -H 'X-Auth-Token: APITOKENHERE' 'https://librenms.help/api/v0/devices/24'
{
"status": "ok",
"devices": [
{
"device_id": "24",
--- OUTPUT OMITTED ---
"notes": "IPMI IS: 172.16.16.16",
"attribs": {
"ipmi_hostname": "10.10.10.10",
"ipmi_type": "imb"
},
"os_group": "unix"
}
],
"count": 1
}
Commands used were found in the documentation.
Any solutions, ideas or pointers would be appreciated. Thank you.