<?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. イベント</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-ja-JP-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="CloudStack 管理者ガイド" /><link rel="up" href="troubleshooting.html" title="第22章 Troubleshooting" /><link rel="prev" href="troubleshooting.html" title="第22章 Troubleshooting" /><link rel="next" href="troubleshooting-working-with-server-logs.html" title="22.2. サーバーログに関わる作業" /></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>戻る</strong></a></li><li class="next"><a accesskey="n" href="troubleshooting-working-with-server-logs.html"><strong>次へ</strong></a></li></ul><div xml:lang="ja-JP" class="section" id="events" lang="ja-JP"><div class="titlepage"><div><div><h2 class="title" id="events">22.1. イベント</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="ja-JP" class="section" id="events-log" lang="ja-JP"><div class="titlepage"><div><div><h3 class="title" id="events-log">22.1.1. イベントログ</h3></div></div></div><div class="para">
		2 種類のイベントが CloudStack イベントログに記録されます。標準的なイベントについてはイベントの成功または失敗が記録され、失敗したジョブまたはプロセスを特定するために使用することができます。長期間実行するジョブのイベントもあります。非同期ジョブのイベントは、ジョブがスケジュールされたとき、ジョブが開始されたとき、およびジョブが完了したときに記録されます。そのほかの長期間実行する同期ジョブのイベントは、ジョブが開始されたときと完了したときに記録されます。長期間実行する同期ジョブと非同期ジョブのイベントログを使用して、保留中のジョブの状態に関する詳細情報を取得したり、ハングしている、または開始されていないジョブを特定したりできます。次に、これらのイベントに関してさらに説明します。
	</div></div><div xml:lang="ja-JP" class="section" id="event-framework" lang="ja-JP"><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="idm24638600">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="idm9017120">Configuration</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">
				管理サーバーを再起動します。
			</div></li></ol></div></div><div xml:lang="ja-JP" class="section" id="standard-events" lang="ja-JP"><div class="titlepage"><div><div><h3 class="title" id="standard-events">22.1.3. 標準イベント</h3></div></div></div><div class="para">
		イベントログには、3 種類の標準イベントが記録されます。
	</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
				INFO : 操作が正常に実行されたときに、このイベントが生成されます。
			</div></li><li class="listitem"><div class="para">
				WARN:このイベントは次の状況で生成されます。
			</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
						テンプレートダウンロードの監視中に、ネットワークが切断されたとき。
					</div></li><li class="listitem"><div class="para">
						テンプレートダウンロードが中止されたとき。
					</div></li><li class="listitem"><div class="para">
						ストレージサーバーの問題により、ミラーストレージサーバーにボリュームがフェールオーバーしたとき。
					</div></li></ul></div></li><li class="listitem"><div class="para">
				ERROR : 操作が正常に実行されなかったときに、このイベントが生成されます。
			</div></li></ul></div></div><div xml:lang="ja-JP" class="section" id="long-running-job-events" lang="ja-JP"><div class="titlepage"><div><div><h3 class="title" id="long-running-job-events">22.1.4. 長期間実行するジョブのイベント</h3></div></div></div><div class="para">
		イベントログには、3 種類の標準イベントが記録されます。
	</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
				INFO : 操作が正常に実行されたときに、このイベントが生成されます。
			</div></li><li class="listitem"><div class="para">
				WARN : このイベントは次の状況で生成されます。
			</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
						テンプレートダウンロードの監視中に、ネットワークが切断されたとき。
					</div></li><li class="listitem"><div class="para">
						テンプレートダウンロードが中止されたとき。
					</div></li><li class="listitem"><div class="para">
						ストレージサーバーの問題により、ミラーストレージサーバーにボリュームがフェールオーバーしたとき。
					</div></li></ul></div></li><li class="listitem"><div class="para">
				ERROR : 操作が正常に実行されなかったときに、このイベントが生成されます。
			</div></li></ul></div></div><div xml:lang="ja-JP" class="section" id="event-log-queries" lang="ja-JP"><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>戻る</strong>第22章 Troubleshooting</a></li><li class="up"><a accesskey="u" href="#"><strong>上に戻る</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>ホーム</strong></a></li><li class="next"><a accesskey="n" href="troubleshooting-working-with-server-logs.html"><strong>次へ</strong>22.2. サーバーログに関わる作業</a></li></ul></body></html>
