======[[was.html|WebSphere Application Server]] - jython====== ====Obsah====
[[#odkazy|Externi odkazy]]
[[#interni|Interni odkazy]]
[[#wasadmin|wsadmin]]
Moduly:
[[#AdminControl|AdminControl]]
[[#AdminConfig|AdminConfig]]
[[#AdminApp|AdminApp]]
[[#AdminTask|AdminTask]]
[[#Help|Help]]
[[#priklady|wsadmin: priklady administrace]]
Seznam aplikaci a jejich prirazeni:\\ for ap in AdminApp.list().split(): for aaa in AdminApp.view(ap,['-MapWebModToVH','-MapModulesToServers']).split('\n'): if aaa.rfind('Serveur:') > -1: print ap + " - " + aaa[10:-1] Seznam aplikaci a prirazeni k serverum:\\ for ap in AdminApp.list().split(): for mo in AdminApp.listModules(ap).split(): for aaa in AdminApp.view(mo,['-MapWebModToVH','-MapModulesToServers']).split('\n'): if aaa.rfind('Serveur:') > -1: print mo + " - " + aaa[10:-1] Zastaveni Deployment Manazera:\\ AdminControl.stopServer('dmgr','NODE') nebo\\ AdminControl.invoke(AdminControl.completeObjectName('type=Server,processType=DeploymentManager,*'),'stop') Zastaveni Node agenta:\\ AdminControl.stopServer('nodeagent','NODE') nebo\\ AdminControl.invoke(AdminControl.completeObjectName('type=Server,node=NODE,name=nodeagent,*'),'stop') Start Aplikacniho serveru:\\ AdminControl.startServer('server2','NODE') nebo\\ AdminControl.invoke(AdminControl.completeObjectName('type=Server,node=NODE,name=NODE,*'),'launchProcess', 'server2') nebo\\ AdminControl.invoke(AdminControl.queryNames('*:*,node=NODE',launchProcess', 'server2') Zastaveni Aplikacniho serveru:\\ AdminControl.stopServer('server2','NODE') zastaveni vsech Ap. serveru na jednm node: [[stopApsOnNode.py|stopApsOnNode.py]]\\ Reset DMGR k replikaci manualnich zmen v XML na vsechny nody:\\ wsadmin DMGR> set config [$AdminControl queryNames *:*,type=ConfigRepository,process=dmgr] wsadmin DMGR> $AdminControl invoke $config refreshRepositoryEpoch Reset NODE k prepsani manualnich zmen v XML na NODE konfiguraci z DMGRy:\\ wsadmin NODE> set config [$AdminControl queryNames *:*,type=ConfigRepository,process=nodeagent] wsadmin NODE> $AdminControl invoke $config refreshRepositoryEpoch wsadmin -f [[timeout.py|timeout.py]] ... nastaveni timeout v Administrativni konzoli\\ wsadmin -f [[showMBeans.py|showMBeans.py]] ... vypise bezici MBeans\\ Seznam aplikaci, ktere bezi:\\ AdminControl.queryNames('type=Application, node=NODE,*') Status vsech aplikaci: [[StatusOfApps.py|StatusOfApps.py]]\\ Start zastavenych aplikaci: AdminControl.invoke(AdminControl.queryNames('type=AplicationManager,node=NODE,process=server1,*'),'startApplication','APLIKACE') Stop aplikace: AdminApp.list() ... najdi aplikaci print AdminControl.queryNames('type=Application,name=APLIKACE,*') ... najdi aplikacni server AdminControl.invoke(AdminControl.queryNames('type=ApplicationManager,process=SERVER,*),'stopApplication','APLIKACE') Start clusteru:\\ print AdminControl.queryNames('type=Cluster,*') AdminControl.invoke(AdminControl.completeObjectName('type=Cluster,name=CLUSTER1,*'),'start') Zastaveni clusteru:\\ print AdminControl.queryNames('type=Cluster,*') AdminControl.invoke(AdminControl.completeObjectName('type=Cluster,name=CLUSTER1,*'),'stop') Vygenerovani konfigurace Web-pluginu:\\ pluginGen = AdminControl.completeObjectName('type=PluginCfgGenerator,*') AdminControl.invoke(pluginGen,'generate',"C:/PROGRA~1/IBM/WebSphere/AppServer/profiles/Dmgr01/config CELL CELLMANAGER dmgr plugin-cfg.xml") Zapnuti logovani WebSphere komponent:\\ print AdminControl.queryNames('type=TraceService,*') ts=AdminControl.completeObjectName('type=TraceService,process=serve1,*') AdminControl.setAttribute(ts,'traceSpecification','com.ibm.ejs.*=all') Vypnuti zapinani aplikace pri startu aplikacniho serveru: [[DisableAppl.py|DisableAppl.py]]\\ listovani Virtual Hostu:\\ wsadmin>print AdminConfig.list('VirtualHost') admin_host(cells/TestCell|virtualhosts.xml#VirtualHost_2) default_host(cells/TestCell|virtualhosts.xml#VirtualHost_1) wsadmin>print AdminConfig.show('admin_host(cells/TestCell|virtualhosts.xml#VirtualHost_2)') wsadmin>print AdminConfig.show('admin_host(cells/TestCell|virtualhosts.xml#VirtualHost_2)') [aliases [(cells/TestCell|virtualhosts.xml#HostAlias_4) (cells/TestCell|virtualhosts.xml#HostAlias_5)]] [mimeTypes [(cells/TestCell|virtualhosts.xml#MimeEntry_101) (cells/TestCell|virtualhosts.xml#MimeEntry_102) (cells/TestCell|virtualhosts.xml#MimeEntry_103) (cells/TestCell|virtualhosts.xml#MimeEntry_104) (cells/TestCell|virtualhosts.xml#MimeEntry_105) (cells/TestCell|virtualhosts.xml#MimeEntry_106) (cells/TestCell|virtualhosts.xml#MimeEntry_107) (cells/TestCell|virtualhosts.xml#MimeEntry_108) .... wsadmin>print AdminConfig.show('admin_host(cells/TestCell|virtualhosts.xml#HostAlias_4)') [hostname *] [port 9060] wsadmin>print AdminConfig.show('admin_host(cells/TestCell|virtualhosts.xml#HostAlias_5)') [hostname *] [port 9043] pocet spojeni do DB, vycisteni fronty spojeni:\\ ds=AdminControl.queryNames('*:type=DataSource,process=as_espacejobs_1,name=calbdsnp033_refonte,*') print AdminControl.invoke(ds, 'showPoolContents') print AdminControl.invoke(ds, "showAllPoolContents")​ AdminControl.invoke(ds, "purg​ePoolContents", "immediate")​ Start vsech Listeneru na messaging\\ for lPort in AdminControl.queryNames('type=ListenerPort,*').split(): state = AdminControl.getAttribute(lPort, 'started') print(lPort, " ", state) if state == 'false': AdminControl.invoke(lPort, 'start') programek od Pavla k listovani url k aplikacim: [[list_app_mod_vh_alias.jy|list_app_mod_vh_alias.jy]]\\