Monitoring the Server

Can localpanoramaxserverisrunning() detect if PanX Server is hung?

The core of the question is actually, is this querying the OS for a PID or is it actually communicating with PanoramaX Server. A hung program still has a PID so “true” might be meaningless. If it’s querying PanoramaX Server, then a hung state would (presumably) return “false”.

It’s actually not doing either of those things!

What this function does is check whether the server is advertising it’s presence via Bonjour. Since Bonjour uses separate code and a separate port from processing server requests, it’s possible that Bonjour could indicate that the server is running even though the server is not responding to queries.

It sounds like you want the checkserverconnection( function. Though if the server is actually “hung”, this function is not going to return any result until the timeout occurs.

I can’t remember a Panorama server (whether 6 or X) getting into a hung state. Generally it’s either running or stopped completely. Of course you could write a web procedure with an infinite loop, but that seems rather unusual. Is that what you are concerned about? Or are you somehow getting an unresponsive server some other way?


By the way, the localpanoramaxserverisrunning() function was created for the use of the Server Administration panel. When you change a server setting, Panorama uses this function to check to see if the local server is running. If it is, it then sends a message to the running server telling it to immediately change the setting. If the server is not running, then it simply changes the preference value via setpreferencevalues, and the next time the server starts it will pick up the new value.

I have no idea what the chances are of Panorama X hanging but it did happen occasionally with Pan 6. Usually it would be due to a stray dialog popping up and waiting to be manually cleared.

My reason for asking is that I’ve got an otherwise completed update to my Server Monitor. If PanoramaX Server has quit (no PID), it reliably launches it within a minute. (love the timer) I haven’t figured out how to ping PanX Server if it does have a PID to see if it’s actually functioning. In those instances, if it fails to respond, I would apply a programmed Force Quit and relaunch it.

Oh right, yes, that would happen occasionally. Panorama X Server does not have any windows, dialogs or alerts, so hopefully that will never, ever happen. :crossed_fingers:

You should be able to ping it with the checkserverconnection( function.