Over a million developers have joined DZone.

Task Monitor Clean Up in XL Deploy

It's really easy to gather XL Deploy tasks that haven't ben properly closed and archived. All you need is a simple CLI script.

· Performance Zone

Download Forrester’s “Vendor Landscape, Application Performance Management” report that examines the evolving role of APM as a key driver of customer satisfaction and business success, brought to you in partnership with BMC.

Over time it is possible to collect XL Deploy tasks that have not been closed and archived properly. A small CLI script can make sure that your completed XL Deploy tasks are all archived. Normally when a deployment is executed in XL Deploy it will be archived so you can review the status of the deployment later. Sometimes these tasks don’t automatically archive and will remain the XL Deploy Task Monitor.

import com.xebialabs.deployit.engine.api.execution.TaskExecutionState as TaskExecutionState

taskList = task2.getAllCurrentTasks()

for task in taskList:
if task.state == TaskExecutionState.EXECUTED :
print "Archive : %s %s %s %s" % ( task.id, task.description, task.owner, task.state )
task2.archive( task.id )
elif task.state == TaskExecutionState.FAILED :
print "Canceling: %s %s %s %s" % ( task.id, task.description, task.owner, task.state )
task2.cancel( task.id )
print "---------: %s %s %s %s" % ( task.id, task.description, task.owner, task.state )
# End if
# End for

An example of the output of this script is as follows: 

[localhost bin]$ ./cli.sh -q -f `pwd`/cleanTaskMonitor.py
Username: admin
Canceling: 1f92fe37-e5d2-42b0-ad0c-717c316a6174 Initial deployment of Environments/IBMPortletApp admin FAILED
Canceling: c901320f-7048-4b87-b3e4-abeaea8d2ac1 Initial deployment of Environments/BasicFilePlugin admin FAILED
---------: 20809f4d-3db5-4bc7-92df-dcd2d482ce75 Initial deployment of Environments/LocalEnv/variables admin STOPPED

See Forrester’s Report, “Vendor Landscape, Application Performance Management” to identify the right vendor to help IT deliver better service at a lower cost, brought to you in partnership with BMC.

performance,task monitor,monitoring,xl deploy

Published at DZone with permission of Rick Broker, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}