Atomia Cron Job Agent

Atomia Cron Job Agent

192 views 1

This manual covers installation and configuration of the The Cron Job Agent to enable your customers to schedule regular tasks.


The Cron Agent allows your customers to schedule regular tasks. The agent regularly accesses websites and exposes a RESTful management interface.

Before you begin

The cron agent must be installed on a linux machine. The preconditions are that the machine has mongodb installed.

Installing mongodb

First a new source file will need to be created for apt and the needed public key added:

echo "deb dist 10gen" > /etc/apt/sources.list.d/10gen.list
apt-key adv --keyserver --recv 7F0CEB10
apt-get update

After that we can install mongodb

apt-get -y install mongodb-10gen

Installing the agent

The actual installation is done like this:

apt-get -y install atomia-cronagent

After that you need to change the config file etc/default/cronagent and configure access to the cronagent.

[email protected]

We will explain the individual configuration options here:

MONGO_* Access to the mongodb. The default values are fine if mongo is installed locally.
CRON_LISTEN_PORT Port for the management interface to listen on. Default is 10101.
CRON_GLOBAL_AUTH_TOKEN Token to authenticate to the management interface. The same token needs to be inserted on the Automation Server side.
MIN_PART, MAX_PART These values are used to balance the load between the different machines. Every taks is assigned a random number between 0 and 1000 (inclusive) and is only executed on the agent in which part range it falls. So for example if you wanted to balance the load between two machines you could set the part to 0-499 on machine 1 and 500-1000 on machine 2.
INTERVAL How often the cron agent should check if cron tasks are due (in seconds). Note that this does not affect how often the actual tasks are running.
MAIL_* Access to the SMTP server. User and password are optional.
MAIL_FROM The sender address of mails sent to customers from the cron agent.

Finally we can start the service

/etc/init.d/atomia-cronagent restart

Changes in the Automation Server

The cronagent module is part of the CloudHostingModules. The GUI is part of HCP.

Add resource

A new resource needs to be added:

      <module name="Atomia.Provisioning.Modules.CronAgent.CronAgent" resourceAsignmentPolicy="RoundRobin" />
      <resource name="CronAgent01">
        <property name="CronBaseUrl">http://{IP}:10101</property>
        <property name="AuthToken">Chonc2908jTHoge</property>

Provisioning Description

Then you need to copy the CronTasks simple service description from the Default Provisioning description to the provisioning description. Finally the cron task can be added to the premium package:

<package name="PremiumPackage">
          <service name="CronTasks" />

Was this helpful?