Stability of pendulum-like systems with external disturbances