Addon to show OS version

Hello Openhab community,
Is there an addon that can show the OS name/version?
The systeminfo binding doesnt have a channel for that…unless I missed it

not sure why a addon is needed
but from MainUi Help and About Technical Information gives you

Configuration folder
User data folder
Logs folder
Operating system
Linux/6.1.0-16-amd64 (amd64)
Java Runtime
Azul Systems, Inc.
17.0.9 (Zulu17.46+19-CA)

curl api systeminfo and you get this.

  "systemInfo": {
    "configFolder": "/etc/openhab",
    "userdataFolder": "/var/lib/openhab",
    "logFolder": "/var/log/openhab",
    "javaVersion": "17.0.9",
    "javaVendor": "Azul Systems, Inc.",
    "javaVendorVersion": "Zulu17.46+19-CA",
    "osName": "Linux",
    "osVersion": "6.1.0-16-amd64",
    "osArchitecture": "amd64",
    "availableProcessors": 8,
    "freeMemory": 373302616,
    "totalMemory": 537919488,
    "uptime": 352977,
    "startLevel": 100

and from Karaf CLI you type info and it also provides all the OS and other information.

So not understanding why an add on would be required.

1 Like

Thank you very much

@justaoldman maybe I am missing something but why when I try to pass the request URL below to my browser I get the authentication required error?

You need to replace bearer with the actul tokenstring you need to create first in MainUI (click on the side bar on your profile icon)

OK got the key but I am not trying to use CURL - I am trying to understand the correct syntax for the URL to pass to my browser so I can see the Json response. Ultimately I will be using the HTTP binding and transform the JSON response. When I use I get the error below. so not sure where and how to append the key in the URL

You can’t do it in a browser like this. You need to make a http/post request - but browser are not able to send http/post

according to the REST API a GET request is required.
What is not working by using the browser URL entry bar is to add the authentication header in the URL entry bar.
Btw. browsers also send POST request as long as they use an action form - but again not by using the URL entry field.

ah ok interesting . Apologies no expert here I thought this was possible with openhab …

There are also other ways of achieving this.
In a rule you can use executeCommandline action to issue an OS command which returns the OS version. Once you assign it to a variable you can do whatever you like.

yes that’s true I used the exec binding successfully to play sound files so it can be applied here for sure. I thought this was possible because I have a similar setup calling a URL that returns a json response which i further transform. But I guess it’s not possible with openhab. What confused me is when I saw the Request URL field in the API explorer I thought you can just paste the URL into a browser and it will return the same Json response…

let’s step back for a second.
You run a URL which returns a JSON which you cannot proceed?
It is better if you describe your real problem so that we can start helping you solving it.

Have you reviewed the documentation?

There is an entire section that fully explains how to use the rest API.
So back to what @Oliver2 has asked what is the real problem you are trying to solve for?

This finally worked. setting up a thing with http binding and the admin login and pwd shows the Json response as expected. Again the only confusing part is that when I just paste the Base URL into my browser I get an authentication error