[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

5932.0. "MCC programming request" by ZPOV05::SINSPS () Mon Apr 04 1994 20:42

Hi, could somebody help to answer the following request by a customer. 

"I want to create an MCC access module which will collect events generated 
by standalone process and display them to the iconic map interface in 
Polycenter network manager.

The Eample_FM and Sample_AM contain some code which shows how an event can be
sent and captured. This code however does not give the necessary event format
for OSI events, ie the structure required to specify the event severity and
other attributes.

When using this code I am able to send an event which is captured by the 
getevent call and returns the event message when the getevent call is issued
at the command line interface.

If however the notification services FM is used I can see that the event is
captured by my getevent code (ie the code which is vectored to when a getevent
directive is issued) but the event is not dsplayed on the iconic map and no 
error messages are produced.

The specification document for the notification_fm provided in the polycenter
developer's toolkit indicates that certain other arguments should be returned
bu the getevent code. However the argument IDs listed in the document do not
match the arguments IDs included in the mcc_notify_svc_if.h file.

It is also unclear what format should be adopted for the event messages that 
I generate. Should the argument list include the OSI specific arguments ?
Should the resulting ILV structure be unpacked by the getevent module and 
re-packaged with a separate constructor for each argument, or can it be 
passed wholesale in the two level constructor ILV structure used by the 
getevent code given in the example module ?

Basically speaking I require more clarification as how to generate and handle
OSI complaint event reports with MCC. I would also appreciate an uptodate
specification for the notification services FM.

Please provide the requested infrmation and some code which illustrates this."

Thanks,

- LEH
T.RTitleUserPersonal
Name
DateLines
5932.1Why not Data Collector?BIKINI::KRAUSEEuropean NewProductEngineer for MCCTue Apr 05 1994 04:329
>"I want to create an MCC access module which will collect events generated 
>by standalone process and display them to the iconic map interface in 
>Polycenter network manager.

Dumb question: why don't you use the Data Collector? You could just link 
the EVC_SEND routines with your application process and they will do 
what you want.

*Robert
5932.2some pointersTAEC::FLAUWMarc Flauw, CEM Technical Office, VBOTue Apr 05 1994 09:2333
re: .0

If your customer wants to create an Access Module to generate events, he
will have to write the MSL spec. defining these events first.

There are 2 main categories of events :
    - configuration events
    - notification events (i.e. alarms)

It is possible to define other event partitions if needed but the 2 above
are the main ones.

By default, when the Notification PM is started, it collects only the
notification events, unless you create a specific notification request to
collect the appropriate configuration events.

The format of OSI Alarms/OSI Events is not clearly documented in the MCC
documentation, as any type of event can be sent with MCC. We have
documented it in TeMIP and your customer can use this format, even if he
has not installed TeMIP.

If you have TeMIP installed, you can find the format of OSI alarms/events
in /usr/kits/TNM110/examples/*.ms   Otherwise, you can get them over the
net on TAEC::TEMIP$PUBLIC:[DOC]*.ms

There is also explanations and recommendations on  how to encode an OSI
alarm/event in TeMIP Reference Guide. It explain what needs to be done at
the Getevent level and include a small coding example of a Getevent
response. You can find a copy in TAEC::TEMIP$PUBLIC:[V11_DOC]*ref.ps
    
Best regards,

Marc.
5932.3Caller not positioned within ASN .1 constructorZPOV05::SINSPSFri Apr 22 1994 01:2337
    re .2
    
    Hi, my customer has worked through the OSI_ALARMS.MS which I've sent
    him. This itself gives some information but not sufficient for him to
    process event messages which include severity information.
    
    He has included the following mandatory fields in his event
    definitions :-
    
    Managed Object
    AlarmEventType
    EventTime
    ProbableCause
    Perceived Severity
    
    However when he used the command line interface getevent request, he
    received the following event message :-
    
    logger LOCAL_NS:.0
    At 18-APR-1994 11:50:36 Any Event
    
    Event Received
    
    NOTE there is no mention of Severity/Probable cause, etc...
    
    If he then sent this same event using the graphical interface, he
    received an event message of type indeterminate. If he then select the
    event message from the notification window to examine the event
    details, he received "Caller not positioned within ASN. 1 constructor"
    message. The data has been passed in an ILV encoded string. Should he
    substitute the ILV construction for an ASN one ? Or must the ASN. 1
    constructure be nested into the ILV structure that is returned by the 
    mcc_event_put routine ?
    
    Thanks.
    
    - LEH
5932.4Any advice, anyone ?ZPOVC::SINSPSWed Apr 27 1994 02:131
    
5932.5Need more informationTAEC::LAVILLATFri Apr 29 1994 04:1719
  
  Hello,

  We need more information to be able to help you.

  Especially could you post here or send me by mail :

	- the MSL definition used by your customer
	- an ILV dump of the event : just do 'setenv MCC_FCL_PM_LOG 8'
	and send the result of the GETEVENT call.

  From what you describe, it seems that the event is badly ILV encoded.

  Thanks to provide the info.

  Regards.

  Pierre.

5932.6detailed informationsZPOVC::SINSPSTue May 10 1994 02:50306
ASSOCIATING A SEVERITY VALUE WITH AN EVENT

The following code sends an event message to the child entity of an object.

The event can be captured using a getevent command or using the notification
window in the user interface. In the second instance the event appears as 
severity "indeterminate".

MCC_T_CVR mcc_send_event()

{
MCC_T_CVR status;
long *memory;
MCC_A_AES entity = { MCC_K_NULL_PTR };
MCC_T_UNSLONG partition;
MCC_T_UNSLONG code,count;
MCC_T_Descriptor *data = { MCC_K_NULL_PTR };
MCC_T_Descriptor *timestamp = { MCC_K_NULL_PTR };
MCC_T_Descriptor *username = { MCC_K_NULL_PTR };
MCC_T_Descriptor *severity = { MCC_K_NULL_PTR };
MCC_T_Descriptor *entity_instance = { MCC_K_NULL_PTR };
MCC_T_Descriptor *child_entity_instance = { MCC_K_NULL_PTR };
unsigned char		instance[100] = "hardware1";
MCC_T_Unsigned16	instance_len;
unsigned char		child_instance[8] = "$1$dia0:";
MCC_T_Unsigned16	child_instance_len;
MCC_T_FullName		fullname_str;
MCC_T_Unsigned16	fullname_len;
MCC_T_SimpleName	simplename_str;
MCC_T_Unsigned16	simplename_len;

MCC_T_CVR dns;
struct MCC_R_ILV_CONTEXT    ctx;
unsigned char username_str[7] = "System";
unsigned int  username_len = 6;
unsigned int  data_buffer_len;
unsigned char  data_buffer[128];

MCC_T_Enumeration	severity_value = 4;
/*
 *  Create a descriptors to hold the event data
 */

  status = mcc_desframe_init_alloc_list(&memory);

/*
 *  time descriptor
 */

if (status == MCC_S_NORMAL)
  status = mcc_desframe_create_descriptor( &memory,
					   &timestamp,
					   &128,
					   &MCC_K_DT_BIN_ABS_TIM,
					   0,
					   0,
					   &DSC_K_DTYPE_T);
/*
 *  Read the event data from constants
 */

if (status == MCC_S_NORMAL)
status = mcc_time_get_current(timestamp);

/*
 * Convert a text string to type Full_Nmae
 */

instance_len = strlen (&instance);

 if ( status == MCC_S_NORMAL)
   status = mcc_dns_opaque_fullname(&instance,&instance_len,&fullname_str,
							&fullname_len,&dns);

/* Start of Debug code */
 if (status == MCC_S_NORMAL)
   status = mcc_dns_fullname_string (&fullname_str,&fullname_len,&instance,
							&instance_len,&dns);
/* End of Debug code */

/*
 * Convert a text string to type Simple_Name
 */

child_instance_len = strlen (&child_instance);

if (status == MCC_S_NORMAL)
  status = mcc_dns_opaque_simplename(&child_instance,
				   &child_instance_len,
				   &simplename_str,
				   &simplename_len,
				   &dns);

/*
 *  Create descriptor to hold global entity identifier
 */

if (status == MCC_S_NORMAL)
  status = mcc_desframe_create_descriptor(
	&memory,			/*  Memory Allocation List  */
	&entity_instance,		/*  Descriptor Pointer	    */
	&fullname_len,			/*  Length		    */
	&MCC_K_DT_FULL_NAME,		/*  Datatype		    */
	&fullname_str,			/*  Identifier Value	    */
	&MCC_K_HARDWARE_REGISTERED_NAME,/*  Id			    */
	&DSC_K_DTYPE_T);		/*  VMS datatype	    */

/*
 * Create an AES structure to hold the Global entity value
 */

  if (status == MCC_S_NORMAL)
    status = mcc_aes_create( &entity,
			   &MCC_K_CLASS_HARDWARE,
			   entity_instance,
			   &MCC_K_AES_NOT_WILD);

/*
 *  Create descriptor to hold child entity identifier
 */

if (status == MCC_S_NORMAL)
  status = mcc_desframe_create_descriptor(
	&memory,			/*  Memory Allocation List  */
	&child_entity_instance,		/*  Descriptor Pointer	    */
	&simplename_len,		/*  Length		    */
	&MCC_K_DT_SIMPLE_NAME,		/*  Datatype		    */
	&simplename_str,		/*  Identifier		    */
	&MCC_K_DISK_DEVICE,		/*  Id			    */
	&DSC_K_DTYPE_T);		/*  VMS datatype	    */

/*
 *  Use child entity identifier to create a child entity instance pair
 *  in the AES structure
 */

if (status == MCC_S_NORMAL)
  status = mcc_aes_create( &entity,
			   &MCC_K_CLASS_HARDARE_DISK,
			   child_entity_instance,
			   &MCC_K_AES_NOT_WILD);

/*
 *  Create descriptor to hold the event attribute "severity".
 */

if (status == MCC_S_NORMAL)
  status = mcc_desframe_create_descriptor(
	&memory,			/*  Memory Allocation List  */
	&severity,			/*  Descriptor Pointer	    */
	&4,				/*  Length		    */
	&MCC_K_DT_ENUMERATION,		/*  Datatype		    */
	&severity_value,		/*  Identifier Value	    */
	&MCC_K_ARG_SEVERITY,		/*  Id			    */
	&DSC_K_DTYPE_T);		/*  VMS datatype	    */

/*
 *  Create descriptor to hold the event attribute "User".
 */

if (status == MCC_S_NORMAL)
  status = mcc_desframe_create_descriptor(
	&memory,			/*  Memory Allocation List  */
	&username,			/*  Descriptor Pointer	    */
	&username_len,			/*  Length		    */
	&MCC_K_DT_LATIN1STRING,		/*  Datatype		    */
	&username_str,			/*  Identifier Value	    */
	&MCC_K_DISMOUNT_USER,		/*  Id			    */
	&DSC_K_DTYPE_T);		/*  VMS datatype	    */

/*
 *  Set the event partition & event code
 */
partition = MCC_K_PRT_NOTIFICATION_EVENTS;
code = 201; /*Disk Dismounted event*/

/*
 *  Create the event buffer Data descriptor
 */

data_buffer_len = sizeof( data_buffer );
if (status == MCC_S_NORMAL)
  status = mcc_desframe_create_descriptor( &memory,
					   &data,
					   &data_buffer_len,
					   &MCC_K_DT_ILV,
					   &data_buffer,
					   &code,	/*EVENT_CODE*/
					   &DSC_K_CLASS_S);

/*
 *  --------------- Encode the Event Report ---------------------------------
 *
 *  Open the ILV encoding for the Event Report
 */

  if (status == MCC_S_NORMAL)
    status = mcc_ilv_put_param_begin(
      &ctx,
      data );

/*
 *  Encode the Event Arguments;
 */
  if (status == MCC_S_NORMAL)
    status = mcc_ilv_put(&ctx,
			severity,
			MCC_K_NULL_PTR );

/*
 *  Encode the Event Arguments:
 */
  if (status == MCC_S_NORMAL)
    status = mcc_ilv_put(&ctx,
			username,
			MCC_K_NULL_PTR );

/*
 *  Close the Event Report
 */

  if (status == MCC_S_NORMAL)
    status = mcc_ilv_put_param_end( &ctx,
				    data );

/*
 *  Deliver the event
 */

if (status == MCC_S_NORMAL)
  status = show_inentity(entity);
if (status == MCC_S_NORMAL)
  status == mcc_event_put(entity,&partition,&code,data,timestamp);

if (status == MCC_S_NORMAL)
  status = mcc_desframe_free_alloc_list(&memory);

return (status);
}

The code which reads in this event is copied from mcc_example_getevent.c and
remains unmodified with respect to collecting the event ie; the mcc_event_get
call and creating the event report - "build_event_report"

When an event is received at the command line interface the following event
report is created :

MCC> getevent hardware * disk * any event
%DEBUG-I-DYNIMGSET, setting image MCC_HARDWARE_AM
%DEBUG-I-DYNMODSET, setting module MCC_HARDWARE_GETEVENT
DBG> go

HARDWARE LOCAL_NS:.hardware1 DISK $1$dia0
AT 20-APR-1994 09:21:21 Any Event

Event Received
Event: DISMOUNT
Disk has been dismounted by user "System"
				Severity = Warning
MCC>

When this event is received at the notification window the event is given the
severity level "indeterminate" although the argument "Severity = Warning" is
displayed when the event message is expanded.

The MSL definition for the Getevent directive has not been modified. The MSL
definition for the event is given below :

...

 TYPE
	PerceivedSeverity = 1005  (
			Indeterminate = 0,
			Critical = 1,
			Major = 2,
			Minor = 3,
			Warning = 4,
			Clear = 5
			);

...

	EVENT DISMOUNT = 201 :
	    DISPLAY = TRUE,
	    SYMBOL = EVT_DISK_DISMOUNTED,
	    TEXT = "Disk has been dismounted by user !<User>"

	    ARGUMENT Severity = 5 : PerceivedSeverity
		DISPLAY = TRUE,
		SYMBOL = ARG_SEVERITY
	    END ARGUMENT  Severity;


	    ARGUMENT User = 202 : Latin1String
		DISPLAY = FALSE,
		SYMBOL = DISMOUNT_USER
	    END ARGUMENT User;
	END EVENT DISMOUNT;

How can I make the event appear to have the severity "Warning" in the 
notification services window ?

Thanks.

- LEH
    
5932.7severity is argument of response not of eventMSBCS::CALLANDERWed Jun 01 1994 13:3426
    the event severity you are passing looks to be an argument of the
    event itself.  In the Notification FM MRM (Module Reference Manual)
    you will note that it specifies that the severity needs to be passed
    back as an argument of the response and NOT of the event. 
    
    What you are seeing from the FCL is that the arguments of the event are
    displayed. If you had done a notify command from the FCL you would have
    gotton indeterminate as the value and the severity would have been
    printed as part of th data on the event.  
    
    If memory servers me the argument should be argument code 5 and
    the severity level should be an enumeration value from the list:
    
       (
              1 = (
                  0 = %X    696E64657465726D696E617465 -- "indeterminate"
                  1 = %X    637269746963616C -- "critical"
                  2 = %X    6D616A6F72 -- "major"
                  3 = %X    6D696E6F72 -- "minor"
                  4 = %X    7761726E696E67 -- "warning"
                  5 = %X    636C656172 -- "clear"
                )         )
                                                                  
    Hope this helps some.