Operations Basics / Version 2101
Table Of Contents
An action definition is defined by the tag <ActionType>
. For <ActionType>
, the
name of the desired action is entered. A list of all possible actions is given in the
table below. The action is configured with a series of attributes, as follows:
Note
Actions that need to log into the Content Server, such as the
ServerMode
or ProcessStatus
action, can use the predefined user "watchdog" with
the default password "watchdog" for this purpose.
General attributes
Attribute | Optional | Description |
---|---|---|
name
| The name of the action. It must be unique within the configuration file. | |
interval
| x | Interval (in seconds) at which the number of action calls is checked. Checking is switched off with "0" (Default). |
events
| x | Maximum permissible number of calls of the action within "interval". If the maximum number is exceeded, the action is not executed and the error message "respawning_too_fast" is delivered. "events" is only used if "interval" <> "0". |
timeout
| x | Time (in seconds) to wait until a pending action is canceled with the error message "11". The default value is 60 seconds. |
Table 4.12. General attributes of the Action element
In addition, specific attributes can be assigned to the actions. These can be found in the following description of the actions.
Possible actions
Custom | |
---|---|
Description |
This action invokes a custom watchdog action (see the Javadoc of Example: <Custom name="my first action" timeout="10"> <Action class="com.customer.MyWatchDogAction" myprop="ok"> <MySub class="com.customer.MySub" foo="bar"/> <MySub class="com.customer.MySub" foo="baz"/> </Action> </Custom>
In this example, class Make sure that your custom action will not accumulate resources (Database, JMS connections etc.), otherwise the watchdog would itself need to be watched. In all nontrivial cases, starting an external script is strongly preferred.
The nested tags of the Action tag depend on the setters defined in your custom action class, here
|
Attributes | The Custom tag supports the general attributes for actions. All sub tags of Custom need the class attribute. All other attributes of the Action tag and its sub tags depend on the custom action. |
Error Codes | The error codes returned from the execute() method of the
custom action class. |
Table 4.13. Custom Action
DB | |
---|---|
Description | This action checks a CoreMedia database over the JDBC API. |
Attribute |
JDBC driver to use
URL where to connect to the database
Name of the database user
Password of the database user
The CoreMedia database configuration file (
You have to specify either driver, URL, user and password or the
The database statement that is used to check the database. Default is |
Error codes |
0 (ok) 10 (unexpected_error) 11 (timeout) 12 (error) 13 (respawning_too_fast) 21 (io_error) 61 (no_jdbc_driver) 62 (no_connection) 63 (sql_exception) |
Table 4.14. Action DB
Http | |
---|---|
Description | This action requests a URL and checks whether the response code is "200". If so configured, it also checks whether the response matches a given regular expression. |
Attribute |
Requested URL
User name to use for HTTP basic authentication, if given together with the password attribute
Password to use for HTTP basic authentication, if given together with the user attribute
Regular expression according to
Character encoding for parsing the response, if the pattern attribute is given
Maximum permitted size of the response in characters (default 65536), if the pattern attribute is given |
Error codes |
0 (ok) 10 (unexpected_error) 11 (timeout) 12 (error) 13 (respawning_too_fast) 21 (io_error) |
Table 4.15. Action HTTP
JMX | |
---|---|
Description |
The JMX action retrieves an attribute from any application via JMX and converts the attribute's
value into a watchdog code. This attribute conversion is done by one or more configured
By default, a converter
You might also implement a custom converter by extending
|
Attribute |
A URL to connect to a JMX server
The qualified name of the MBean.
The name of the MBean's attribute
The watchdog code to use if none of the converters is responsible
The user name for the JMX connection (optional).
The password for the JMX connection (optional).
Each converter needs to be specified as a <Converter> and has to provide its implementation class by "class" attribute. If the converter implementation provides additional configurable attributes ("setter methods"), these attributes might be specified as well. |
Error codes | The error codes depend on the configured converters or the default code is returned. |
Table 4.16. JMX Action
Example
<Jmx name="myJmxAction" serviceUrl="service:jmx:jmxmp://localhost:5555/" objectName="com.coremedia:type=ProactiveEngine,application=caefeeder" attributeName="HeartBeat" defaultCode="ok"> <Converter class="com.coremedia.watchdog.impl.NumberRangeConverter" min="10" max="29999" code="ok"/> <Converter class="com.coremedia.watchdog.impl.NumberRangeConverter" min="30000" code="error"/> </Jmx>
The JMX action "myJmxAction" retrieves the attribute HeartBeat
of the MBean
com.coremedia:type=ProactiveEngine,application=caefeeder
. If the attribute value is
between 10 and 29999 then a watchdog code "ok" is returned. A value greater or equal
"30000" results in a code "error". The default code "ok" is used if no converter applies,
if the value is lower than 10, for instance.
ProcessStatus | |
---|---|
Description | This action checks whether a specified number of instances of a process definition with a given name runs in the Workflow Server. It is also checked that these instances do not contain escalated tasks. |
Attribute |
URL where to get the IOR of the Workflow Server
CoreMedia user name to log on to the server
Domain of the user
CoreMedia user password to log on to the server
The name of the process definition. The predefined workflows have the following process names: GlobalSearchAndReplace, SimplePublication, ThreeStepPublication, TwoStepApproval, TwoStepPublication.
The minimum number of instances to expect, typically 1
The maximum number of instances to expect |
Error Codes |
0 (ok) 10 (unexpected_error) 11 (timeout) 12 (error) 13 (respawning_too_fast) 21 (io_error) 32 (invalid_login) 91 (escalated) 92 (too_few_instances) 93 (too_many_instances) |
Table 4.17. ProcessStatus
ServerMode | |
---|---|
Description | This action checks the runlevel of the CoreMedia server. This ensures that the server has reached the specified runlevel and that certain clients can connect to the server. |
Attribute |
URL where to get the IOR of the server
CoreMedia user name to log on to the server.
Domain of the user.
CoreMedia user password to log on to the server
The expected server runlevel. Valid values are "maintenance", "administration" and "online". |
Error codes |
0 (ok) 10 (unexpected_error) 11 (timeout) 12 (error) 13 (respawning_too_fast) 21 (io_error) 31 (no_licenses) 32 (invalid_login) 33 (corba_error) 71 (insufficient_mode) |
Table 4.18. Action ServerMode
ServerQuery | |
---|---|
Description |
This action executes a database query on the CoreMedia server over the CORBA API. In this way, all integral components of the server from ORB to the database connection are checked. |
Attribute |
URL where to get the IOR of the server
CoreMedia user name to log on to the server
Domain of the user.
CoreMedia user password to log on to the server |
Error Codes |
0 (ok) 11 (timeout) 12 (error) 13 (respanwing_too_fast) 21 (io_error) 31 (no_licenses) 32 (invalid_login) 33 (corba_error) 41 (repository_error) 51 (query_malformed) 52 (query_failed) |
Table 4.19. Server Query
ServiceStatus | |
---|---|
Description | This action checks a certain service offered by the CoreMedia server, for example the replicator of a Replication Live Server. |
Attribute |
URL where to get the IOR of the server
CoreMedia user name to log on to the server
Domain of the user.
CoreMedia user password to log on to the server
Name of the checked service. Possible values are:
|
Error codes |
0 (ok) 10 (unexpected_error) 11 (timeout) 12 (error) 13 (respawning_too_fast) 21 (io_error) 31 (no_licenses) 32 (invalid_login) 33 (corba_error) 81 (service_stopped) 82 (service_failed) 83 (service_disabled) |
Table 4.20. Action ServiceStatus
Script | |
---|---|
Description |
This action executes a shell command and checks whether the programs' return code is "0". If the command returns with a different value, an error is assumed.
Under the Windows operating system you cannot use non-executable commands like
dir, copy or echo directly. They will result in a
|
Attribute |
Name of the executable command |
Error codes | 0 (ok) |
Table 4.21. Action Script
WorkflowServerQuery | |
---|---|
Description | This action executes a database query on the CoreMedia workflow server over the CORBA API. In this way, all integral components of the server from ORB to the database connection are checked. |
Attribute |
URL where to get the IOR of the server
CoreMedia user name to log on to the server
Domain of the user.
CoreMedia user password to log on to the server |
Error Codes |
0 (ok) 10 (unexpected_error) 11 (timeout) 12 (error) 13 (respanwing_too_fast) 21 (io_error) 32 (invalid_login) 41 (repository_error) 52 (query_failed) |
Table 4.22. WorkflowServerQuery