Get the graph (performance data) for a custom Nagios plugin

If you want to execute a Nagios plugin from the checkmk agent on the host have a look at the MRPE mechanism (search on docs.checkmk.com). It will also pass the metrics from the plugin.