It is analytically shown when chaos exists in the behavior of null and timelike geodesics in the general case of geodesic motion in static and diagonal fields of general relativity. We demonstrate the effectiveness of our method of investigating chaos in the behavior of geodesic motion in the multi-black-hole spacetimes. An optical model of chaotic behavior of geodesics in spacetimes with cylindrical symmetry is presented. The Lyapunov characteristic time is defined and estimated for geodesic motion of a test particle in the external fields of general relativity. We find that its value is positive in some compact regions of the configuration space. This means that the trajectories have the property of local instability which implies the sensitive dependence on initial conditions.