I don't know how to read from file, but you can send script's result.
Add to monitrc
check program my-custom-data with path "/path/to/test_mydata.sh"
if status > 60 then alert . # just example
group custom-data
Bash file example:
#!/bin/sh
exit 56
and as result you will have this data in your xml
<service name="my-custom-data">
<type>7</type>
<collected_sec>1564140983</collected_sec>
<collected_usec>970882</collected_usec>
<status>0</status>
<status_hint>0</status_hint>
<monitor>1</monitor>
<monitormode>0</monitormode>
<onreboot>0</onreboot>
<pendingaction>0</pendingaction>
<program>
<started>1564140983</started>
<status>56</status>
<output/>
</program>
</service>