save result value to place to take oid for it - or run ping command im mikrotik in linux base

I have a PRTG system to monitor.
And I want to put a Google DNS Ping reading from the MikroTik server directly on one of the channels in the graph inside the system.
PRTG usually supports several types of connection.

One is SNMP
And the other is via SSH

We started by adding a script to read Google DNS Ping
Then I added to it “:global PingResult $value” to save the result of the readers in “/system/script /environment”
Then I added “put” to it so that the result of the script is printed in the cli

The first attempt was to get the “oid” of “$PingResult” from inside “/system/script /environment print oid” and I did not find that it can be obtained
Here is the first question: Is it possible to get an “oid” resulting from a script or anything else that can be saved in the environment?

The second question: If there is no solution to get the “oid” from the “environment”, is there a place where the ping result can be saved and the “oid” can be obtained from?
The third question: Is it possible to write to a file and read it via snmp and get the oid of each file?

After the failure I tried via ssh but unfortunately prtg system can only deal with linux cli only and can not read or write from any other system. Is there any exception or mechanism to run ping command via mikrotik routerboard 5009 via linux base system?

note :
this for remote mikrotik rb5009 routerboard (there is 3 connecnted to prtg by vpn).
the local rb5009 routerboard i can take the ping dierctly from prtg because it connecnt to him.
but the other routerboard in other locations i need to something make ping on routerboard hem self then i must take read of ping to prtg.

Is this sufficient for your needs?

Thanks for the reply.
Here according to what you sent me, you can run a script that was previously inside the MikroTik via SNMP GET.
is this true?

But what I actually need is run the script and after running this script, can I get the ping result from it via SNMP?

… The idea I have here is that I should run a ping command on the routerboard directly and then get the value from it via SNMP.

Or I can do that via SSH, but the PRTG system cannot recognize the CLI of MikroTik.
I tried doing the same thing from prtg via SSH on Linux and the result worked, but on MikroTik it is not read from it.
So PRTG work well and mikrotik work well, but there is something PRTG cannot deal with it in mikrotik cli. so i canceld this idea and try with snmp

In short. You should get the ping values ​​from the remote routerboard itself and then monitor this value via PRTG
whith any possible way ..

I believe spawning a script using SNMP GET is exactly what you need because the OID of the script becomes the “OID of the variable” you are looking for and the value the GET returns is whatever you tell the script to return. So you can store the ping outcome to any global variable and let the script return the contents of that global variable.

This is an idea I have never tried before.
I think it is a great idea. I will try it and let you know the result.