Written by

Senior Startups and Community Programs Manager at InterSystems Corporation
Question Evgeny Shvarov · Jul 20, 2019

How to know the Port of IRIS Management Portal Programmatically

Hi Community!

How can I know the port of management portal e.g. from terminal?

The one which looks like

localhost:port/csp/sys/exp/%25CSP.Portal.Home.zen 

in browser?

Comments

Herman Slagman · Jul 20, 2019

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

0
Jeffrey Drumm · Jul 20, 2019
%SYS>d ##class(Config.Startup).Get(.Prop)

%SYS>w Prop("WebServerPort")
57772

0
Robert Cemper · Jul 20, 2019

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>
0
Jeffrey Drumm  Jul 20, 2019 to Robert Cemper

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

0
Evgeny Shvarov · Jul 20, 2019

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.

0
Robert Cemper  Jul 20, 2019 to Robert Cemper

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. 

0
Neerav Verma  Jul 21, 2019 to Robert Cemper

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

0
Robert Cemper  Jul 21, 2019 to Neerav Verma

I stated:

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

then the config name reflects the SMP port

0
Jeffrey Drumm  Jul 20, 2019 to Evgeny Shvarov

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

0
Eduard Lebedyuk  Jul 21, 2019 to Evgeny Shvarov

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.

0
Robert Cemper  Jul 21, 2019 to Eduard Lebedyuk

o yeah!

one pupose of containers is to have them  IDENTIC sad

0
Robert Cemper  Jul 23, 2019 to Evgeny Shvarov

I think IRIS studio has that feature too under UTILITIES

0
Vitaliy Serdtsev · Jul 24, 2019

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.

0
Jeffrey Drumm  Jul 24, 2019 to Vitaliy Serdtsev

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
0