Permalink
Browse files

Merge branch 'master' of github.com:ClusterLabs/pacemaker

  • Loading branch information...
2 parents 2a917dd + f2a0c41 commit 8b68805c0f64c24e1a14180ec76eb2f6b8a0455d @beekhof committed Mar 14, 2013
@@ -23,14 +23,15 @@ that the author is comfortable with.
indexterm:[Resource,class]
-There are five classes of agents supported by Pacemaker:
+There are six classes of agents supported by Pacemaker:
* OCF
* LSB
* Upstart
* Systemd
* Fencing
* Service
+* Nagios
indexterm:[Resource,Heartbeat]
indexterm:[Heartbeat,Resources]
@@ -183,6 +184,23 @@ There is also an additional class, STONITH, which is used exclusively
for fencing related resources. This is discussed later in
<<ch-stonith>>.
+=== Nagios Plugins ===
+indexterm:[Resource,Nagios Plugins]
+indexterm:[Nagios Plugins,Resources]
+
+Nagios plugins allow us to monitor services on the remote hosts.
+http://nagiosplugins.org[Nagios Plugins].
+
+Pacemaker is able to do remote monitoring with the plugins _if they are
+present_.
+
+An use case is to configure them as resources belonging to a resource
+container, which usually is a VM, and the container will be restarted
+if any of them has failed. While they can also be configured as ordinary
+resources to be just used for monitoring hosts or services via network.
+
+The supported parameters are same as the long options of a nagios plugin.
+
[[primitive-resource]]
== Resource Properties ==
View
@@ -1082,6 +1082,9 @@ crm_ipc_send(crm_ipc_t * client, xmlNode * message, enum crm_ipc_flags flags, in
crm_info("Request was %.120s", buffer);
}
+ free(header);
+ free(iov[1].iov_base);
+ free(iov);
free(buffer);
return rc;
}
View
@@ -562,12 +562,6 @@ setup_container(resource_t * rsc, pe_working_set_t * data_set)
rsc->container = container;
container->fillers = g_list_append(container->fillers, rsc);
pe_rsc_trace(rsc, "Resource %s's container is %s", rsc->id, container_id);
- if (rsc->is_remote_node) {
- node_t *node = g_hash_table_lookup(container->allowed_nodes, rsc->id);
- if (node) {
- node->weight = -INFINITY;
- }
- }
} else {
pe_err("Resource %s: Unknown resource container (%s)", rsc->id, container_id);
}
View
@@ -311,6 +311,7 @@ services_action_free(svc_action_t * op)
free(op->opaque->args[i]);
}
+ free(op->opaque);
free(op->rsc);
free(op->action);
@@ -452,6 +452,9 @@ services_os_action_execute(svc_action_t * op, gboolean synchronous)
read_output(op->opaque->stdout_fd, op);
read_output(op->opaque->stderr_fd, op);
+ close(op->opaque->stdout_fd);
+ close(op->opaque->stderr_fd);
+
} else {
crm_trace("Async waiting for %d - %s", op->pid, op->opaque->exec);
mainloop_add_child(op->pid, op->timeout, op->id, op, operation_finished);
View
@@ -1179,6 +1179,19 @@ native_create_actions(resource_t * rsc, pe_working_set_t * data_set)
}
}
+static void
+rsc_avoids_remote_nodes(resource_t *rsc)
+{
+ GHashTableIter iter;
+ node_t *node = NULL;
+ g_hash_table_iter_init(&iter, rsc->allowed_nodes);
+ while (g_hash_table_iter_next(&iter, NULL, (void **)&node)) {
+ if (node->details->remote_rsc) {
+ node->weight = -INFINITY;
+ }
+ }
+}
+
void
native_internal_constraints(resource_t * rsc, pe_working_set_t * data_set)
{
@@ -1272,16 +1285,17 @@ native_internal_constraints(resource_t * rsc, pe_working_set_t * data_set)
}
if (rsc->is_remote_node || is_stonith) {
- GHashTableIter iter;
- node_t *node = NULL;
- g_hash_table_iter_init(&iter, rsc->allowed_nodes);
- while (g_hash_table_iter_next(&iter, NULL, (void **)&node)) {
- /* don't allow remote nodes to run stonith devices
- * or remote connection resources.*/
- if (node->details->remote_rsc) {
- node->weight = -INFINITY;
- }
- }
+ /* don't allow remote nodes to run stonith devices
+ * or remote connection resources.*/
+ rsc_avoids_remote_nodes(rsc);
+ }
+
+ /* If this rsc is a remote connection resource associated
+ * with a container ( which will most likely be a virtual guest )
+ * do not allow the container to live on any remote-nodes.
+ * remote-nodes managing nested remote-nodes should not be allowed. */
+ if (rsc->is_remote_node && rsc->container) {
+ rsc_avoids_remote_nodes(rsc->container);
}
}
View
@@ -675,6 +675,7 @@ do_test container-group-4 "Container in group - reached migration-threshold"
echo ""
do_test whitebox-fail1 "Fail whitebox container rsc."
do_test whitebox-fail2 "Fail whitebox container rsc lrmd connection."
+do_test whitebox-fail3 "Failed containers should not run nested on remote nodes."
do_test whitebox-start "Start whitebox container with resources assigned to it"
do_test whitebox-stop "Stop whitebox container with resources assigned to it"
do_test whitebox-move "Move whitebox container with resources assigned to it"
@@ -0,0 +1,40 @@
+digraph "g" {
+"18builder_monitor_0 dvossel-laptop2" -> "probe_complete dvossel-laptop2" [ style = bold]
+"18builder_monitor_0 dvossel-laptop2" [ style=bold color="green" fontcolor="black"]
+"18builder_monitor_30000 dvossel-laptop2" [ style=bold color="green" fontcolor="black"]
+"18builder_start_0 dvossel-laptop2" -> "18builder_monitor_30000 dvossel-laptop2" [ style = bold]
+"18builder_start_0 dvossel-laptop2" -> "FAKE_start_0 18builder" [ style = bold]
+"18builder_start_0 dvossel-laptop2" -> "W:1_monitor_10000 18builder" [ style = bold]
+"18builder_start_0 dvossel-laptop2" -> "W:1_start_0 18builder" [ style = bold]
+"18builder_start_0 dvossel-laptop2" -> "X:1_monitor_10000 18builder" [ style = bold]
+"18builder_start_0 dvossel-laptop2" -> "X:1_start_0 18builder" [ style = bold]
+"18builder_start_0 dvossel-laptop2" [ style=bold color="green" fontcolor="black"]
+"FAKE_start_0 18builder" [ style=bold color="green" fontcolor="black"]
+"FAKE_stop_0 dvossel-laptop2" -> "FAKE_start_0 18builder" [ style = bold]
+"FAKE_stop_0 dvossel-laptop2" -> "all_stopped" [ style = bold]
+"FAKE_stop_0 dvossel-laptop2" [ style=bold color="green" fontcolor="black"]
+"W-master_running_0" [ style=bold color="green" fontcolor="orange"]
+"W-master_start_0" -> "W-master_running_0" [ style = bold]
+"W-master_start_0" -> "W:1_start_0 18builder" [ style = bold]
+"W-master_start_0" [ style=bold color="green" fontcolor="orange"]
+"W:1_monitor_10000 18builder" [ style=bold color="green" fontcolor="black"]
+"W:1_start_0 18builder" -> "W-master_running_0" [ style = bold]
+"W:1_start_0 18builder" -> "W:1_monitor_10000 18builder" [ style = bold]
+"W:1_start_0 18builder" [ style=bold color="green" fontcolor="black"]
+"X-master_running_0" [ style=bold color="green" fontcolor="orange"]
+"X-master_start_0" -> "X-master_running_0" [ style = bold]
+"X-master_start_0" -> "X:1_start_0 18builder" [ style = bold]
+"X-master_start_0" [ style=bold color="green" fontcolor="orange"]
+"X:1_monitor_10000 18builder" [ style=bold color="green" fontcolor="black"]
+"X:1_start_0 18builder" -> "X-master_running_0" [ style = bold]
+"X:1_start_0 18builder" -> "X:1_monitor_10000 18builder" [ style = bold]
+"X:1_start_0 18builder" [ style=bold color="green" fontcolor="black"]
+"all_stopped" [ style=bold color="green" fontcolor="orange"]
+"probe_complete dvossel-laptop2" -> "probe_complete" [ style = bold]
+"probe_complete dvossel-laptop2" [ style=bold color="green" fontcolor="black"]
+"probe_complete" -> "18builder_start_0 dvossel-laptop2" [ style = bold]
+"probe_complete" -> "FAKE_stop_0 dvossel-laptop2" [ style = bold]
+"probe_complete" [ style=bold color="green" fontcolor="orange"]
+"vm_start_0 dvossel-laptop2" -> "18builder_start_0 dvossel-laptop2" [ style = bold]
+"vm_start_0 dvossel-laptop2" [ style=bold color="green" fontcolor="black"]
+}
Oops, something went wrong.

0 comments on commit 8b68805

Please sign in to comment.