Mashgiach ruchani (Hebrew משגיח רוחני) or mashgiach for short, means a spiritual supervisor or guide. It is a title which usually refers to a rabbi who has an official position within a yeshiva and is responsible for the non-academic areas of yeshiva students' lives.
The position of mashgiach ruchani arose with the establishment of the modern "Lithuanian-style" mussar yeshivas.
The role of the mashgiach ruchani was strongest in the era prior to World War II, when often the mashgiach was responsible for maintaining the yeshiva financially, recruiting and interviewing new students, and hiring staff, something akin to an academic "dean". After the Holocaust, the influence and position of the mashgiach decreased, and the roles of the rosh yeshivas have grown at the expense of those of the mashgiachim. A modern mashgiach is somewhat equivalent to the secular "counselor" position.
The need for having a mashgiach within the modern yeshivas was tied in with the rise of the modern mussar movement (teaching of Jewish ethics), inspired by Rabbi Yisrael Lipkin Salanter, (1810-1883), and was seen as necessary because yeshiva students faced greater pressures and problems from the world outside of their yeshiva studies.
Some yeshivas may refer to a mashgiach ruchani as a menahel ruchani (the word "menahel" means "principal, as in the principal of a school, or "supervisor.")
Chabad yeshivas have a similar position referred to as mashpia, meaning a person who provides (spiritual) influence.
Read more about Mashgiach Ruchani: Famous Mashgichim