I am trying to write ‘success criteria’ relevance for a number of tasks we use to stop/start an application running on a Unix server in my environemnt… to validate whether or not it is running (after we stop/start the app). Just a true/false output via the relevance:
exists processes whose (command line argument of it contains "xxx")
OR:
not exists processes whose (command line argument of it contains "xxx")
I need a portion of the following output to indicate the application is running (or not)…particularly where it states “/wM97AMR/IntegrationServer” as the “wM97” part of this CLI argument indicates one of many different processes.
Required grep for one of the several processes is as follows:
ps -ef | grep AMR/Int
wmpadm 37027978 38142104 4 Mar 18 - 1131:03 /wmp/webMethods/wM97/wM97AMR/jvm/jvm/bin/java -Dosgi.install.area=/wmp/webMethods/wM97/wM97AMR/profiles/IS_default -Declipse.ignoreApp=true -Dosgi.noShutdown=true -XX:MaxPermSize=256M -Xbootclasspath/a:/wmp/webMethods/wM97/wM97AMR/common/runtime/agent/repository/plugins/com.softwareag.platform.jaas.proxy_9.7.0.0000-0400.jar -Djava.io.tmpdir=/wmp/webMethods/wM97/wM97AMR/profiles/IS_default/workspace/temp -server -Dorg.apache.xml.dtm.DTMManager=org.apache.xml.dtm.ref.DTMManagerDefault -Djavax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl -Dcom.webmethods.sc.auditing.Use80TableFormat=true -Dsun.lang.ClassLoader.allowArraySyntax=true -DWM_HOME=/wmp/webMethods/wM97/wM97AMR -Dwatt.server.prepend.classes=/wmp/webMethods/wM97/wM97AMR/common/lib/wm-converters.jar -Dwatt.server.append.classes= -Xbootclasspath/p:/wmp/webMethods/wM97/wM97AMR/IntegrationServer/instances/../../common/lib/ext/serializer.jar:/wmp/webMethods/wM97/wM97AMR/IntegrationServer/instances/../../common/lib/ext/xalan.jar:/wmp/webMethods/wM97/wM97AMR/IntegrationServer/instances/../../common/lib/ext/xercesImpl.jar:/wmp/webMethods/wM97/wM97AMR/IntegrationServer/instances/../../common/lib/ext/xml-apis.jar -Xverbosegclog:./logs/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-PrintTenuringDistribution -XX:+PrintGCDateStamps -Xms5632m -Xmx5632m -Djava.library.path=/wmp/webMethods/wM97/wM97AMR/common/lib/tw-3.5.25:/wmp/webMethods/wM97/wM97AMR/common/lib:/wmp/webMethods/wM97/wM97AMR/common/security/ssx/lib:/wmp/webMethods/wM97/wM97AMR/IntegrationServer/instances/default/lib -classpath /wmp/webMethods/wM97/wM97AMR/common/lib/tw-3.5.25/wrapper.jar:/wmp/webMethods/wM97/wM97AMR/common/runtime/agent/repository/plugins/com.softwareag.platform.bootstrap_9.7.0.0000-0400.jar:/wmp/webMethods/wM97/wM97AMR/common/runtime/agent/repository/plugins/org.eclipse.equinox.launcher_1.3.0.0000-0005.jar -Dwrapper.key=wPeZdqvuuXKMAd0iGJo0xuVGgL7f9gqJ -Dwrapper.port=32006 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.disable_console_input=TRUE -Dwrapper.pid=38142104 -Dwrapper.version=3.5.25-st -Dwrapper.native_library=wrapper -Dwrapper.arch=ppc -Dwrapper.ignore_signals=TRUE -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 -Dwrapper.lang.domain=wrapper -Dwrapper.lang.folder=../lang org.tanukisoftware.wrapper.WrapperStartStopApp org.eclipse.equinox.launcher.Main 4 -configuration /wmp/webMethods/wM97/wM97AMR/profiles/IS_default/configuration -service sagis97 com.softwareag.osgi.Bootstrap FALSE 2 remote_shutdown localhost:8045
$
I have tested various iterations of relevance to pull what I am looking for and I can’t seem to get it and the CLI argument piece is getting cut off, resulting in the relevance not working/finding what I am looking for:
Q: (pid of it, name of it, command line arguments of it) of processes whose (command line argument of it contains "Integration")
T: 21887
Q: (pid of it, name of it, command line arguments of it) of processes whose (command line argument of it contains "wM97AMR")
T: 25689
Q: (pid of it, name of it, command line arguments of it) of processes whose (command line argument of it contains "webMethods")
A: 17039546, wrapper-3.5.25, /wmp/webMethods/wM97/
A: 17956994, wrapper-3.5.25, /wmp/webMethods/wM97/
A: 31785002, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 32964678, wrapper-3.5.25, /wmp/webMethods/wM97/wM97
A: 33161218, wrapper-3.5.25, /wmp/webMethods/wM97/wM97
A: 33292420, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 33816694, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 33947676, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 34406454, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 34472020, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 34799706, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 35127428, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 36110422, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 36765832, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 38142104, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 38535358, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 38797486, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 38928386, wrapper-3.5.25, /wmp/webMethods/wM97/wM9
A: 40435940, wrapper-3.5.25, /wmp/webMethods/wM97/
T: 21902
Curious if anyone has any experience with a situation like this and any suggestions on another relevance statement to use?
Thanks!