Objects and Services State/Status Examples

CLI:

dpbuddy status -class Version
# This will print the status of all services, 
# including their ports in all domains
dpbuddy serviceStatus -domainPatterns ".*"
# Check the status of the LBG group, 
# fail if any member of test-group is not in 'up' state
dpbuddy assertStatus -class="LoadBalancerStatus2" -expression="(Group!='test-group' || Health=='up')"
dpbuddy assertState
dpbuddy assertState -classPattern "(WSGateway|XMLFi.*)" -activeService
dpbuddy assertOpenPorts -ports "9090, 5550" -domain default

Ant:

<project name="dpbuddy.samples.status" basedir="." xmlns:dp="antlib:com.myarch.dpbuddy" >

    <description>
        Samples demonstrating querying and asserting the status.
    </description>

    <target name="status" description="Report device  status" >
        <!-- 'class' is any valid value from StatusEnum defined in xml-mgmt.xsd -->
        <dp:status class="ObjectStatus" />
        <dp:status class="DomainStatus" />
        <dp:status class="MemoryStatus" />
        <dp:status class="FilesystemStatus" />
    </target>

    <target name="service.status" description="Report services status" >
        <!-- This will print the status of all services, including their ports in all domains-->
        <dp:serviceStatus domainPatterns=".*"/>
    </target>

    <target name="assert.memory.status" description="Validate that there is enough free memory" >
        <property name="dpMemoryThreshold" value="65536"/>
        <dp:assertStatus class="MemoryStatus" expression="FreeMemory&gt;=${dpMemoryThreshold}"/>
    </target>

    <target name="assert.lbg.status" description="Validate that all members of a specific load balancing group are up" >
        <property name="lbgName" value="testLBG"/>
        <!-- LoadBalancerStatus2 provides more complete info about health than LoadBalancerStatus -->
        <!-- Fail if any member of testLBG is not in 'up' state -->
        <dp:assertStatus class="LoadBalancerStatus2" expression="(Group!='${lbgName}' || Health=='up')" />
    </target>

    <target name="assert.free.space" description="Make sure that we have sufficient free space" >
        <!-- minFreeSpace is in MB. If free space on the device is below this value, error will be raised -->
        <dp:assertFreeSpace minFreeSpace="10000" />
    </target>

    <target name="assert.state" description="Verify that objects are in the running state">
        <!-- This will check all objects in the domain.
        For the objects that are in "down" state, DPBuddy will display several most recent log entries
        to help troubleshoot the problem -->
        <dp:assertState />
    </target>

    <target name="assert.active.service" description="Verify that services are listening on ports">
        <dp:assertActiveService>
            <object class="(WSGateway|XMLFi.*)" />
        </dp:assertActiveService>
    </target>

    <target name="assert.open.ports" description="Verify that ports are open">
        <!-- As an example, we'll check that standard SOMA and WebGUI ports are open in the default domain -->
        <dp:assertOpenPorts ports="9090, 5550" domain="default" />
    </target>



    <target name="status.all" depends="status, assert.memory.status, assert.lbg.status, assert.free.space, assert.state" />

</project>