mosquitto_pub: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On Debian possible default full paths are:

/usr/bin/mosquitto_pub - from package: mosquitto-clients

You may install the required package with command apt-get install {package}
Error in other languages:
mosquitto_pub: bevel nie gevind nie
mosquitto_pub: comandă negăsită
mosquitto_pub: comando não encontrado
mosquitto_pub: commande introuvable
mosquitto_pub: command not found
mosquitto_pub: käsku ei ole
mosquitto_pub: không tìm thấy lệnh
mosquitto_pub: komanda nerasta
mosquitto_pub: Kommando nicht gefunden.
mosquitto_pub: kommandot finns inte
mosquitto_pub: komut yok
mosquitto_pub: nie znaleziono polecenia
mosquitto_pub: níor aimsíodh an t-ordú
mosquitto_pub: no se encontró la orden
mosquitto_pub: no s'ha trobat l'ordre
mosquitto_pub: opdracht niet gevonden
mosquitto_pub: parancs nem található
mosquitto_pub: perintah tidak ditemukan
mosquitto_pub: príkaz nenájdený
mosquitto_pub: příkaz nenalezen
mosquitto_pub: команда не найдена
mosquitto_pub: командата не е открита
mosquitto_pub: 命令找不到
mosquitto_pub: コマンドが見つかりません