Systeminfo Binding

Guys,

I have a problem to find basic description of supported commends. What I need is simple I would like to have total processor usage in % and processor usage of openhab process (in %).
I used CpuCombined + ProcessCpuPercent. Problem is that process cpu can be much higher (ie 80%) then cpu combined (i.e 15%), so something is wrong ?

Also I am not sure who to bind process items, when I put:
{ systeminfo=“ProcessCpuPercent:10000:openhab” }
I got an error, because binding can not find such process, which contain openhab (ps | grep can find it :slightly_smiling: ), so I used:
{ systeminfo=“ProcessCpuPercent:10000:java” }
and it is ok.

I’m not an expert on the Systeminfo binding but I wonder how many CPUs does your machine have? The reason I ask is because many tools will report, for example, 400% on a system that has four CPUs and all four are pegged. If the binding converts that 400% down to a 100% then it is possible to have a process that is using 100% of one CPU but that would only account for 25% of the CpuCombined.

I’m only guessing here, could be completely wrong.

That is the correct one because openHAB is not an executable binary, it is compiled Java code which runs on the Java Virtual Machine so the actual process that is running is java, not openhab. NOTE: Other interpreted languages such as Python and Ruby work the same.

So, when you run ps | grep openhab you will find the script that kicked off openhab (/bin/sh /usr/share/openhab/bin/openhab.sh -o) but this process isn’t doing anything as all it did was kick off the “real” process, the one that is actually using your CPU is java (/usr/bin/java -Dlogback.configurationFile=/etc/openhab/logback.xml ...).