Well for the SCOM part first..
The SCOM agent just executes whatever we tell it to do. For instance for performance data in most cases it just pulls the data from windows performance counters. This is builtin behavior. There are a few cases where performance data is collected lets say through SQL queries or powershell or vb scripts. It all depends on the data modules used. The data is sent to a SCOM management server and that one places it in the database in the tables based on what type of data it is (performance, events, and so on). SO if you want to do something custom you would be looking into creating management packs, with possibly even custom data collection modules. These are still acording to guidelines and these are categorised when writing data back to the database (select which database, opsdb or datawarehouse, and select the type of data you are storing). The rest gets done on the backend and you should not play with.
hi
refer below link.