Simple Exec Binding

I’m playing around with trying to display the servername on my sitemap on OH2.
Raspberry Pi 3 - running Raspbian 8 (jessie)
I have the exec binding installed in Paper UI.

The following is from my sitemap file:
Text label=“Currently Running on [%s]” item=Server_Name

The following is my test item file (multiple lines are for testing):
// String Server_Name “Currently Running on [%s]” {exec="/bin/cat@@/etc/hostname"}
String Server_Name “Currently Running on [%s]” {exec="<[/bin/cat@@/etc/hostname]"}
// String Server_Name exec="<[/bin/cat@@/etc/hostname:60000]"
// String Server_Name exec="/bin/cat /etc/hostname"
// String Server_Name exec=“cat /etc/hostname”

I have been trying many different ways to this to work without success.


Have you checked the events.log file to verify the server name is being read? And be sure it’s not the UI causing trouble?

Are you seeing any errors in the OpenHAB.log?

And why would you need to read the server name every hour? Wouldn’t a startup rule with an execute command be more appropriate?

Sorry for the late reply. Been busy lately. I was messing around with the idea of running 2 openhab servers balanced by a reverse-proxy. I thought it would be cool to see which server was actually the active one at a given time. I actually haven’t checked the logs yet. I’m probably going to abandon this en-devour as I’m going to use my other RPi to run nginx to give me an authentication capability for openhab. Mine is currently wide open.