Spheres, vortices, grid bugs, dragons, eels, Mjollnir, lightning bolts, and shock traps may still detonate wands and rings. Shock resistance may be acquired by eating gelatinous cubes, blue dragons, storm giants, puddings, electric eels, or the Chromatic Dragon. If it's of the right material to eat, you may also get it by eating the ring of shock resistance. Monks get shock resistance at XL 15.

Sources

Shock resistance can be obtained from eating the following corpses (along with the odds of getting the resistance), listed in the order you might find them in the game: