<?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>18.4. Administrator Alerts</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.2.0-en-US-1-" /><script type="text/javascript" src="../../../../../toc.js"></script><script type="text/javascript">
              addID('Apache_CloudStack');
              
	      addID('Apache_CloudStack.4.2.0');
              
              addID('Apache_CloudStack.4.2.0.books');
	      addID('Apache_CloudStack.4.2.0.Admin_Guide');
              </script><link rel="home" href="index.html" title="CloudStack Administrator's Guide" /><link rel="up" href="manage-cloud.html" title="Chapter 18. Managing the Cloud" /><link rel="prev" href="change-database-password.html" title="18.3. Changing the Database Password" /><link rel="next" href="customizing-dns.html" title="18.5. Customizing the Network Domain Name" /></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="change-database-password.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="customizing-dns.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" id="admin-alerts" lang="en-US"><div class="titlepage"><div><div><h2 class="title">18.4. Administrator Alerts</h2></div></div></div><div class="para">
		The system provides alerts and events to help with the management of the cloud. Alerts are notices to an administrator, generally delivered by e-mail, notifying the administrator that an error has occurred in the cloud. Alert behavior is configurable.
	</div><div class="para">
		Events track all of the user and administrator actions in the cloud. For example, every guest VM start creates an associated event. Events are stored in the Management Server’s database.
	</div><div class="para">
		Emails will be sent to administrators under the following circumstances:
	</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
				The Management Server cluster runs low on CPU, memory, or storage resources
			</div></li><li class="listitem"><div class="para">
				The Management Server loses heartbeat from a Host for more than 3 minutes
			</div></li><li class="listitem"><div class="para">
				The Host cluster runs low on CPU, memory, or storage resources
			</div></li></ul></div><div class="section" id="external-snmp-manager"><div class="titlepage"><div><div><h3 class="title">18.4.1. Sending Alerts to External SNMP and Syslog Managers</h3></div></div></div><div class="para">
			In addition to showing administrator alerts on the Dashboard in the CloudStack UI and sending them in email, CloudStack can also send the same alerts to external SNMP or Syslog management software. This is useful if you prefer to use an SNMP or Syslog manager to monitor your cloud.
		</div><div class="para">
			The alerts which can be sent are listed in <a class="xref" href="alerts.html">Appendix C, <em>Alerts</em></a>. You can also display the most up to date list by calling the API command listAlerts.
		</div><div class="section" id="snmp-alert-details"><div class="titlepage"><div><div><h4 class="title">18.4.1.1. SNMP Alert Details</h4></div></div></div><div class="para">
				The supported protocol is SNMP version 2.
			</div><div class="para">
				Each SNMP trap contains the following information: message, podId, dataCenterId, clusterId, and generationTime.
			</div></div><div class="section" id="syslog-alert-details"><div class="titlepage"><div><div><h4 class="title">18.4.1.2. Syslog Alert Details</h4></div></div></div><div class="para">
				CloudStack generates a syslog message for every alert. Each syslog message incudes the fields alertType, message, podId, dataCenterId, and clusterId, in the following format. If any field does not have a valid value, it will not be included.
			</div><pre class="programlisting">Date severity_level Management_Server_IP_Address/Name  alertType:: value dataCenterId:: value  podId:: value  clusterId:: value  message:: value</pre><div class="para">
				For example:
			</div><pre class="programlisting">Mar  4 10:13:47    WARN    localhost    alertType:: managementNode message:: Management server node 127.0.0.1 is up</pre></div><div class="section" id="snmp-syslog-config"><div class="titlepage"><div><div><h4 class="title">18.4.1.3. Configuring SNMP and Syslog Managers</h4></div></div></div><div class="para">
				To configure one or more SNMP managers or Syslog managers to receive alerts from CloudStack:
			</div><div class="orderedlist"><ol><li class="listitem"><div class="para">
						For an SNMP manager, install the CloudStack MIB file on your SNMP manager system. This maps the SNMP OIDs to trap types that can be more easily read by users. The file must be publicly available. For more information on how to install this file, consult the documentation provided with the SNMP manager.
					</div></li><li class="listitem"><div class="para">
						Edit the file /etc/cloudstack/management/log4j-cloud.xml.
					</div><pre class="programlisting"># vi /etc/cloudstack/management/log4j-cloud.xml</pre></li><li class="listitem"><div class="para">
						Add an entry using the syntax shown below. Follow the appropriate example depending on whether you are adding an SNMP manager or a Syslog manager. To specify multiple external managers, separate the IP addresses and other configuration values with commas (,).
					</div><div class="note"><div class="admonition_header"><h2>Note</h2></div><div class="admonition"><div class="para">
							The recommended maximum number of SNMP or Syslog managers is 20 for each.
						</div></div></div><div class="para">
					</div><div class="para">
						The following example shows how to configure two SNMP managers at IP addresses 10.1.1.1 and 10.1.1.2. Substitute your own IP addresses, ports, and communities. Do not change the other values (name, threshold, class, and layout values).
					</div><pre class="programlisting">&lt;appender name="SNMP" class="org.apache.cloudstack.alert.snmp.SnmpTrapAppender"&gt;
  &lt;param name="Threshold" value="WARN"/&gt;  &lt;!-- Do not edit. The alert feature assumes WARN. --&gt;
  &lt;param name="SnmpManagerIpAddresses" value="10.1.1.1,10.1.1.2"/&gt;
  &lt;param name="SnmpManagerPorts" value="162,162"/&gt;
  &lt;param name="SnmpManagerCommunities" value="public,public"/&gt;
  &lt;layout class="org.apache.cloudstack.alert.snmp.SnmpEnhancedPatternLayout"&gt; &lt;!-- Do not edit --&gt;
    &lt;param name="PairDelimeter" value="//"/&gt;
    &lt;param name="KeyValueDelimeter" value="::"/&gt;
  &lt;/layout&gt;
&lt;/appender&gt;</pre><div class="para">
						The following example shows how to configure two Syslog managers at IP addresses 10.1.1.1 and 10.1.1.2. Substitute your own IP addresses. You can set Facility to any syslog-defined value, such as LOCAL0 - LOCAL7. Do not change the other values.
					</div><pre class="programlisting">&lt;appender name="ALERTSYSLOG"&gt;
  &lt;param name="Threshold" value="WARN"/&gt;
  &lt;param name="SyslogHosts" value="10.1.1.1,10.1.1.2"/&gt;
  &lt;param name="Facility" value="LOCAL6"/&gt;   
  &lt;layout&gt;
    &lt;param name="ConversionPattern" value=""/&gt;
  &lt;/layout&gt;
&lt;/appender&gt;</pre></li><li class="listitem"><div class="para">
						If your cloud has multiple Management Server nodes, repeat these steps to edit log4j-cloud.xml on every instance.
					</div></li><li class="listitem"><div class="para">
						If you have made these changes while the Management Server is running, wait a few minutes for the change to take effect.
					</div></li></ol></div><div class="para">
				<span class="bold bold"><strong>Troubleshooting:</strong></span> If no alerts appear at the configured SNMP or Syslog manager after a reasonable amount of time, it is likely that there is an error in the syntax of the &lt;appender&gt; entry in log4j-cloud.xml. Check to be sure that the format and settings are correct.
			</div></div><div class="section" id="delete-snmp-syslog-manager"><div class="titlepage"><div><div><h4 class="title">18.4.1.4. Deleting an SNMP or Syslog Manager</h4></div></div></div><div class="para">
				To remove an external SNMP manager or Syslog manager so that it no longer receives alerts from CloudStack, remove the corresponding entry from the file /etc/cloudstack/management/log4j-cloud.xml.
			</div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="change-database-password.html"><strong>Prev</strong>18.3. Changing the Database Password</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="customizing-dns.html"><strong>Next</strong>18.5. Customizing the Network Domain Name</a></li></ul></body></html>
