
CQ automated Felix bundle start
We have just gone live with a “large” number of Adobe CQ 5.4 publish instances. I have written a Perl script which checks to see if Felix bundles are all started OK. The perl works by parsing the output from http://server:port:/system/console/bundles (use a curl command to login as admin) and read the HTML output as a stream into your perl:
The perl looks for 5 comma sep integers “[171,167,3,1,0]” which appear at the top of the page. There is a check for Resolved or Installed bundles which are greater than zero. If either are true we set a bundlesToStart flag to true.
We then loop throught all the bundles looking for text “Resolved | Installed”. If we find some - we find the name of the bundle (we have a regular expression which looks for symbolicName - and extracts the name of bundle). |
This information is used to start the bundle :O) This has saved the infrastructure team (I work in) the hassle of opening a web-browser and restarting bundles manually.
———
if ( $ARGV[0]=~ /[(d+),(d+),(d+),(d+),(d+)]/ ) { if ( $4 > 0 || $5 > 0 ) { # If either installed or resolved is greater than 0 - set our flag to true $bundlesToStart = true; } }
if ( $ARGV[0]=~ /Resolved|Installed/ && $bundlesToStart == true ) { if ( $ARGV[0]=~ /symbolicName”:”([^”]+)/) { print “++++++ Restarting ” . $1 . ” +++++++n”; my $curlString = “curl -u admin:password http://” . $serverNamePort . “/system/console/bundles/” . $1 . ” -Faction=start 2>&1”; system($curlString); print “++++++n”; } }