Impurity ion concentration and impurity ion temperature in the plasma gradient region as well as the scrape-off layer are essential parameters for understanding the physics of L- and H-mode transport and the transport barrier itself. To gain access to these properties, the well-established Li-beam diagnostic capabilities on both fusion devices at the Max-Planck-Institut für Plasmaphysik (IPP) Garching [WENDELSTEIN 7-AS stellarator and the Axially Symmetric Divertor Experiment (ASDEX) Upgrade tokamak] have been extended to include the measurement of radial profiles of impurity ion densities and temperatures by means of charge-exchange spectroscopy. This paper describes the experimental setups on both devices and presents typical results of impurity ion investigations. Electron density measurements show excellent agreement with other diagnostics. In addition, several LiI spectral lines (2p to 2s, 3d to 2p, 4s to 2p, and 4d to 2p) have been measured to check the collisional-excitation Li-beam modeling, especially for collision processes involving higher Li(nl) states (n 3). The underlying database has been augmented by extensive investigations of lithium excitation processes. Cross sections for Li(2s to 2p) excitation by various impurity ions as well as proton impact Li(2l to nl) excitation have been calculated and measured in detail.