  Using a set of hydrodynamical simulations of 62 galaxy clusters and groups we
study the ICM of inhomogeneities, focusing on the ones on the large scale that,
unlike clumps, are the most difficult to identify. To this purpose we introduce
the concept of residual clumpiness, C_R, that quantifies the large-scale
inhomogeneity of the ICM. After showing that this quantity can be robustly
defined for relaxed systems, we characterize how it varies with radius, mass
and dynamical state of the halo. Most importantly, we observe that it
introduces an overestimate in the determination of the density profile from the
X-ray emission, which translates into a systematic overestimate of 6 (12)% in
the measurement of M_gas at R_200 for our relaxed (perturbed) cluster sample.
At the same time, the increase of C_R with radius introduces also a ~2%
systematic underestimate in the measurement of the hydrostatic-equilibrium mass
(M_he), which adds to the previous one generating a systematic ~8.5%
overestimate in f_gas in our relaxed sample. Since the residual clumpiness of
the ICM is not directly observable, we study its correlation with the azimuthal
scatter in the X-ray surface brightness of the halo and in the y-parameter
profiles. We find that their correlation is highly significant (r_S = 0.6-0.7),
allowing to define the azimuthal scatter measured in the X-ray surface
brightness profile and in the y-parameter as robust proxies of C_R. After
providing a function that connects the two quantities, we obtain that
correcting the observed gas density profiles using the azimuthal scatter
eliminates the bias in the measurement of M_gas for relaxed objects, which
becomes (0+/-2)% up to 2R_200, and reduces it by a factor of 3 for perturbed
ones. This method allows also to eliminate the systematics on the measurements
of M_he and f_gas, although a significant halo to halo scatter remains.
(abridged)
