<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>22.1. Events</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Apache_CloudStack-Admin_Guide-4.1.0-it-IT-1-" /><script type="text/javascript" src="../../../../../toc.js"></script><script type="text/javascript">
              addID('Apache_CloudStack');
              
	      addID('Apache_CloudStack.4.1.0');
              
              addID('Apache_CloudStack.4.1.0.books');
	      addID('Apache_CloudStack.4.1.0.Admin_Guide');
              </script><link rel="home" href="index.html" title="Manuale di Amministrazione CloudStack" /><link rel="up" href="troubleshooting.html" title="Capitolo 22. Troubleshooting" /><link rel="prev" href="troubleshooting.html" title="Capitolo 22. Troubleshooting" /><link rel="next" href="troubleshooting-working-with-server-logs.html" title="22.2. Working with Server Logs" /></head><body class="toc_embeded "><div id="tocdiv" class="toc"><iframe id="tocframe" class="toc" src="../../../../toc.html">This is an iframe, to view it upgrade your browser or enable iframe display.</iframe></div><p id="title"><a class="left" href="http://cloudstack.apache.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://cloudstack.apache.org/docs"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="troubleshooting.html"><strong>Indietro</strong></a></li><li class="next"><a accesskey="n" href="troubleshooting-working-with-server-logs.html"><strong>Avanti</strong></a></li></ul><div xml:lang="it-IT" class="section" id="events" lang="it-IT"><div class="titlepage"><div><div><h2 class="title" id="events">22.1. Events</h2></div></div></div><div class="para">
		An event is essentially a significant or meaningful change in the state of both virtual and physical resources associated with a cloud environment. Events are used by monitoring systems, usage and billing systems, or any other event-driven workflow systems to discern a pattern and make the right business decision. In CloudStack an event could be a state change of virtual or psychical resources, an action performed by an user (action events), or policy based events (alerts).
	</div><div xml:lang="it-IT" class="section" id="events-log" lang="it-IT"><div class="titlepage"><div><div><h3 class="title" id="events-log">22.1.1. Event Logs</h3></div></div></div><div class="para">
		There are two types of events logged in the CloudStack Event Log. Standard events log the success or failure of an event and can be used to identify jobs or processes that have failed. There are also long running job events. Events for asynchronous jobs log when a job is scheduled, when it starts, and when it completes. Other long running synchronous jobs log when a job starts, and when it completes. Long running synchronous and asynchronous event logs can be used to gain more information on the status of a pending job or can be used to identify a job that is hanging or has not started. The following sections provide more information on these events..
	</div></div><div xml:lang="it-IT" class="section" id="event-framework" lang="it-IT"><div class="titlepage"><div><div><h3 class="title" id="event-framework">22.1.2. Event Notification</h3></div></div></div><div class="para">
		Event notification framework provides a means for the Management Server components to publish and subscribe to CloudStack events. Event notification is achieved by implementing the concept of event bus abstraction in the Management Server. An event bus is introduced in the Management Server that allows the CloudStackcomponents and extension plug-ins to subscribe to the events by using the Advanced Message Queuing Protocol (AMQP) client. In CloudStack, a default implementation of event bus is provided as a plug-in that uses the RabbitMQ AMQP client. The AMQP client pushes the published events to a compatible AMQP server. Therefore all the CloudStack events are published to an exchange in the AMQP server.
	</div><div class="para">
		A new event for state change, resource state change, is introduced as part of Event notification framework. Every resource, such as user VM, volume, NIC, network, public IP, snapshot, and template, is associated with a state machine and generates events as part of the state change. That implies that a change in the state of a resource results in a state change event, and the event is published in the corresponding state machine on the event bus. All the CloudStack events (alerts, action events, usage events) and the additional category of resource state change events, are published on to the events bus.
	</div><div class="formalpara"><h5 class="formalpara" id="idp8265768">Use Cases</h5>
			The following are some of the use cases:
		</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
				Usage or Billing Engines: A third-party cloud usage solution can implement a plug-in that can connects to CloudStack to subscribe to CloudStack events and generate usage data. The usage data is consumed by their usage software.
			</div></li><li class="listitem"><div class="para">
				AMQP plug-in can place all the events on the a message queue, then a AMQP message broker can provide topic-based notification to the subscribers.
			</div></li><li class="listitem"><div class="para">
				Publish and Subscribe notification service can be implemented as a pluggable service in CloudStack that can provide rich set of APIs for event notification, such as topics-based subscription and notification. Additionally, the pluggable service can deal with multi-tenancy, authentication, and authorization issues.
			</div></li></ul></div><div class="formalpara"><h5 class="formalpara" id="idp29287136">Configurazione</h5>
			As a CloudStack administrator, perform the following one-time configuration to enable event notification framework. At run time no changes can control the behaviour.
		</div><div class="orderedlist"><ol><li class="listitem"><div class="para">
				Open <code class="filename">'componentContext.xml</code>.
			</div></li><li class="listitem"><div class="para">
				Define a bean named <code class="filename">eventNotificationBus</code> as follows:
			</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
						name : Specify a name for the bean.
					</div></li><li class="listitem"><div class="para">
						server : The name or the IP address of the RabbitMQ AMQP server.
					</div></li><li class="listitem"><div class="para">
						port : The port on which RabbitMQ server is running.
					</div></li><li class="listitem"><div class="para">
						username : The username associated with the account to access the RabbitMQ server.
					</div></li><li class="listitem"><div class="para">
						password : The password associated with the username of the account to access the RabbitMQ server.
					</div></li><li class="listitem"><div class="para">
						exchange : The exchange name on the RabbitMQ server where CloudStack events are published.
					</div><div class="para">
						A sample bean is given below:
					</div><pre class="programlisting">&lt;bean id="eventNotificationBus" class="org.apache.cloudstack.mom.rabbitmq.RabbitMQEventBus"&gt;
    &lt;property name="name" value="eventNotificationBus"/&gt;
    &lt;property name="server" value="127.0.0.1"/&gt;
    &lt;property name="port" value="5672"/&gt;
    &lt;property name="username" value="guest"/&gt;
    &lt;property name="password" value="guest"/&gt;
   &lt;property name="exchange" value="cloudstack-events"/&gt;
   &lt;/bean&gt;</pre><div class="para">
						The <code class="filename">eventNotificationBus</code> bean represents the <code class="filename">org.apache.cloudstack.mom.rabbitmq.RabbitMQEventBus</code> class.
					</div></li></ul></div></li><li class="listitem"><div class="para">
				Restart the Management Server.
			</div></li></ol></div></div><div xml:lang="it-IT" class="section" id="standard-events" lang="it-IT"><div class="titlepage"><div><div><h3 class="title" id="standard-events">22.1.3. Standard Events</h3></div></div></div><div class="para">
		The events log records three types of standard events.
	</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
				INFO. This event is generated when an operation has been successfully performed.
			</div></li><li class="listitem"><div class="para">
				WARN. This event is generated in the following circumstances.
			</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
						When a network is disconnected while monitoring a template download.
					</div></li><li class="listitem"><div class="para">
						When a template download is abandoned.
					</div></li><li class="listitem"><div class="para">
						When an issue on the storage server causes the volumes to fail over to the mirror storage server.
					</div></li></ul></div></li><li class="listitem"><div class="para">
				ERROR. This event is generated when an operation has not been successfully performed
			</div></li></ul></div></div><div xml:lang="it-IT" class="section" id="long-running-job-events" lang="it-IT"><div class="titlepage"><div><div><h3 class="title" id="long-running-job-events">22.1.4. Long Running Job Events</h3></div></div></div><div class="para">
		The events log records three types of standard events.
	</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
				INFO. This event is generated when an operation has been successfully performed.
			</div></li><li class="listitem"><div class="para">
				WARN. This event is generated in the following circumstances.
			</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
						When a network is disconnected while monitoring a template download.
					</div></li><li class="listitem"><div class="para">
						When a template download is abandoned.
					</div></li><li class="listitem"><div class="para">
						When an issue on the storage server causes the volumes to fail over to the mirror storage server.
					</div></li></ul></div></li><li class="listitem"><div class="para">
				ERROR. This event is generated when an operation has not been successfully performed
			</div></li></ul></div></div><div xml:lang="it-IT" class="section" id="event-log-queries" lang="it-IT"><div class="titlepage"><div><div><h3 class="title" id="event-log-queries">22.1.5. Event Log Queries</h3></div></div></div><div class="para">
		Database logs can be queried from the user interface. The list of events captured by the system includes:
	</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
				Virtual machine creation, deletion, and on-going management operations
			</div></li><li class="listitem"><div class="para">
				Virtual router creation, deletion, and on-going management operations
			</div></li><li class="listitem"><div class="para">
				Template creation and deletion
			</div></li><li class="listitem"><div class="para">
				Network/load balancer rules creation and deletion
			</div></li><li class="listitem"><div class="para">
				Storage volume creation and deletion
			</div></li><li class="listitem"><div class="para">
				User login and logout
			</div></li></ul></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="troubleshooting.html"><strong>Indietro</strong>Capitolo 22. Troubleshooting</a></li><li class="up"><a accesskey="u" href="#"><strong>Risali</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Partenza</strong></a></li><li class="next"><a accesskey="n" href="troubleshooting-working-with-server-logs.html"><strong>Avanti</strong>22.2. Working with Server Logs</a></li></ul></body></html>
