Did you execute the code? Cause I'm not sure what you mean...it outputs correctly from what I can tell:
name id status
---- -- ------
server1 x123 production
server1 x234 production
server1 x345 production
server2 x999 anything
The hash is only used to store the first name -> status and keep them for later. I'm assuming that the names are not always in order, e.g there could be another "server1" after "server2", which is why I'm using the hash to store the values.
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.