It’s v6.20 but I have another v6.20 box that works just fine.
Are the two boxes of different architectures (e.g. MIPS-BE and PPC) by any chance? I remember seeing in change logs recently lots of issues related to the health menu, some of which were applicable only to some architectures.
Regardless, the best solution is to upgrade.
I’ve tried manually running this process on it and it returns no data.
…
but I would like to continue working through the rest of my script, unfortunately it exits at that point.
So wait, does the script exit, or does it simply return no data? If it exits, does it hang first, or does it exit (more or less) immediately as a sort of crash?
If it returns no data (i.e. returns null/false/empty string), you should be able to just check that, and act accordingly.
If it crashes, you could run each router as a separate process (see proc_open() and proc_close()) so that even if the child process crashes, the main one can dispatch the next router.
If it hangs… That’s a difficult one… I guess again proc_open(), but also make sure to set some reasonable script time limit, so that the hang lets the script continue.
I’m going to guess you mean it hangs, because the API can be prone to that, as it waits for the router to reply with SOMETHING. I used to use a timeout like how other clients still do, but I stopped primarily because of commands like “listen” and “print” with “follow” argument - those can, by design, not return anything to the client in ages, and suddenly return a thing or two. For example, if you wanted to create a script that executes as soon as a firewall rule is added/removed by a 3rd party (e.g. UPnP), you’d need to call such commands, along with a callback to do whatever you want on that event.