How to know the Port of IRIS Management Portal Programmatically

Primary tabs

Answers

 

%SYS>d ##class(Config.Startup).Get(.Prop)

%SYS>w Prop("WebServerPort")
57772

Set sc=##class(%RoutineMgr).GetWebServerPort(.Port,.Server,.URLPrefix,.URL)

Hi Evegeny,

I found nothing sophisticated but very straight.

just from any namespace or routine / method.

USER>w ^%SYS("SSPort")  ;;SuperServer
1972
USER>w ^%SYS("WebServer","Port")  ;; WebServer
57772
USER>

If we're playing Caché/IRIS Golf, then @Robert Cemper is in the lead  yes

Comments

Thank you, guys! This really helps when you have several running containers simultaneously and don't know what port of Management Portal relates to a certain terminal.

Maybe it's not a bad idea to display the port in a Terminal prompt along with Namespace if this is possible at all.

on WIN  the config name is burned  into the registry 

Computer\HKEY_CURRENT_USER\Software\InterSystems\Cache\Configurations\......

UNIX/Linux has some structure simulating Win_Registry.  Support experts will know the details. 

Am I reading it wrong? Dont see port number anywhre

  • 2 - Namespace name. For example, %SYS>. The current namespace name is contained in the $NAMESPACE special variable. It can be an explicit namespace name or an implied namespace name.

  • 3 - Config name. The name of your system installation. For example, IRIS2>. This is the same for all of your terminal processes

I stated:

name your config SMP<port>  that is SMP57772 or just 57772

then the config name reflects the SMP port

Just add this to %ZLANGC00.mac:

/// Display Management Portal Port
ZMPORT
ZMP
  W ^%SYS("WebServer","Port")
  QUIT
JEFF>zmp
57772
JEFF>

Or This:

/// Display Management Portal URL
ZMURL
ZMU
  Set sc=##class(%RoutineMgr).GetWebServerPort(.Port,.Server,.URLPrefix,.URL)
  W URL_"csp/sys/UtilHome.csp"
  QUIT
JEFF>zmu
http://WIN7X64-VM02:57772/csp/sys/UtilHome.csp
JEFF>

Why waste valuable Prompt characters? laugh

Thanks to @Herman Slagman and @Robert Cemper for letting me blatantly steal their ideas wink

This really helps when you have several running containers simultaneously and don't know what port of Management Portal relates to a certain terminal.

Wouldn't help, as terminals would report internal container port, which is always 52773.

o yeah!

one pupose of containers is to have them  IDENTIC sad

I think IRIS studio has that feature too under UTILITIES

Important note: it should be noted that the proposed solutions refer only to the port of the private web server, which may not even be installed.
In the case of an external web server, this is not possible.

You can check to see if the internal web server is enabled with:

%SYS>d ##class(Config.Startup).Get(.Prop)
 
%SYS>w Prop("WebServer"),!

1