An anesthesia machine having an automatic scavenger system is disclosed herein. The anesthesia machine includes a scavenger hose configured to direct the transfer of an exhaled anesthetic agent from a patient, and a valve operatively connected to the scavenger hose. The valve is configured to selectively control the transmission of the exhaled anesthetic agent through the scavenger hose. The anesthesia machine also includes a switch operatively connected to the valve and to a controller. The switch is configured to link an operational status of the anesthesia machine with a position of the valve.