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
Set sc=##class(%RoutineMgr).GetWebServerPort(.Port,.Server,.URLPrefix,.URL)
%SYS>d ##class(Config.Startup).Get(.Prop)
%SYS>w Prop("WebServerPort")
57772
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 ![]()
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.
Your terminal prompt can be configured to display the instance.
see TerminalPrompt eg. config>namespace>
[Startup] TerminalPrompt="3,2"
and you name your config "SMP<portnumber>" which should be valid.
eventually only "<portnumber> " might do it as well.
On the page System Administration > Configuration > Additional Settings > Startup, in the TerminalPrompt row, select Edit.
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"
QUITJEFF>zmu
http://WIN7X64-VM02:57772/csp/sys/UtilHome.csp
JEFF>
Why waste valuable Prompt characters? ![]()
Thanks to @Herman Slagman and @Robert Cemper for letting me blatantly steal their ideas ![]()
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 ![]()
Right.
It turned out that VSCode-ObjectScript if is connected to IRIS, has the option to open Management Portal related to the current window of VSCode. Nice job, @Dmitry Maslennikov.
.png)
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