Ghosts in the machine

I was recently given a technical challenge at work. We have a network of very old PCs running circuit assembly robots – and by old I mean the entire network is built on XP… The systems were installed years ago, there was little to no proactive network maintenance since the machines were installed. At some point along the way, the systems developed a bad habit of going “off-line” – they left the network. This would stop the production line, a tech would come over and physically reboot the machine (they are all configured to auto-run their apps, so this was the easiest recovery). Did I mention these machines were old? So, rebooting has the very real possibility of not booting due to it having a 15 year old magnetic disk. After watching this happen over and over, I began to see patterns with the issue and the load on the production network. Digging a bit deeper I saw that the machines (basic XP machines) had dozens of IPs connected (net server command). The connections were internal, as this network is not connected externally. And I could see that these IPs were from all over the campus as based on he IPs. I could kick remove the connections, then monitor and actually watch the IPs re-attach. XP, as an unwritten rule – or maybe it was written (XP was a long time ago) only allowed so many concurrent connections. What was happening was specific machines needed to be connected to each other, but as more and more connected – at some point the system disconnected the connection that was required. My assumption was a race condition and the connection being idle as the connection was only used to momentarily every 70 to 90 seconds. I had not idea how to stop all of these rouge machines from connecting – but I thought I could write a script to use the pipe I needed more often – thus not letting it go idle and be disconnected. The initial solution was simple, a .txt file on one machine and a script top launch and close the connection every 10 seconds or so. That worked great! However, the next issue was operators closing the program (even when I titled the command window “Do Not Close”) . So I had to make it more robust. First it would detect if it was running, if not go back to the beginning of the script and relaunch. Later I made it launch, then hide itself from view, eventually compiling it to an .exe with its own installer and GUI. In the end, it was a fun project trying to beat the “users abuse” and having to do this all in XP – which had several scripting/command/language/documentation challenges just by being so vintage (lots of the XP content has been removed from the discussion boards!). You can find the scripts on the Professional Projects page if you are interested.

Leave a Comment