Previous  |  Next  >  
Product: Cluster Server Guides   
Manual: Cluster Server 4.1 Agent Developer's Guide   

Creating SMC Files

Since Source Message Catalog files are used to generate the Binary Message Catalog files, they must be created in a consistent format.

SMC Format


#!language = language_ID
#!module   = module_name
#!version  = version
#!category = category_ID

# comment
message_ID1 {%s:msg}
message_ID2 {%s:msg}
message_ID3 {%s:msg}

# comment
message_ID4 {%s:msg}
message_ID5 {%s:msg}
...

Example SMC File

Examine an example SMC file, named VRTSvcsSunAgent.smc, based on the SMC format:


 #!language = en
#!module   = HAD
#!version  = 4.0
#!category = 203

# common library

100 {"%s:Invalid message for agent"}
101 {"%s:Process %s restarted"}
102 {"%s:Error opening /proc directory"}
103 {"%s:online:No start program defined"}
104 {"%s:Executed %s""}
105 {"%s:Executed %s"}

Formatting SMC Files

  • SMC files must be encoded in UCS-2, ASCII, or UTF-8. See Naming SMC Files, BMC Files for a discussion of file naming conventions.
  • All messages should begin with "%s:" that represents the three-part header "Agent:Resource:EntryPoint" generated by the agent framework.
  • The HAD module must be specified in the header for custom agents. See Example SMC File.
  • The minor number of the version (for example, 2.x) can be modified each time a BMC is to be updated. The major number is only to be changed by VCS. The version number indicates to processes handling the messages which catalog is to be used. See Updating BMC Files.
  • In the SMC header, no space is permitted between the "#" and the "!" characters. Spaces can follow the "#" character and regular comments in the file. See the example above.
  • SMC filenames must use the extension: .smc.
  • A message should contain no more than six string format specifiers.
  • Message IDs must contain only numeric characters, not alphabetic characters. For example, 2001003A is invalid. Message IDs can range from 1 to 65535.
  • Message IDs within an SMC file must be in ascending order.
  • A message formatted to span across multiple lines must use the "\n" characters to break the line, not a hard carriage return. Line wrapping is permitted. See the examples that follow.

Naming SMC Files, BMC Files

BMC files, which follow a naming convention, are generated from SMC files. The name of an SMC file determines the name of the generated BMC file. The naming convention for BMC files has the following pattern:

VRTSvcs{Sun|AIX|HP|Lnx|W2K}{Agent_name}.bmc

where the platform and agent_name are included.

For example:


VRTSvcsHPOracle.bmc

The name of the SMC file used to generate the BMC file for the preceding example is VRTSvcsHPOracle.smc.

Message Examples

  • An illegal message, with hard carriage returns embedded with the message:

  •   201 {"%s:To be or not to be!
       That is the question"}
  • A valid message using "\n":

  •   10010 {"%s:To be or not to be!\n
      That is the question"}
  • A valid message with text wrapping to the next line:

  •   10012 {"%s:To be or not to be!\n
      That is the question.\n Whether tis nobler in the mind to
      suffer\n the slings and arrows of outrageous fortune\n or to
      take arms against a sea of troubles"}

Using Format Specifiers

Using the "%s" specifier is appropriate for all message arguments unless the arguments must be reordered. Since the word order in messages may vary by language, a format specifier, %#$s, enables the reordering of arguments in a message; the "#" character is a number from 1 to 99.

In an English SMC file, the entry might resemble:


301 {"%s:Setting cookie for proc=%s, PID = %s"}

In a language where the position of message arguments need to switch, the same entry in the SMC file for that language might resemble:


301 {"%s:Setting cookie for process with PID = %3$s, name = %2$s"}
 ^ Return to Top Previous  |  Next  >  
Product: Cluster Server Guides  
Manual: Cluster Server 4.1 Agent Developer's Guide  
VERITAS Software Corporation
www.veritas.com