The butadiyne-linked six-metalloporphyrin nanoring (M$6-P6) and it's complex with a hexapyridyl template, M$6-P6.T6 have a great potential for employment in future nanoelectronic applications such as a nanosensor for small gas molecules.The goal of this study is to scrutinize and improvement of the CO, N2, and O2 gas sensing capacity of M$6-P6 and M$6-P6.T6 using DFT calculations at CAM-B3LYP/6-31G (d,p) level of theory.The geometrical structures, binding energies, band gaps, the density of states (DOS), adsorption energies, HOMO and LUMO energies, Fermi level energies (EFL), NBO, FMO and TD-DFT spectrum were calculated to predict gas adsorption properties of M$6-P6 and M$6-P6.T6 systems. Based on the calculated adsorption energies and remarkable decrease in the Eg, it is expected that the M$6-P6 and M$6-P6.T6 are sensitive to O2 molecule. Surprisingly, the M$6-P6-O2 and specially the M$6-P6.T6-O2 record promising values of recovery times for different attempt frequencies. Therefore, the results open a way for the development of a new and selective O2 nanosensor in the presence of CO and N2 gas molecules.