Services are scripts or programs executed within a Logscape App. The Service descriptor in the bundle xml file describes
Here are a few examples of how to write a bundle file using the following code as a template
<Service> <name>UNIX_VMStat_wHOST_wTSTAMP <resourceSelection>osName notContains WINDOWS <fork>true <background>true <instanceCount>-1 <pauseSeconds>60 <script>bin/vmstat.sh </Service>
This service is configured to execute the contents of the script tag every 60s. The number of instances running in the environment can be unlimited and the process will be forked before execution.
Any script can be executed here depending on the operating system being used. On windows, powershell and vbscripts can be used and on Unix like environments the scripts will depend on the installed shell.
<script>bin/vmstat.sh >/script>
Any groovy script supplied here will be compiled before being executed.
<script>bin/myGroovy.groovy >/script>
Java programs of a few lines can also be included in the script tag using a CDATA section.
<script> <![CDATA[ import diff.* import com.pushtechnology.diffusion.api.* println "\n************************** Starting DiffClientStatsLogger **************************" diffHost = (diffHost == null) ? "192.168.71.56" : diffHost diffPort = (diffPort == null) ? "3097" : diffPort processMaker.java "-cp:lib/diffClient.jar:lib/diffusion.jar" , "diff.ClientApplication", diffHost, diffPort, "-Dlog4j.configuration=log4j.properties", "-Dlog4j.filename=../../work/PushDiffusionApp-1.0/clientStats.log", "-Dlog4j.debug" def propertyMissing(String name) {return null} ]]> </script>