Friday, 28 October 2016

WebSphere Application Server 9 - Snooping About

I've blogged about SuperSnoop in the past: -


so this is just an aide memoire in the context of WebSphere Application Server (WAS) 9.

I've been tested scripted installations of WAS 9 on Linux, as per a previous post: -


Today I'm switching between WAS Base and WAS ND, so this is part of my testing process.

So here goes….

Start WSAdmin Scripting Tool

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wsadmin.sh -lang jython

Set Variable

cellID=AdminControl.getCell()

Deploy SuperSnoop

AdminApp.install('/home/wasadmin/SuperSnoopWeb.war', '[ -nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -nodeployejb -appname SuperSnoopWeb_war -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -noprocessEmbeddedConfig -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -noenableClientModule -clientMode isolated -novalidateSchema -contextroot /SuperSnoop -MapModulesToServers [[ SuperSnoopWeb SuperSnoopWeb.war,WEB-INF/web.xml WebSphere:cell='+cellID+',node=localhostNode01,server=server1 ]] -CtxRootForWebMod [[ SuperSnoopWeb SuperSnoopWeb.war,WEB-INF/web.xml /SuperSnoop ]]]' )

Save

AdminConfig.save()

Start SuperSnoop

AdminControl.invoke('WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=localhostNode01,version=9.0.0.1,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell='+cellID+',spec=1.0', 'startApplication', '[SuperSnoopWeb_war]')

Quit

quit

Test via Chrome



Test via CLI


--2016-10-28 07:35:59--  https://rhel66.uk.ibm.com:9443/SuperSnoop/SuperSnoop
Resolving rhel66.uk.ibm.com... 127.0.0.1
Connecting to rhel66.uk.ibm.com|127.0.0.1|:9443... connected.
WARNING: cannot verify rhel66.uk.ibm.com's certificate, issued by `/C=US/O=IBM/OU=localhostNode01/OU=localhostNode01Cell/OU=Root Certificate/CN=localhost':
  Self-signed certificate encountered.
    WARNING: certificate common name `localhost' doesn't match requested host name `rhel66.uk.ibm.com'.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `SuperSnoop'

    [ <=>                                                                                                                                                                                                                                   ] 67,139      --.-K/s   in 0.05s   

2016-10-28 07:35:59 (1.34 MB/s) - `SuperSnoop' saved [67139]

Check the WAS logs

tail -f /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemOut.log

[10/28/16 7:35:03:769 BST] 00000077 ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [SuperSnoopWeb_war] [/SuperSnoop] [SuperSnoop]: Initialization successful.
[10/28/16 7:35:03:772 BST] 00000077 SystemOut     O SuperSnoop running
[10/28/16 7:35:04:909 BST] 00000083 SystemOut     O SuperSnoop running
[10/28/16 7:35:59:683 BST] 00000083 SystemOut     O SuperSnoop running


So that's all good then ….

No comments: