Don't forget to change the reply-address to [EMAIL PROTECTED] :D
... I can't set the "reply-to:" when using the browser and I'm currently not
at home.

An example XML-File:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE app-mon SYSTEM "app-mon.dtd">

<!-- Application Monitor root element -->
<app-mon>
    <!-- a description for this monitor instance (optional) -->
    <description>Monitor for my project</description>

    <!-- define some basic properties (optional) -->
    <property name="PROJECT"   value = "project" />
    <property name="HOME"      value = "X:\$(PROJECT)" />
    <property name="SYSADMIN"  value = "[EMAIL PROTECTED]"/>
    <property name="SERVER"    value = "SERVER" />

    <!-- Specify a remote database NT service -->
    <property name="DBSERVER"  value = "\\DBServer" />
    <property name="DBSERVICE" value = "OracleServiceORCL" />

    <!-- import more properties from a property file (optional) -->
    <properties file="$(HOME)/param/app-mon.properties" />

    <!-- monitor startup sequence (optional) -->
    <startup>
        <!-- sleep for 500 ms before anything else will happen -->
        <sleep millis="500" />

        <!-- validate a directory or file -->
        <validate dir="$(SERVER)\" cancelPrompt="true" >
            <!-- on successful validation -->
            <on-success property="UPDATE" value="TRUE" />

            <!-- on failed validation -->
            <on-error property="UPDATE" value="1" />
        </validate>
    </startup>

    <!-- this is the most simple application configurtation -->
    <process name         = "APP1"
             application  = "1stAPP"
             executable   = "$(HOME)\bin\myapp.exe"
             arguments    = "$(HOME)\param\myapp-1.ini"
             restartPolicy= "DontRestart" />

    <!-- this is a more complex configuration -->
    <process name            = "APP2"
             application     = "2ndAPP"
             executable      = "$(HOME)\bin\myapp.exe"
             arguments       = "$(HOME)\param\myapp-2.ini"
             restartPolicy   = "Restart"
             restartPeriod   = "10000"
             restartThreshold= "30" />

    <!-- this is an even more complex configuration -->
    <process name            = "APP3"
             application     = "3rdAPP"
             restartPeriod   = "10000"
             restartThreshold= "30" >

        <!-- a description for this application (optional) -->
        <description>This is my most complex application</description>

        <!-- specify the executable file -->
       
<executable>$(HOME)\$(PROCESS.NAME)\bin\$(PROCESS.APPLICATION)</executable>

        <!-- specify command line arguments (optional) -->
        <argument>$(HOME)\param\myapp.ini</argument>

        <!-- specify a working directory (optional) -->
        <workdir>$(HOME)\tmp\</workdir>

        <!-- Monitor is about to start the application (optional) -->
        <init-handler>
            <exec if="UPDATE" executable="update.cmd" />

            <!-- send an email before the first start of the process -->
            <sendmail>
                <if property="UPDATE" value="TRUE" />
                <if property="$(PROCESS.RESTARTS)" value="1"/>

                <subject>Process $(PROCESS.NAME) about to start!</subject>
                <to>$(SYSADMIN)</to>
                <message>UPDATE PERFORMED</message>
            </sendmail>
        </init-handler>

        <!-- Monitor has successfully started the application (optional) -->
        <start-handler>
            <!-- Send an email -->
            <exec executable="blat.exe">
                <argument>-to $(SYSADMIN)</argument>
                <argument>-s "$(APPLICATION)"</argument>
                <argument>"Well done!"</argument>
            </exec>
        </start-handler>

        <!-- Monitor failed to start the application (optional) -->
        <error-handler>
            <exec executable="blat.exe">
                <argument>-to $(SYSADMIN)</argument>
                <argument>-s "$(APPLICATION)"</argument>
                <argument>"Shit happens!"</argument>
            </exec>
        </error-handler>

        <!-- Map exit codes to named exit handlers -->
        <exit-handler-map defaultHandler="shutdown-monitor">
            <exit-code value= "0"   handler= "immediate-restart"/>
            <exit-code value= "1"   handler= "db-failure"/>
            <exit-code value= "2"   handler= "shutdown-monitor" />
            <exit-code value= "3"   handler= "delayed-restart" />
            <exit-code value= "127" handler= "remain-stopped" />
        </exit-handler-map>

        <!-- this performs an immediatete application restart -->
        <exit-handler name="immediate-restart" restartPolicy="Restart" />

        <!-- this performs an delayed application restart -->
        <exit-handler name="delayed-restart" restartPolicy="Restart">
            <!-- specify the restart delay -->
            <sleep seconds= "100" />
        </exit-handler>

        <!-- this performs an immediatete application restart -->
        <exit-handler name="remain-stopped" restartPolicy="DontRestart" />

        <!-- this will handle a db failure -->
        <exit-handler name="db-failure" restartPolicy="Restart" >
            <!-- stop db instance -->
            <service machine="$(DBSERVER)" name="$(DBSERVICE)"
command="restart" />

            <!-- allow db some seconds to start-up properly -->
            <sleep seconds="120"/>
        </exit-handler>

        <!-- This shuts down the application monitor -->
        <exit-handler name="shutdown-monitor" restartPolicy="Shutdown" />
    </process>

    <!-- Application monitor cleanup sequence (optional) -->
    <cleanup>
        <!-- execute a shell command -->
        <exec executable= "cmd.exe"
              arguments = "/c $(HOME)\bin\I_am_shutting_down.cmd $(PROJECT)"
/>
    </cleanup>
</app-mon>


Hope this helps and that you can help.... I'm getting ever more desperate ;)


Oliver

-- 
NEU F�R ALLE - GMX MediaCenter - f�r Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gru�, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse f�r Mail, Message, More! +++


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to