Developing an app to monitor apps running on my xojo.cloud IP address

Can a WebApp hosted at an IP Address see instances of OTHER WebApp sessions at the same IP Address?

http://linux.die.net/man/1/ps

Thanks Michel - I think I understand that approach. What I would really like to do might not be possible.
Let’s say I have webapp1 and webapp2. In each of these apps, I have users log in, and I have a variable in each session called username. Now, I want to develop my new app (adminapp), and I would like adminapp to be able to interrogate each session that is active in webapp1 and in webapp2. In other words, adminapp will be able to display a list of active sessions for webapp1 and webapp2 and show the session.username for each of those sessions.

Is that possible either via the info Michel provided above (in which case I will study it deeply), or is there another way to do this, or is this not possible?

[quote=249940:@Mark Pastor]Thanks Michel - I think I understand that approach. What I would really like to do might not be possible.
Let’s say I have webapp1 and webapp2. In each of these apps, I have users log in, and I have a variable in each session called username. Now, I want to develop my new app (adminapp), and I would like adminapp to be able to interrogate each session that is active in webapp1 and in webapp2. In other words, adminapp will be able to display a list of active sessions for webapp1 and webapp2 and show the session.username for each of those sessions.

Is that possible either via the info Michel provided above (in which case I will study it deeply), or is there another way to do this, or is this not possible?[/quote]

ps will tell you which processes are running on the same host. Including but not limited to other cgi.

To obtain only cgi, use

ps aux | grep cgi

However, for what you want to do, I would add a web service in each app through HandleURL that gives the info you need. You can still use ps to know the path of running instance, then call their web service.

That sounds like the best option. Thanks.
I wanted to be sure I wasn’t missing something easier like how webapp1 is able to identify all sessions for webapp1 (and wasn’t sure if there was as easy a way to identify all sessions for other external apps).

One way to do this is to hVe the monitoring app talk to the others through HandleUrl. You’ll be able to tell if it’s a local request if Request.RemoteAddress is 127.0.0.1.

Another way would be to set up an IPCSocket on the apps you are monitoring and have them listen for connections from the monitor app.

I like this idea a lot.

MBS Plugin has a LinuxProcessMBS class:
http://monkeybreadsoftware.net/class-linuxprocessmbs.shtml

Doesn’t need to run a shell command, so should be much faster.

[quote=249980:@Christian Schmitz]MBS Plugin has a LinuxProcessMBS class:
http://monkeybreadsoftware.net/class-linuxprocessmbs.shtml

Doesn’t need to run a shell command, so should be much faster.[/quote]
One more useful tool from MBS. I will check it out.