At no point should the Nagios server be able to run arbitrary command on monitored systems (aka only non-logonable ids), i.e. no value can be dynamically pass between the client and the server. The SSH server (i.e. munin-client) must use the SSH key to define which command to execute.
Define per-command ssh keys - ssh-keygen
.
e.g. /home/nagios/dns
#!/bin/bash
echo `ssh -i /home/nagios/.ssh/bacula_rsa -q [email protected]`