To monitor Raspberry Pi, we use a client-server based approach. All messages are signed:
The client sends its status (signed with Pi's private key) to the server
HTTP response is a command (signed with Server's private key) which the client executes after verification
If the command execution yields an output, it is sent to the server via signed HTTP request
The server identifies all clients by the hash of their public key
In consequence no one can send commands to the PI without knowing the server's private key. Also, no one can fake the PIs you monitor unless he knows the private key of the PI.