Have you ever traveled outside the US? immigration/ customs / passport control knows the number of people and their citizenship unless they illegally entered the country. You are required to let Customs know where you will be residing while you are in a country. Its been like that for almost 100 yrs the world over. Even in dirt poor 3rd world dumps.
Even in dirt poor 3rd world dumps cell phone service is common. The days of a town crier are long long gone. Places in poorest parts of Africa actually use cell phone minutes as currency instead of the worthless money in their country.
Let me add to that:
Most Middle Eastern countries, like Saudi Arabia, have no tourism. You must be there under the express permission of the government (in S.A. by invitation of the King). So, there's not the massive turnover of travelers like we see visiting the US.
There are checkpoints on all roads entering and leaving the countries, similar to the border crossing facilities between US and Mexico.
If you're in a hotel or staying with someone, and the info you listed with immigration is correct, the embassy or consulate can contact you directly -- or they can contact hotel management and have them contact all US guests. In Riyadh, the phone operator made PA announcements all the time in public spaces in the hotel.
Radio and TV announcements will also be broadcast for anyone who missed a more direct contact.
If you're living and working in a foreign country next door to terrorists, and you aren't keeping an eye on current events, that's your problem. You can't live in your own little cocoon when traveling abroad, especially in a country that's at WAR. Situations change quickly and often. Being oblivious is a good way to be captured and/or killed.