//create a new connection object $conn = new SAMConnection();
//start initialise the connection $conn->connect(SAM_MQTT, array(SAM_HOST => '', SAM_PORT => 1883)); //create a new MQTT message with the output of the shell command as the body $msgCpu = new SAMMessage($_REQUEST['message']);
//send the message on the topic cpu $conn->send('topic://'.$_REQUEST['target'], $msgCpu);