Since the observation of porosity in organic–inorganic hybrids there has been a major development in the study of gas sorption and catalysis as they provide novel surfaces in contrast to metals and oxides including silicates. Of major interest is the possibility of trapping fuel gases and toxic fumes. In addition, their applications as sensors have been demonstrated by use of the change in magnetic or optical properties upon sorption and desorption. The latter experiments have been performed ex-situ. Thus, there is a need to understand the properties in-situ, in particular to follow the performance of the materials continuously. Here, the development of an in-situ apparatus to study the magnetism is presented and applied for the partially dehydrated Ni 2 (H 2 O) 4 PM·2H 2 O, PM=benzene-1,2,4,5-tetracarboxylate with oxygen (O 2 ) and nitric oxide (NO) in the cavities.