refactored get_{failed,deployed}_nodes.sh