Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

/root/resourcemonitord/resourcemonitord/MonitoringEventSchema.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           MonitoringEventSchema.h  -  description
00003                              -------------------
00004     begin                : Wed Sep 19 2001
00005     copyright            : (C) 2001 by Todd C. Davis
00006     email                : todd.c.davis@intel.com
00007  ***************************************************************************/
00008 
00009 
00010 /*M*
00011 BSD License
00012 
00013 Copyright (c) 2002, Intel Corporation
00014 All rights reserved.
00015 
00016 Redistribution and use in source and binary forms, with or without
00017 modification, are permitted provided that the following conditions are met:
00018 
00019   a.. Redistributions of source code must retain the above copyright notice,
00020       this list of conditions and the following disclaimer.
00021   b.. Redistributions in binary form must reproduce the above copyright notice,
00022       this list of conditions and the following disclaimer in the documentation
00023       and/or other materials provided with the distribution.
00024   c.. Neither the name of Intel Corporation nor the names of its contributors
00025       may be used to endorse or promote products derived from this software
00026       without specific prior written permission.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00029 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00030 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00031 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00033 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00034 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00035 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00036 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00037 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039  *M*/
00040 
00041 /*
00042  * MonitoringEventSchema.h
00043  *
00044  * This header file defines an event log entry convention for events
00045  * written to an event logging facility that are related to monitoring 
00046  * a statistic of a system resource.
00047  * 
00048  * This convention can be adopted by any software subsystem (application, 
00049  * driver, kernel module, etc.) that writes messages into a system event log
00050  * that are related to monitoring of statistics .  Any event message that 
00051  * conforms to the event schema must contain data identifying the message 
00052  * as compliant (See Monitoring Event Schema comments below).
00053  * 
00054  * Applications that wish to query or filter event log data for statistic
00055  * monitoring events can develop queries using this schema.  
00056  *
00057  */
00058 #ifndef __MonitoringEventSchema_h__
00059 #define __MonitoringEventSchema_h__
00060 
00061 
00062 /*
00063  * Monitoring Event Schema
00064  *
00065  * Monitoring Events that comply with this schema must include a set of event 
00066  * attributes that are implemented in the message data.  For inclusion of
00067  * attributes and values in text string message data, the following format 
00068  * must be used:
00069  * 
00070  *  "<free form message>|attr=val|attr=val|...|attr=val|"
00071  *
00072  * There can be any number of attribute=value pairs and they can be 
00073  * specified in any order, with a separator character appearing before 
00074  * and after each attribute=value pair.   This means that the final 
00075  * attribute=value pair will also have a separator character following it.  
00076  * When two attribute=value pairs are adjacent, only one separator character 
00077  * is required; however, specifying two sequential separator characters 
00078  * is valid.  
00079  *
00080  * Examples:
00081  * The following are valid event messages:
00082  *
00083  *    "Text goes here|facility_id=GUID|Threshold_Value=12|”
00084  *    “Text goes here|facility_id=GUID||Observed_Value=55|"
00085  *
00086  * Applications building queries for specific attributes and values must 
00087  * include the separator char on both sides of the attribute=value pair 
00088  * in a query expression.   For example, for the first event message 
00089  * above, a query for the string "|Threshold_Value=1|" would fail,
00090  * a query for "|Threshold_Value=12|" would succeed.
00091  *
00092  * For subsystems that are fully-compliant with this event schema, each of 
00093  * the attributes noted "R" below will be included in the event message.
00094 
00095  *
00096  * For certain monitoring events, the attributes marked "O" (optional) may
00097  * be included.
00098  *
00099  * For subsystems that are not fully-compliant, a subset of these 
00100  * attributes may be included.  Please refer to documentation provided 
00101  * with the subsystem for the resource to determine what attributes are 
00102  * supported by that subsystem.
00103  *
00104  * In some cases, a universally-unique identifier (UUID) is used to ensure that the
00105  * component is identified in a manner that is reasonably guaranteed to be unique
00106  * across systems, versions or implementations.  A UUID is a 32 character string
00107  * that is subdivided into five components using dashes ("-").  With the addition
00108  * of a terminating null character, the resulting string is 37 characters long.
00109  *
00110  * 
00111  * The Monitoring Event Schema contains the following attributes:
00112  *
00113  * R facility_id=<ME_UIDstring> Monitoring Event Schema UUID            37byte char string
00114  *  R event_type=<integer>      An integer code identifying the type of     integer
00115  *                      resource/statistic monitoring message
00116  *  R severity=<integer>        An integer code identifying the severity of integer
00117  *                      the event
00118  *
00119  *  R Subsystem_ID=<UUID>       A UUID identifying the source of the event  37byte char string
00120  *  R Resource_ID=<integer>     An integer identifier of a resource;        integer
00121  *                      unique within the scope of a Subsystem_ID
00122  *  R Statistic_ID=<integer>        Identifier of a statistic; unique in Subsystem  integer
00123  *
00124  *  O Observed_Value=<integer>  Observed value of the statistic         integer
00125  *  O Threshold_Value=<integer>     Current value of threshold for statistic        integer
00126  *  O inlinemon_id=<char>       Identifier for subsystem-based monitor which    Up to 64byte char string
00127  *                      caused the event to be logged   
00128  *
00129  *  O Subsystem_Name=<char>     Human-readable name of subsystem            char string
00130  *  O Resource_Name=<char>      Human-readable name of resource         char string
00131  *  O Statistic_Name=<char>     Human-readable name of statistic            char string
00132  *  O inlinemon_name=<char>     Human-readable name of subsys-based monitor char string
00133  *  
00134  *  O Monitor_ID=<UUID>     Identifier for the application session      37byte char string
00135  *                      that is controlling the monitor/statistic
00136  *                      which caused the event to be logged;
00137  *                      This identifier is created by the application
00138  *                      and learned by the subsystem
00139  *  
00140  *
00141  *    (R=required, O=optional)
00142  */
00143 
00144 
00155 #define ME_UID_STRING           "2f737514-1d1b-4edb-9cd4-adffc433d56e"
00156 
00157 
00166 #define ME_EVENT_TYPE_BASE      500
00167 
00168 #define ME_EVENT_CANCELED           (ME_EVENT_TYPE_BASE+0)
00169 
00170 #define ME_EVENT_VALUE_ABOVE        (ME_EVENT_TYPE_BASE+1)
00171 
00172 #define ME_EVENT_VALUE_AT_OR_ABOVE  (ME_EVENT_TYPE_BASE+2)
00173 
00174 #define ME_EVENT_VALUE_AT           (ME_EVENT_TYPE_BASE+3)
00175 
00176 #define ME_EVENT_VALUE_AT_OR_BELOW  (ME_EVENT_TYPE_BASE+4)
00177 
00178 #define ME_EVENT_VALUE_BELOW        (ME_EVENT_TYPE_BASE+5)
00179 
00180 #define ME_EVENT_VALUE_NOT_AT_BELOW (ME_EVENT_TYPE_BASE+6)
00181 
00182 #define ME_EVENT_VALUE_NOT_AT_ABOVE (ME_EVENT_TYPE_BASE+7)
00183 
00184 #define ME_EVENT_COUNTER_RATE_EXCEEDED  (ME_EVENT_TYPE_BASE+8)
00185 
00186 #define ME_EVENT_SUBSYSTEM_CONFIGURATION_CHANGE (ME_EVENT_TYPE_BASE+9)
00187 
00188 #define ME_EVENT_RESOURCE_CONFIGURATION_CHANGE  (ME_EVENT_TYPE_BASE+10)
00189 
00199 
00200 #define ME_LOG_EMERG   0
00201 
00202 #define ME_LOG_ALERT   1
00203 
00204 #define ME_LOG_CRIT    2
00205 
00206 #define ME_LOG_ERR     3
00207 
00208 #define ME_LOG_WARNING 4
00209 
00210 #define ME_LOG_NOTICE  5
00211 
00212 #define ME_LOG_INFO    6
00213 
00214 #define ME_LOG_DEBUG   7 
00215 
00216 
00229 #define ME_ThresholdEventLogMessageFormat       "%s\
00230 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00231 |Monitor_ID=%s|Subsystem_ID=%s\
00232 |Resource_ID=%u|Statistic_ID=%u\
00233 |Observed_Value=%u|Threshold_Value=%u|\n"
00234 
00235 #define ME_ThresholdEventLogMessageFormatWithNames      "%s\
00236 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00237 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00238 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00239 |Observed_Value=%u|Threshold_Value=%u|\n"
00240 
00241 #define ME_ThresholdEventLogMessageSignedFormat     "%s\
00242 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00243 |Monitor_ID=%s|Subsystem_ID=%s\
00244 |Resource_ID=%u|Statistic_ID=%u\
00245 |Observed_Value=%u|Threshold_Value=%u|\n"
00246 
00247 #define ME_ThresholdEventLogMessageSignedFormatWithNames        "%s\
00248 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00249 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00250 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00251 |Observed_Value=%d|Threshold_Value=%d|\n"
00252 
00253 #define ME_ThresholdEventLogMessageFormat64     "%s\
00254 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00255 |Monitor_ID=%s|Subsystem_ID=%s\
00256 |Resource_ID=%u|Statistic_ID=%u\
00257 |Observed_Value=%llu|Threshold_Value=%llu|\n"
00258 
00259 #define ME_ThresholdEventLogMessageFormat64WithNames        "%s\
00260 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00261 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00262 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00263 |Observed_Value=%llu|Threshold_Value=%llu|\n"
00264 
00265 #define ME_ThresholdEventLogMessageSignedFormat64       "%s\
00266 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00267 |Monitor_ID=%s|Subsystem_ID=%s\
00268 |Resource_ID=%u|Statistic_ID=%u\
00269 |Observed_Value=%lld|Threshold_Value=%lld|\n"
00270 
00271 #define ME_ThresholdEventLogMessageSignedFormat64WithNames      "%s\
00272 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00273 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00274 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00275 |Observed_Value=%lld|Threshold_Value=%lld|\n"
00276 
00277 #define ME_LeakyBuckeEventLogMessageFormat      "%s\
00278 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00279 |Monitor_ID=%s|Subsystem_ID=%s\
00280 |Resource_ID=%u|Statistic_ID=%u\
00281 |Bucket_Size=%u|Fill_Value=%u|Fill_Interval=%u seconds\
00282 |Bucket_Level(%u) <= Observed_Value(%u) - Last_Value(%u)|\n"
00283 
00284 #define ME_LeakyBucketEventLogMessageFormatWithNames        "%s\
00285 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00286 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00287 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00288 |Bucket_Size=%u|Fill_Value=%u|Fill_Interval=%u seconds\
00289 |Bucket_Level(%u) <= Observed_Value(%u) - Last_Value(%u)|\n"
00290 
00291 #define ME_LeakyBuckeEventLogMessageSignedFormat        "%s\
00292 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00293 |Monitor_ID=%s|Subsystem_ID=%s\
00294 |Resource_ID=%u|Statistic_ID=%u\
00295 |Bucket_Size=%u|Fill_Value=%u|Fill_Interval=%u seconds\
00296 |Bucket_Level(%u) <= Observed_Value(%u) - Last_Value(%u)|\n"
00297 
00298 #define ME_LeakyBucketEventLogMessageSignedFormatWithNames      "%s\
00299 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00300 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00301 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00302 |Bucket_Size=%d|Fill_Value=%d|Fill_Interval=%u seconds\
00303 |Bucket_Level(%d) <= Observed_Value(%d) - Last_Value(%d)|\n"
00304 
00305 #define ME_LeakyBucketEventLogMessageFormat64       "%s\
00306 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00307 |Monitor_ID=%s|Subsystem_ID=%s\
00308 |Resource_ID=%u|Statistic_ID=%u\
00309 |Bucket_Size=%llu|Fill_Value=%llu|Fill_Interval=%u seconds\
00310 |Bucket_Level(%llu) <= Observed_Value(%llu) - Last_Value(%llu)|\n"
00311 
00312 #define ME_LeakyBucketEventLogMessageFormat64WithNames      "%s\
00313 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00314 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00315 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00316 |Bucket_Size=%llu|Fill_Value=%llu|Fill_Interval=%u seconds\
00317 |Bucket_Level(%llu) <= Observed_Value(%llu) - Last_Value(%llu)|\n"
00318 
00319 #define ME_LeakyBucketEventLogMessageSignedFormat64     "%s\
00320 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00321 |Monitor_ID=%s|Subsystem_ID=%s\
00322 |Resource_ID=%u|Statistic_ID=%u\
00323 |Bucket_Size=%lld|Fill_Value=%lld|Fill_Interval=%u seconds\
00324 |Bucket_Level(%lld) <= Observed_Value(%lld) - Last_Value(%lld)|\n"
00325 
00326 #define ME_LeakyBucketEventLogMessageSignedFormat64WithNames        "%s\
00327 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00328 |Monitor_ID=%s|Subsystem_ID=%s|Subsystem_Name=%s\
00329 |Resource_ID=%u|Resource_Name=%s|Statistic_ID=%u|Statistic_Name=%s\
00330 |Bucket_Size=%lld|Fill_Value=%lld|Fill_Interval=%u seconds\
00331 |Bucket_Level(%lld) <= Observed_Value(%lld) - Last_Value(%lld)|\n"
00332 
00333 #define ME_ResourceChangeEventLogMessageFormat      "%s\
00334 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00335 |Subsystem_ID=%s|Resource_ID=%u\n"
00336 
00337 #define ME_ResourceChangeLogMessageFormatWithNames      "%s\
00338 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00339 |Subsystem_ID=%s|Subsystem_Name=%s\
00340 |Resource_ID=%u|Resource_Name=%s\n"
00341 
00342 #define ME_RM_CancelEvent   "Cancel threshold exception"
00343 #define ME_RM_ThresholdEvent    "Threshold exception"
00344 #define ME_RM_LeakyBucketEvent  "Leaky Bucket exception"
00345 #define ME_RM_SubsystemAdded    "Subsystem Added"
00346 #define ME_RM_ResourceAdded "Resource Added"
00347 #define ME_RM_DataCaptureAdded  "Data Capture Library Added"
00348 #define ME_RM_SubsystemRemoved  "Subsystem Removed"
00349 #define ME_RM_ResourceRemoved   "Resource Removed"
00350 #define ME_RM_DataCaptureRemoved    "Data Capture Library Removed"
00351 
00366 #define PL_ME_Facility  LOG_LOCAL5
00367 
00368 /*
00369  * When the POSIX log header is included,
00370  * map the ME severity codes onto the POSIX-compliant range
00371  * (Using assumption that if LOG_KERN is defined, the POSIX header has been included)
00372  */
00373 #ifdef LOG_KERN
00374 #define ME_LOG_EMERG   LOG_EMERG   /* system is unusable */
00375 #define ME_LOG_ALERT   LOG_ALERT   /* action must be taken immediately*/
00376 #define ME_LOG_CRIT    LOG_CRIT    /* critical conditions */
00377 #define ME_LOG_ERR     LOG_ERR     /* error conditions */
00378 #define ME_LOG_WARNING LOG_WARNING /* warning conditions */
00379 #define ME_LOG_NOTICE  LOG_NOTICE  /* normal but significant condition*/
00380 #define ME_LOG_INFO    LOG_INFO    /* informational */
00381 #define ME_LOG_DEBUG   LOG_DEBUG   /* debug-level messages */
00382 #endif
00383 
00384 /*
00385  * Tentative additions for CSM/CSL events
00386  * to be replaced by "official" include file
00387  */
00388 #define CSM_UID_STRING          "c581b242-600e-4444-8378-584e7a251f0c"
00389 
00390 /*
00391  * Resource Management Event Type codes
00392  */
00393 #define RMGT_EVENT_TYPE_BASE        12500
00394 #define RMGT_SubsystemAdded (RMGT_EVENT_TYPE_BASE+0)
00395 #define RMGT_ResourceAdded  (RMGT_EVENT_TYPE_BASE+1)
00396 #define RMGT_SubsystemRemoved       (RMGT_EVENT_TYPE_BASE+2)
00397 #define RMGT_ResourceRemoved    (RMGT_EVENT_TYPE_BASE+3)
00398 
00399 /*
00400  * These data strings should match the Resource Management Event Type code
00401  * used in the event log record
00402  */
00403 #define CSM_SubsystemAdded  "New Subsystem Registered"
00404 #define CSM_ResourceAdded   "New Resource Registered"
00405 #define CSM_SubsystemRemoved    "Subsystem Removed"
00406 #define CSM_ResourceRemoved "Resource Removed"
00407 
00408 #define CSM_SubsystemChangeEventLogMessageFormat        "%s\
00409 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00410 |Subsystem_ID=%s\
00411 |Management_Module_ID=c581b242-600e-4444-8378-584e7a251f0c\n"
00412 
00413 #define CSM_SubsystemChangeLogMessageFormatWithNames        "%s\
00414 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00415 |Subsystem_ID=%s|Subsystem_Name=%s\
00416 |Management_Module_ID=c581b242-600e-4444-8378-584e7a251f0c\
00417 |Management_Module_Name=Common Statistics Management Module\n"
00418 
00419 #define CSM_ResourceChangeEventLogMessageFormat     "%s\
00420 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00421 |Subsystem_ID=%s|Resource_ID=%s\
00422 |Management_Module_ID=c581b242-600e-4444-8378-584e7a251f0c\n"
00423 
00424 #define CSM_ResourceChangeLogMessageFormatWithNames     "%s\
00425 |facility_id=2f737514-1d1b-4edb-9cd4-adffc433d56e\
00426 |Subsystem_ID=%s|Subsystem_Name=%s\
00427 |Resource_ID=%s\
00428 |Management_Module_ID=c581b242-600e-4444-8378-584e7a251f0c\
00429 |Management_Module_Name=Common Statistics Management Module\n"
00430 
00431 
00432 #endif  //  __MonitoringEventSchema_h__

Generated at Sat Sep 7 21:21:07 2002 for Resource Monitoring Facility by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001