CPU temperature via mqtt

Hello Community,

all my Pi send the temperature values via mqtt, but I am missing the values from my Openhab PI.

When I run the script I get an error message.

CPU => 36.95000000000000000000
cpu-mqtt.sh: line 9: mosquitto_pub: command not found
mosquitto is installed because of mqtt.

my bash script looks like this.

#!/bin/bash

cpu=$(</sys/class/thermal/thermal_zone0/temp)
cpu=$(echo "$cpu/1000" | bc -l)
echo "CPU => $cpu"

server="192.168.5.110"

mosquitto_pub -h $server -u openhabian -P password -t tele/pi-openhabian/temperature -m $cpu

What can I do now?
thanks

Installing the MQTT binding does not install Mosquitto. But assuming you installed Mosquitto separately, mosquito_pub is not in the path for the user that us running that script. Usd the full path to mosquitto_pub in the script or add it to the path of that user.

all right, i had to install the mosquitto-clients after
now the script is also executed

thx