Module dev bootstrap

Hi Folks,
I’m currently building a freepbx system with voismart vgsm cards built in and would like to write a module to show the status of GSM channels.
Can anyone point me at any info to help me understand how to get a module to run an asterisk consol command and get the output into PHP for echoing as a start to a gsm status module?

Any help appreciated,
Cheers,
Robin.