如何以编程方式将远程命令发送到AppServer?

时间:2014-12-10 00:22:13

标签: java openedge

我需要向远程OpenEdge AppServer发送命令(查询,启动,停止)。这将在OpenEdge 11.3上运行。

据我所知,这些是选项:

  • OpenEdge管理。这是一个可以通过HTTP(S)访问的webapp。所需要的只是一个Web浏览器。不幸的是,它是专为交互式使用而设计的 - 尝试以编程方式控制它会很疯狂。

  • asbman命令行实用程序。这是一个调用Java命令行应用程序的批处理文件,允许管理本地和远程AppServer。虽然这正是我所需要的,但它带来了沉重的代价:似乎使用它的唯一方法是安装OE,它不是超过500 MB的轻量级。这包括运行 AppServer所需的一切,而我只需要能够向已经运行的远程服务器发送命令。

    我应该注意,这只是以交互方式接收密码,虽然可以解决(重定向STDIN是微不足道的。)

    • 如果我可以提取该Java应用程序(com.progress.ubroker.tools.UBCmdClientprogress.jar),那就没问题。但是,它调用至少一个本机库(jutil.dll),并使用自定义启动器(jvmStart.exe)。

      尝试通过标准Java启动程序(java.exe)启动它会导致加载本机库(Expecting an absolute path of the library: null\bin\jutil.dll)时出错。我也在努力提取jvmStart.exe,但似乎有很多依赖。

      我找不到任何关于此的文件。

  • asbman最终通过协议进行与AdminServer和AppServer的通信,显然会调用" Chimera"。不幸的是,我似乎无法在任何地方找到文档。

我错过了什么吗?有没有人知道一种方法,最好但不一定有文件记录(此时,只要它起作用,与特定的OE版本的联系现在很好),远程和编程地向AppServer发送查询和命令而不安装整个套房?我无法相信没有人认为这可能是有用的东西。

7 个答案:

答案 0 :(得分:2)

我的名字是梅斯文克。我是Progress OpenEdge技术支持经理,我很高兴听到您在我们的团队中对此主题的体验并不乐观。我们正在努力解决这个问题。

要回答您的问题是否有办法在不安装产品的情况下远程管理Appserver,无法在不安装OpenEdge的情况下从另一台计算机上运行的远程AppServer上运行AppServer管理命令。

如果你的目标是远程控制在另一台Windows机器上运行的AppServer而不在机器上安装OpenEdge产品,那么可以有两种选择:

  1. 使用Power Shell进行Windows远程shell脚本编写,就像您调查过的那样。

  2. 使用OpenEdge Management产品,并将AppServer管理脚本设置为作业,以便按计划运行。 OpenEdge Management可以安装在任何计算机上,Web控制台可以在浏览器中用于远程管理作业。

  3. 如果您有兴趣减少安装占用空间,而不是安装AppServer许可证,请安装名称服务器免费部署组件产品,以远程管理AppServer。这种方法将安装足迹从500兆位减少到大约179兆位。此部署组件是可从ESD下载的免费产品。

    我们还在知识库文章中记录了这些选项,可在此处参考。

    http://knowledgebase.progress.com/articles/Article/000056238

    谢谢你,让我知道你是否还有其他问题。

答案 1 :(得分:1)

我有个坏消息。

没有独立的asbman,你所寻找的东西都没有记录。

我希望你不得不咬紧牙关并安装OE。您可以通过反复试验或仔细监控实际使用的文件来修复安装中的大量漏洞。就个人而言,我从来没有发现那种值得付出太多努力的事情。磁盘很便宜。

如果找到我感兴趣的解决方案,那就更少了。

答案 2 :(得分:1)

我正在研究这个问题,如果我找到答案,我会回复你。

不是它在11.3 / 4和#34;经典" AppServer但肯定会有太平洋AppServer的REST API(在Exchange上宣布的新AppServer:http://media.progress.com/exchange/2014/slides/track1_living-with-pacific-application-server-for-openedge.pdf)。

如果我发现有关以编程方式控制早期版本的任何内容,我会告诉您。

答案 3 :(得分:0)

**strong text**
Hi,

i run the commands on windows to query or preform action on an appserver vis batch, from a remote desktop i use psexec \\remoteserver c:\windows\system32\cmd.exe to access remote command line on server
after that have some batches to query/stop/start/kill appserver

hope this will bring u closer to what u need , I am working on same concept to manage appserver/db/name server from html as progress ver. 9.1E running on win2008 does not support "Progress Explorer Tool"

regards 

Emad

#####################################################
rem appserver 
@echo off
SET TYP=type
SET APS=asb_xxx_%TYP%
set prt=20931
set ENV=PROD
set DLC=D:\PROGRESS\OpenEdge\102B\DLC

if (%1) == () %DLC%\bin\asbman -port %prt% -i %APS%_%ENV% -q
if (%1) == (q) %DLC%\bin\asbman -port %prt% -i %APS%_%ENV% -%1
if (%1) == (stop)  %DLC%\bin\asbman -port %prt% -i %APS%_%ENV% -%1
if (%1) == (start) %DLC%\bin\asbman -port %prt% -i %APS%_%ENV% -%1
if (%1) == (t)  %DLC%\bin\asbman -port %prt% -i %APS%_%ENV% -trim %2
if (%1) == (a)  %DLC%\bin\asbman -port %prt% -i %APS%_%ENV% -s %2
if (%1) == (kill) %DLC%\bin\asbman -port %prt% -i %APS%_%ENV% -%1

#####################################################

rem name server 
@echo off
:loop
color 1B
cls
SET ATP=asb_0165_autopro
SET EDI=asb_0165_edi
SET SRS=asb_0165_srs
SET INV=asb_0165_inv
SET JIT=asb_0165_jit
SET PLN=asb_0165_plan
SET SNC=asb_0165_sonic
SET ENV=PROD
SET SITE=0165
SET /A counter=%counter%+1
if %counter%==10 GOTO end:
echo.
echo.
echo======================================================================
echo                  AppServers For the %SITE%-%ENV% environment
echo======================================================================
echo.
title                 AppServers For the %SITE%-%ENV% environment

for /F "tokens=1-10" %%i in ('D:\PROGRESS\OpenEdge\102B\DLC\bin\nsman.bat -port 20931 -name NS1 -q') do (
if /I "%%j" equ "AS.%ATP%_%ENV%" ( @echo %%j      RUNS ON   %%k )

)



for /F "tokens=1-10" %%i in ('D:\PROGRESS\OpenEdge\102B\DLC\bin\nsman.bat -port 20931 -name NS1 -q') do (
if /I "%%j" equ "AS.%EDI%_%ENV%" ( @echo %%j          RUNS ON   %%k )

)


for /F "tokens=1-10" %%i in ('D:\PROGRESS\OpenEdge\102B\DLC\bin\nsman.bat -port 20931 -name NS1 -q') do (
if /I "%%j" equ "AS.%SRS%_%ENV%" ( @echo %%j          RUNS ON   %%k )

)

for /F "tokens=1-10" %%i in ('D:\PROGRESS\OpenEdge\102B\DLC\bin\nsman.bat -port 20931 -name NS1 -q') do (
if /I "%%j" equ "AS.%INV%_%ENV%" ( @echo %%j          RUNS ON   %%k )

)


for /F "tokens=1-10" %%i in ('D:\PROGRESS\OpenEdge\102B\DLC\bin\nsman.bat -port 20931 -name NS1 -q') do (
if /I "%%j" equ "AS.%JIT%_%ENV%" ( @echo %%j          RUNS ON   %%k )

)


for /F "tokens=1-10" %%i in ('D:\PROGRESS\OpenEdge\102B\DLC\bin\nsman.bat -port 20931 -name NS1 -q') do (
if /I "%%j" equ "AS.%PLN%_%ENV%" ( @echo %%j         RUNS ON   %%k )

)

for /F "tokens=1-10" %%i in ('D:\PROGRESS\OpenEdge\102B\DLC\bin\nsman.bat -port 20931 -name NS1 -q') do (
if /I "%%j" equ "AS.%SNC%_%ENV%" ( @echo %%j        RUNS ON   %%k )

)

    enter code here

sleep 3

goto loop
:end
exit

答案 4 :(得分:0)

just for the fun of it i ran this command from my laptop (without any progress installation`enter code here` on my laptop):



C:\WINDOWS\system32>psexec \\a-690m111 r:\AproApp\0165\prod\scripts\atp.cmd


PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

Starting r:\AproApp\0165\prod\scripts\atp.cmd on a-690m111...

OpenEdge Release 10.2B08 as of Tue Nov 12 19:06:41 EST 2013


Connecting to Progress AdminServer using rmi://localhost:20931/Chimera (8280)
Searching for asb_0165_autopro_PROD (8288)
Connecting to asb_0165_autopro_PROD  (8276)

Broker-Name                    : asb_0165_autopro_PROD
Betriebsmodus                  : Stateless
Broker-Status                  :  ACTIVE 
Broker-Anschluss               : 15201
Broker-PID                     : 6104
Aktive Server                  : 10
Ausgelastete Server            : 0
Gesperrte Server               : 0
Verfügbare Server              : 10
Aktive Clients (jetzt, Spitze) : (0, 2)
Client-Warteschl. (jetzt, max) : (0, 0)
Summe der Anfragen             : 26
Anf-Wartezeit (max, durchschn) : (0 ms, 0 ms)
Anf-Dauer (max, durchschn.)    : (3740 ms, 299 ms)

PID   Zustand   Port  nAnf   nAempf nSent  Gestartet        Letzte ؤnderung  
05644 AVAILABLE 15210 000006 000006 000006 21.12.2014 21:44 21.12.2014 21:48 
05544 AVAILABLE 15211 000003 000003 000003 21.12.2014 21:44 21.12.2014 21:49 
05396 AVAILABLE 15212 000002 000002 000005 21.12.2014 21:44 21.12.2014 21:48 
05400 AVAILABLE 15213 000002 000002 000012 21.12.2014 21:44 21.12.2014 21:48 
02540 AVAILABLE 15214 000002 000003 000003 21.12.2014 21:44 21.12.2014 21:48 
06052 AVAILABLE 15215 000003 000003 000004 21.12.2014 21:44 21.12.2014 21:49 
05296 AVAILABLE 15216 000002 000003 000003 21.12.2014 21:44 21.12.2014 21:48 
06088 AVAILABLE 15217 000002 000002 000002 21.12.2014 21:44 21.12.2014 21:48 
06184 AVAILABLE 15218 000002 000002 000002 21.12.2014 21:44 21.12.2014 21:48 
06216 AVAILABLE 15219 000002 000002 000002 21.12.2014 21:44 21.12.2014 21:49 



r:\AproApp\0165\prod\scripts\atp.cmd exited on a-690m111 with error code 0.

C:\WINDOWS\system32>

答案 5 :(得分:0)

如果您使用的是最新版本的OpenEdge Explorer(或管理)(11.0+),则可以使用相当多的REST API,您可以通过curl或类似的东西使用几乎零占用空间。

获取基本状态

的完整资源列表

curl -u admin:admin -u http://localhost:9090/oem/resources

获取appserver的状态(使用从上面获取的URL)

curl -u admin:admin http://localhost:9090/oem/containers/localhost/AppServer/serers/localhost:resource.openedge.appserver.asbroker1

答案 6 :(得分:0)

启动appserver:

curl -u admin:admin -H" Content-Type:application / json" -X PUT -d' {" running":true}' http://localhost:9090/oem/containers/localhost/AppServer/serers/localhost:resource.openedge.appserver.asbroker1

停止appserver:

curl -u admin:admin -H" Content-Type:application / json" -X PUT -d' {" running":false}' http://localhost:9090/oem/containers/localhost/AppServer/serers/localhost:resource.openedge.appserver.asbroker1