@zuru The gateway will dump info on the serial port, so you could write a script or application to parse that. The API info is here: http://www.mysensors.org/download/serial_api_15. Note that the controller also assigns node IDs so you would need to hard code them if the script or app you build does not respond to those requests.
Cheers
Al