DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.

DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
This is functional specification for Syslog Enhacements feature of Cloudstack.
https://issues.apache.org/jira/browse/CLOUDSTACK-712
Syslog messages can be used by remote Syslog managers to diagnose issues in managed software/systems like Cloudstack and can act accordingly. This is similar to alerts that we see on dashboard of Cloudstack.
In this feature we are implementing the Syslog enhancements for alerts in CloudStack. In the current scenario we are writing alerts to database and are shown on Cloudstack dashboard. Now in addition to that we will also send the syslog messages in a format which can be easily analyzed by external Syslog messages analyzer.
We will send the Syslog messages for following alerts
Each message will contain the following keys and corresponding value
Date severity_level Management_Server_IP_Address/Name alertType:: value dataCenterId:: value podId:: value clusterId:: value message:: value
if some keys are not valid(like dataCenterId is 0) then those will not be set
For Example
Mar 4 10:13:47 WARN localhost alertType:: managementNode message:: Management server node 127.0.0.1 is up
Mar 4 10:13:47 WARN 10.1.1.1 alertType:: managementNode message:: Management network CIDR is not configured originally. Set it default to 10.144.6.0/23
Mar 4 10:13:47 WARN 10.1.1.1 alertType:: domainRouterVmState dataCenterId:: 1 podId:: 1 message:: More than one redundant virtual router is in MASTER state! ...
currently sending all the alerts to administrator and he will filter alerts according to his needs.
For this feature, we will be using log4j library with Apache License
Below Alert Types are categorized as CRITICAL
while all others are categorized as WARN
This feature will be implemented as plugin. This feature will use the log4j Appender to get the required alerts and will generate the Syslog messages from that. SyslogAppender of log4j will be used to send the Syslog messages
We will add following classes
To configure multiple Syslog Hosts following appender in log4j-cloud.xml will be added
<appender name="ALERTSYSLOG">
<param name="Threshold" value="WARN"/>
<param name="SyslogHosts" value=""/>
<param name="Facility" value="LOCAL6"/>
<layout>
<param name="ConversionPattern" value=""/>
</layout>
</appender>
To specify multiple Syslog Hosts, admin has to modify in above fragment as follows with each Syslog Host separated by ,
<appender name="ALERTSYSLOG">
<param name="Threshold" value="WARN"/>
<param name="SyslogHosts" value="10.1.1.1,10.1.1.2"/>
<param name="Facility" value="LOCAL6"/> <layout>
<param name="ConversionPattern" value=""/>
</layout>
</appender>
Following loggers will also be added
<logger name="com.cloud.alert.AlertManagerImpl" additivity="false">
<level value="WARN"/>
<appender-ref ref="SYSLOG"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="ALERTSYSLOG"/>
</logger>
<logger name="com.cloud.usage.UsageAlertManagerImpl" additivity="false">
<level value="WARN"/>
<appender-ref ref="SYSLOG"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="ALERTSYSLOG"/>
</logger>