Hi Josef,
Thank you for the reply.
As I wrote we are using a self-hosted mender, and more specifically we do not used the Web UI but call directly the server API with a script that we implemented.
Below is an example for getting an inventory for one of the devices. You can see that the status
attribute is not present, or any other identity
type attribute.
root@gc-management:/var/lib/guardicore# curl -s -X GET -H "Accept: application/json" -H "Authorization: Bearer $JWT" $MENDER_SERVER_URI/api/management/v1/inventory/devices/38cc5130-f97d-42a4-a3e0-87fe6b454af7 | python -m json.tool
{
"id": "38cc5130-f97d-42a4-a3e0-87fe6b454af7",
"attributes": [
{
"name": "artifact_name",
"value": "test-full.artifact",
"scope": "inventory"
},
{
"name": "cluster_id",
"value": "default",
"scope": "inventory"
},
{
"name": "component_mode",
"value": "Aggregator",
"scope": "inventory"
},
{
"name": "cpu_model",
"value": "Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz",
"scope": "inventory"
},
{
"name": "device_type",
"value": "x86_64",
"scope": "inventory"
},
{
"name": "geo-city",
"value": "Tel Aviv",
"scope": "inventory"
},
{
"name": "geo-country",
"value": "IL",
"scope": "inventory"
},
{
"name": "geo-ip",
"value": "31.168.233.124",
"scope": "inventory"
},
{
"name": "geo-timezone",
"value": "Asia/Jerusalem",
"scope": "inventory"
},
{
"name": "hostname",
"value": "gc-aggregator-172-16-100-50",
"scope": "inventory"
},
{
"name": "ipv4_eth0",
"value": "172.16.100.50/16",
"scope": "inventory"
},
{
"name": "ipv4_eth1",
"value": "100.100.100.50/16",
"scope": "inventory"
},
{
"name": "ipv4_eth2",
"value": "200.200.200.50/16",
"scope": "inventory"
},
{
"name": "ipv6_eth0",
"value": "fe80::250:56ff:fe9d:2476/64",
"scope": "inventory"
},
{
"name": "ipv6_eth1",
"value": [
"2001:1860:1860:0:250:56ff:fe9d:c4ff/64",
"fe80::250:56ff:fe9d:c4ff/64"
],
"scope": "inventory"
},
{
"name": "ipv6_eth2",
"value": [
"2001:2860:2860:0:250:56ff:fe9d:8006/64",
"fe80::250:56ff:fe9d:8006/64"
],
"scope": "inventory"
},
{
"name": "kernel",
"value": "Linux version 4.15.0-192-generic (buildd@lcy02-amd64-029) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #203-Ubuntu SMP Wed Aug 10 17:40:03 UTC 2022",
"scope": "inventory"
},
{
"name": "mac_eth0",
"value": "00:50:56:9d:24:76",
"scope": "inventory"
},
{
"name": "mac_eth1",
"value": "00:50:56:9d:c4:ff",
"scope": "inventory"
},
{
"name": "mac_eth2",
"value": "00:50:56:9d:80:06",
"scope": "inventory"
},
{
"name": "mem_total_kB",
"value": "2028220",
"scope": "inventory"
},
{
"name": "mender_bootloader_integration",
"value": "bios_grub",
"scope": "inventory"
},
{
"name": "mender_client_version",
"value": "3.3.0",
"scope": "inventory"
},
{
"name": "network_interfaces",
"value": [
"eth0",
"eth1",
"eth2"
],
"scope": "inventory"
},
{
"name": "os",
"value": "Ubuntu 18.04.6 LTS",
"scope": "inventory"
},
{
"name": "rootfs_type",
"value": "ext4",
"scope": "inventory"
},
{
"name": "update_modules",
"value": [
"deb",
"directory",
"docker",
"rpm",
"script",
"single-file"
],
"scope": "inventory"
},
{
"name": "created_ts",
"value": "2023-03-14T12:48:46.576Z",
"scope": "system"
},
{
"name": "updated_ts",
"value": "2023-03-21T11:17:51.709Z",
"scope": "system"
},
{
"name": "group",
"value": "neta",
"scope": "system"
},
{
"name": "rootfs-image.checksum",
"value": "235704d4ee82b1a91b3a20ad466e00bad8ff167c3803c018f2a7d11c046f7443",
"scope": "inventory"
},
{
"name": "rootfs-image.version",
"value": "1.0",
"scope": "inventory"
}
],
"updated_ts": "2023-03-21T11:17:51.709Z"
}
From docker logs:
time="2023-03-21T13:25:01Z" level=info msg="200 5694μs GET /api/0.1.0/devices/38cc5130-f97d-42a4-a3e0-87fe6b454af7 HTTP/1.1 - curl/7.58.0" byteswritten=3226 file=middleware.go func="accesslog.(*AccessLogMiddleware).MiddlewareFunc.func1" line=71 method=GET path=/api/0.1.0/devices/38cc5130-f97d-42a4-a3e0-87fe6b454af7 qs= request_id=d5609ab5-dce3-4325-a036-0034bb5c1c50 responsetime=0.005694285 status=200 ts="2023-03-21 13:25:01.804766419 +0000 UTC" type=http user_id=f5c10cd2-df96-4bf2-9bc5-c3edac357074
There are no identity
attributes:
root@gc-management:/var/lib/guardicore# curl -s -X GET -H "Accept: application/json" -H "Authorization: Bearer $JWT" $MENDER_SERVER_URI/api/management/v1/inventory/devices/38cc5130-f97d-42a4-a3e0-87fe6b454af7 | python -m json.tool | grep scope | uniq
"scope": "inventory"
"scope": "system"
"scope": "inventory"
Any idea why the attribute is not shown?
Can I query directly the inventory database to search this attribute?
Thanks,
Neta