Resin Documentationapp server |
health checking
Resin Professional includes a powerful and configurable system for monitoring application server health. The system is intentionally similar to the Resin's "URL Rewrite" rules, based on a configurable set of checks, conditions, and actions. The health checking system runs internal to Resin on a periodic basis. Checks are generally always performed on the local Resin node, and if actions are to be taken, they are performed against the local Resin node as well. Health configuration is an extension of the standard Resin configuration file resin.xml. Because Resin uses CanDI to create and update Java objects, each XML tag exactly matches either a Java class or a Java property. As a result, the HealthSystem JavaDoc and the JavaDoc of the various checks, actions, and predicates help to supplement the documentation as much as this reference. health.xmlResin version 4.0.16 and later includes health.xml as a standard Resin configuration file alongside resin.xml and app-default.xml. health.xml is imported into resin.xml as a
child of <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin"> <cluster-default> ... <!-- - Admin services --> <resin:DeployService/> <resin:if test="${resin.professional}"> <resin:AdminServices/> </resin:if> <!-- - Configuration for the health monitoring system --> <resin:if test="${resin.professional}"> <resin:import path="${__DIR__}/health.xml" optional="true"/> </resin:if> ... </cluster-default> </resin> <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthFatal/> </health:Restart> </cluster> health: namespacehealth.xml introduces a new XML namespace, Health check namingee: namespaceThe <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HttpStatusHealthCheck ee:Named="pingJspCheck"> <url>http://localhost:8080/test-ping.jsp</url> </health:HttpStatusHealthCheck> <health:Restart> <health:IfHealthCritical healthCheck="${pingJspCheck}"/> <health:IfRechecked/> </health:Restart> </cluster> In this example, an instance of HttpStatusHealthCheck is named 'pingJspCheck' and referred to by name in the IfHealthCritical criteria using an EL expression. The Restart action will only trigger if the health status is for this specific health check and no others.Default namesAll health checks classes are annotated with <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:CpuHealthCheck> <warning-threshold>95</warning-threshold> </health:CpuHealthCheck> <health:DumpThreads> <health:IfHealthWarning healthCheck="${cpuHealthCheck}"/> </health:DumpThreads> </cluster> Duplicate namesDuplicate health check names are not permitted. Resin will fail to
startup due to invalid configuration in this case. This can be caused by
configuring duplicate checks without using <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HttpStatusHealthCheck"> <url>http://localhost:8080/test1.jsp</url> </health:HttpStatusHealthCheck> <health:HttpStatusHealthCheck"> <url>http://localhost:8080/test2.jsp</url> </health:HttpStatusHealthCheck> </cluster> In the preceding example, use of <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HttpStatusHealthCheck" ee:Named="healthCheck"> <url>http://localhost:8080/test1.jsp</url> </health:HttpStatusHealthCheck> <health:CpuHealthCheck ee:Named="healthCheck"> <warning-threshold>95</warning-threshold> </health:CpuHealthCheck> </cluster> In the preceding example, the health check names must be different, regardless of the type of check. Default health configurationIf for any reason you are missing health.xml, for example you are upgrading from an older version of Resin and don't have the health.xml import in resin.xml, there's no need to worry. Resin creates some checks by default regardless of the presence of health.xml. Furthermore, Resin will detect if no checks are configured and setup default actions and conditions. Standard health checksThe following health checks are considered critical to standard operation
and thus will be created by Resin regardless of the presence of
health.xml. If you wish to disabled any of these standard health checks,
configure the check in health.xml and set the attribute
Default actionsIf any health checks are configured besides the standard checks mentioned above, Resin will assume the user is using health.xml and will not setup any health actions. If however health.xml is missing or empty, the following basic actions will be created. <health:Restart> <health:IfHealthFatal/> </health:Restart> child of <cluster> javadoc <health:HealthSystem>
Configures overall health checking frequency and recheck rules. This element is present in health.xml for clarity, but is not strictly required since it will be created upon startup with default values.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HealthSystem> <enabled>true</enabled> <startup-delay>15m</startup-delay> <period>5m</period> <recheck-period>30s</recheck-period> <recheck-max>10</recheck-max> </health:HealthSystem> </cluster> Health checks are status monitors which are executed on a periodic basis by the health system to determine an individual health status. Health checks are designed to be simple; repeatedly evaluating the same data. The health system determines an overall Resin health status by aggregating the results of all the configured health checks. Health statusEvery time a health check executes it produces a HealthStatus and a message. The following is a list of all health statuses and their generally implied meaning.
The descriptions above should be understood to be entirely dependent on
health action and predicate configuration. For example, a FATAL status does
not imply a restart will occur unless System checksSystem checks are health checks that can only exist once per JVM due to the nature of the data they sample. Most system checks are pre-configured in the default health.xml. Note: System checks are singletons. Configuring duplicate system checks with different names will not result in the creation of duplicate system checks. The following is technically valid configuration, but results in configuring the same system check twice. <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:CpuHealthCheck ee:Named="cpuCheck1"> <warning-threshold>95</warning-threshold> </health:CpuHealthCheck> <health:CpuHealthCheck ee:Named="cpuCheck2"> <warning-threshold>99</warning-threshold> </health:CpuHealthCheck> </cluster> In this example, child of <cluster>
Monitors the health of Resin database connection pools. See <database> for additional information.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:ConnectionPoolHealthCheck/> </cluster> child of <cluster> javadoc <health:CpuHealthCheck>
Monitors CPU usage. On multi-core machines, each CPU is checked individually.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:CpuHealthCheck> <warning-threshold>95</warning-threshold> <critical-threshold>99</critical-threshold> </health:CpuHealthCheck> </cluster> child of <cluster> javadoc <health:HealthSystemHealthCheck>
Monitors the health system itself by using a separate thread to detect if health checking is frozen or taking too long.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HealthSystemHealthCheck> <thread-check-period>1m</thread-check-period> <freeze-timeout>15m</freeze-timeout> </health:HealthSystemHealthCheck> </cluster> child of <cluster> javadoc <health:HeartbeatHealthCheck>
Monitors for heartbeats from other members of the cluster.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HeartbeatHealthCheck/> </cluster> child of <cluster> javadoc <health:JvmDeadlockHealthCheck>
Monitors for deadlocked threads, as determined by the JVM.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:JvmDeadlockHealthCheck/> </cluster> child of <cluster> javadoc <health:LicenseHealthCheck>
Checks for expiring Resin Pro license.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:LicenseHealthCheck> <warning-period>30D</warning-period> </health:LicenseHealthCheck> </cluster> child of <cluster>
Monitors the amount of free memory in the JVM PermGen memory pool. Requests a garbage collection if memory falls too low. Note: This check does not apply to all JVM vendor implementations, and will report UNKNOWN if there is no PermGen pool.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:MemoryPermGenHealthCheck> <memory-free-min>1m</memory-free-min> <free-warning>0.01</free-warning> </health:MemoryPermGenHealthCheck> </cluster> child of <cluster>
Monitors the amount of free memory in the JVM Tenured memory pool. Requests a garbage collection if memory falls too low. This check will monitor heap memory on JVMs where there is no tenured pool. Note:
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:MemoryTenuredHealthCheck> <memory-free-min>1m</memory-free-min> <free-warning>0.01</free-warning> </health:MemoryTenuredHealthCheck> </cluster> child of <cluster> javadoc <health:TransactionHealthCheck>
Monitors the Resin transaction manager for commit failures.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:TransactionHealthCheck/> </cluster> User checksUser checks are not pre-defined in health.xml; an administrator must configure them in health.xml as appropriate for an application. User checks are not singletons; the same check type can be configured in health.xml more than once provided they have different names. <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <!-- Http status check 1 for database with email to database admin --> <health:HttpStatusHealthCheck ee:Named="databaseCheck"> <url>http://localhost:8080/databaseCheck.jsp</url> </health:HttpStatusHealthCheck> <health:SendMail> <to>[email protected]</to> <health:IfHealthCritical healthCheck="${databaseCheck}"/> <health:IfRechecked/> </health:SendMail> <!-- Http status check 2 for application with email to application admin --> <health:HttpStatusHealthCheck" ee:Named="appCheck"> <url>http://localhost:8080/applicationTest.jsp</url> </health:HttpStatusHealthCheck> <health:SendMail> <to>[email protected]</to> <health:IfHealthCritical healthCheck="${appCheck}"/> <health:IfRechecked/> </health:SendMail> </cluster> child of <cluster> javadoc <health:HttpStatusHealthCheck>
Monitors one or more URLs on the current Resin instance by making an HTTP GET request and comparing the returned HTTP status code to a pattern.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HttpStatusHealthCheck> <ping-host>localhost</ping-host> <ping-port>8080</ping-port> <url>/custom-test-1.jsp</url> <url>/custom-test-2.jsp</url> <socket-timeout>2s</socket-timeout> <regexp>^2|^3</regexp> </health:HttpStatusHealthCheck> </cluster> In some clustered configurations it may be simpler to use the
<!-- resin.xml --> <resin xmlns="http://caucho.com/ns/resin"> <cluster id="web-tier"> <server-default> <ping-url>/ping-test.jsp<ping-url> </server-default> ... </cluster> </resin> <!-- health.xml --> <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HttpStatusHealthCheck ee:Named="serverHttpPingCheck"> <socket-timeout>5s</socket-timeout> <regexp>200</regexp> </health:HttpStatusHealthCheck> </cluster> child of <cluster> javadoc <health:ExprHealthCheck>
Evaluates user supplied EL expressions to a boolean.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:ExprHealthCheck> <critical-test>${mbean('java.lang:type=Threading').ThreadCount > 100}</critical-test> </health:ExprHealthCheck> </cluster> Health actions perform a task, usually in response to specific conditions, or as remediation for a health check status. Like health checks, health actions are configured in health.xml and executed by the health system on a periodic basis. Health actions are usually accompanied by one or more conditions, or predicates, but this is not required. All actions have the potential to be executed once per period, determined by evaluation of associated conditions. A health action with no conditions will execute once per period. child of <cluster> javadoc <health:ActionSequence>
Executes a sequence of child health actions in order.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:ActionSequence> <health:DumpThreads/> <health:DumpHeap/> <health:IfHealthCritical time="5m"/> </health:ActionSequence> </cluster> child of <cluster> javadoc <health:CallJmxOperation>
Executes a JMX MBean operation with parameters. Note: Calling a JMX operation can also be performed on-demand using the command line.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:CallJmxOperation> <objectName>java.lang:type=Threading</objectName> <operation>resetPeakThreadCount</operation> <health:IfNotRecent time='5m'/> </health:CallJmxOperation> </cluster> child of <cluster> javadoc <health:DumpHeap>
Create a memory heap dump. The heap dump will be logged to the internal log
database and to the resin log file using
Note: Creating a heap dump can also be performed on-demand using the command line, and from /resin-admin.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:DumpHeap/> </cluster> <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:DumpHeap> <hprof>true</hprof> <hprof-path-format>${resin.home}/log/dump-%H:%M:%S.%s.hprof</hprof-path-format> <health:OnAbnormalStop/> </health:DumpHeap> </cluster> child of <cluster> javadoc <health:DumpHprofHeap>
Shortcut for <health:DumpHeap hprof='true'/> child of <cluster> javadoc <health:DumpJmx>
Health action to create a dump of all JMX attributes and values. The JMX
dump will be logged to the internal log database and to the resin log file
using Note: Creating a JMX dump can also be performed on-demand using the command line.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:DumpJmx/> </cluster> child of <cluster> javadoc <health:DumpThreads>
Create a thread dump. The thread dump will be logged to the internal log
database and log file using Note: Creating a thread dump can also be performed on-demand using the command line.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:DumpThreads> <only-active>false</only-active> </health:DumpThreads> </cluster> child of <cluster> javadoc <health:ExecCommand>
Execute an operating system shell command.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:ExecCommand> <dir>/tmp</dir> <command>remediation.sh</command> <timeout>2s</timeout> <env> <name>resin_home</name> <value>${resin.home}</value> </env> <env> <name>password</name> <value>foo</value> </env> </health:ExecCommand> </cluster> child of <cluster> javadoc <health:FailSafeRestart>
A timed restart of Resin, normally used in conjunction with an ActionSequence to gather shutdown information
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:ActionSequence> <health:FailSafeRestart timeout="10m"/> <health:DumpThreads/> <health:DumpHeap/> <health:StartProfiler active-time="5m"/> <health:Restart/> <health:IfHealthCritical time="5m"/> </health:ActionSequence> </cluster> child of <cluster> javadoc <health:PdfReport>
Health action to generate a PDF report from a PHP script.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:PdfReport> <path>${resin.home}/doc/admin/pdf-gen.php</path> <report>Summary</report> <period>7D</report> <health:IfCron value="0 0 * * 0"/> </health:PdfReport> </cluster> child of <cluster> javadoc <health:Restart>
Restart Resin. Resin will exit with the reason HEALTH.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart/> </cluster> child of <cluster> javadoc <health:ScoreboardReport>
Produces a concise thread activity report for groups of related threads. Note: A scoreboard report can also be produced using the command line.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:ScoreboardReport> <health:OnAbnormalStop/> </health:ScoreboardReport> </cluster> child of <cluster> javadoc <health:SendMail>
Send an email containing a summary of the current Resin health status.
Without the parameter, the default behaviour for sending mail is to contact an SMTP server at host 127.0.0.1 (the localhost) on port 25. System properties can be used to configure a different SMTP server.<system-property mail.smtp.host="127.0.0.1"/> <system-property mail.smtp.port="25"/> <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:SendMail> <to>[email protected]</to> <to>[email protected]</to> <from>[email protected]</from> <health:SendMail> </cluster> Much more advanced SMTP options can be set by configuring a <mail> resource to use for sending health alerts. <cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <mail name="healthMailer"> <smtp-host>mail.yourdomain.com</smtp-host> <smtp-port>25</smtp-port> <from>[email protected]</from> </mail> <health:SendMail mail="${healthMailer}"> <to>[email protected]</to> <health:SendMail> </cluster> child of <cluster> javadoc <health:Snapshot>
A specific sequence of health actions: thread dump, heap dump, jmx dump, and pdf report. This is intended to generate a permanent representation, or "snapshot" of the system at a point in time that includes all the information necessary to debug server issues. It is usually intended to run in response to a unexpected issue.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Snapshot> <health:OnAbnormalStop/> </health:Snapshot> </cluster> child of <cluster> javadoc <health:StartProfiler>
Starts a profiler session. Results are logged to the internal database and the Resin log file at INFO level. Note: Starting the profiler can also be performed on-demand using the command line, and from /resin-admin.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:ActionSequence> <health:FailSafeRestart timeout="10m"/> <health:DumpThreads/> <health:DumpHeap/> <health:StartProfiler active-time="5m"/> <health:Restart/> <health:IfHealthCritical time="5m"/> </health:ActionSequence> </cluster> Health condition, or predicates, qualify an action to execute based on a set of criteria. The action/condition pattern is intentionally similar to Resin's rewrite dispatch/condition pattern, so it should be familiar to some users. Health actions are evaluated every period. Conditions prevent the execution of an action unless all condition evaluate to true. A health action with no conditions will execute once per period. When more than one condition is present for an action, the default combining condion is <health;And>. Basic conditionsBasic conditions evaluate some general criteria and return true if the condition matches. Basic conditions do not evaluate the status of a health check. Instead they evaluate some general criteria like the time of day. child of <cluster> javadoc <health:IfCron>
Qualify an action to execute if the current time is in an active range configured by cron-style times. This can be used both to schedule regular actions or to prevent restarts or other actions during critical times.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfCron> <enable-at>0 0 * * *</enable-at> <disable-at>5 0 * * *</disable-at> </health:IfCron> </health:Restart> </cluster> child of <cluster> javadoc <health:IfExpr>
Qualifies an action to execute based on the evaluation of an JSP EL expression. Expression can include references to system properties, config properties, and JMX mbean attributes.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfExpr> <test>${mbean('java.lang:type=Threading').ThreadCount > 100}</test> </health:IfExpr> </health:Restart> </cluster> child of <cluster> javadoc <health:IfNotRecent>
Qualifies an action to match at most an amount of time after the last execution. This is usefull to prevent unecessary frequent execution of an action.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:HttpStatusHealthCheck ee:Named="httpStatusCheck"> <url>http://localhost:8080/test-ping.jsp</url> </health:HttpStatusHealthCheck> <health:DumpHeap> <health:IfHealthCritical healthCheck="${httpStatusCheck}"/> <health:IfNotRecent time='5m'/> </health:DumpHeap> </cluster> child of <cluster> javadoc <health:IfRechecked>
Qualifies an action to match only after the required number of rechecks have been performed. Since rechecking is not a health check specific condition, this predicate simply matches when recheck cycle count matches the HealthSystem parameter .
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthFatal/> <health:IfRechecked/> </health:Restart> </cluster> child of <cluster> javadoc <health:IfUptime>
Qualifies an action to match an amount of time after startup.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfUptime limit="12h"/> </health:Restart> </cluster> Combining conditionsGeneral condition or health check conditions can be combined or negated using these conditions. child of <cluster> javadoc <health:And>
Qualifies an action to match if all of the child predicates match. Note: <health:And> is implied and thus not strictly necessary except when used in conjunction with more complex combining conditions.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:And> <health:IfHealthCritical health-check="${memoryTenuredHealthCheck}"/> <health:IfHealthCritical health-check="${memoryPermGenHealthCheck}"/> </health:And> </health:Restart> </cluster> child of <cluster> javadoc <health:Nand>
Qualifies an action to match if all of the child predicates fail.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:Nand> <health:IfHealthCritical health-check="${memoryTenuredHealthCheck}"/> <health:IfHealthCritical health-check="${memoryPermGenHealthCheck}"/> </health:Nand> </health:Restart> </cluster> child of <cluster> javadoc <health:Nor>
Qualifies an action to match if none of the child predicates match.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:Nor> <health:IfHealthCritical health-check="${memoryTenuredHealthCheck}"/> <health:IfHealthCritical health-check="${memoryPermGenHealthCheck}"/> </health:Nor> </health:Restart> </cluster> child of <cluster> javadoc <health:Not>
Qualifies an action to match if the child predicate is false.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthCritical health-check="${memoryTenuredHealthCheck}"/> <health:Not> <health:IfCron> <enable-at>0 7 * * *</enable-at> <disable-at>0 11 * * *</disable-at> </health:IfCron> </health:Not> </health:Restart> </cluster> child of <cluster> javadoc <health:Or>
Qualifies an action to match if any of the child predicates match.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:Or> <health:IfHealthCritical health-check="${memoryTenuredHealthCheck}"/> <health:IfHealthCritical health-check="${memoryPermGenHealthCheck}"/> </health:Or> </health:Restart> </cluster> Health check conditionsAll health check conditions evaluate some aspect of the results of a health check. All optionally accept the parameter , which can reference a specific named health check. In absence of this parameter, overall aggregated Resin health will be used.child of <cluster> javadoc <health:IfHealthOk>
Qualifies an action to match if health status is OK.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:Not> <health:IfHealthOk health-check="${memoryTenuredHealthCheck}"/> </health:Not> </health:Restart> </cluster> child of <cluster> javadoc <health:IfHealthWarning>
Qualifies an action to match if health status is WARNING.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthWarning health-check="${memoryTenuredHealthCheck}"/> </health:Restart> </cluster> child of <cluster> javadoc <health:IfHealthCritical>
Qualifies an action to match if health status is CRITICAL.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthCritical health-check="${memoryTenuredHealthCheck}"/> </health:Restart> </cluster> child of <cluster> javadoc <health:IfHealthFatal>
Qualifies an action to match if health status is FATAL.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthFatal health-check="${memoryTenuredHealthCheck}"/> </health:Restart> </cluster> child of <cluster> javadoc <health:IfHealthUnknown>
Qualifies an action to match if health status is UNKNOWN.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthUnknown health-check="${memoryTenuredHealthCheck}"/> </health:Restart> </cluster> child of <cluster> javadoc <health:IfMessage>
Qualifies an action to match the health result message to a regular expression.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:Restart> <health:IfHealthCritical/> <health:IfMessage health-check="${httpStatusCheck}" regexp="Not Found"/> </health:Restart> </cluster> child of <cluster> javadoc <health:IfRecovered>
Qualifies an action to match upon recovery. Recovery is defined as the state change from FATAL, CRITICAL, or WARNING to OK.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:SendMail> <to>admin@yourdomain</to> <health:IfRecovered health-check="${cpuHealthCheck}"/> </health:SendMail> </cluster> child of <cluster> javadoc <health:IfHealthEvent>
Causes an action to fire in response to a matching health event. This is usually used in combination with <AnomalyAnalyzer> with a <health-event> attribute.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:JmxMeter> <name>JVM|Thread|JVM Blocked Count</name> <objectName>resin:type=JvmThreads</objectName> <attribute>BlockedCount</attribute> </health:JmxMeter> <health:AnomalyAnalyzer> <meter>JVM|Thread|JVM Blocked Count</meter> <health-event>caucho.thread.anomaly.jvm-blocked</health-event> </health:AnomalyAnalyzer> <health:DumpThreads> <health:IfHealthEvent regexp="caucho.thread"/> <health:IfNotRecent time="15m"/> </health:DumpThreads> </cluster> Lifecycle conditionsLifecycle conditions evaluate the current state of Resin, qualifying actions to execute only during a Resin lifecycle state change. child of <cluster> javadoc <health:OnStart>
Qualifies an action to match only when Resin is starting.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:SendMail> <to>[email protected]</to> <health:OnStart/> </health:SendMail> </cluster> child of <cluster> javadoc <health:OnStop>
Qualifies an action to match only when Resin is stopping.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:SendMail> <to>[email protected]</to> <health:OnStop/> </health:SendMail> </cluster> child of <cluster> javadoc <health:OnAbnormalStop>
Qualifies an action to match only when Resin is stopping with an non-OK exit code.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:PdfReport snapshot='true'> <health:OnAbnormalStop/> </health:PdfReport </cluster> child of <cluster> javadoc <health:OnRestart>
Qualifies an action to match only when Resin is restarted by the watchdog. This generally only occurs during an error condition. OnStart will fire during this event also.
<cluster xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:health="urn:java:com.caucho.health" xmlns:ee="urn:java:ee"> <health:SendMail> <to>[email protected]</to> <health:OnRestart/> </health:SendMail> </cluster>
|