VCS 6.1 : How to Query Log Data Files using the hamsg?

vcs-how-toThe hamsg utility displays the contents of a specified log data file (LDF) in any language supported by VCS. A log data file, <file>.ldf, contains data about messages written to a corresponding English language log, <file>.log. Typically, for every English VCS log file there is a corresponding LDF. LDF files are generated when the VCS_ENABLE_LDF environment variable is set to 1 (the default); LDF files are not generated when VCS_ENABLE_LDF environment variable is set to 0.
By default, LDF files are written to the following directory:
UNIX: /var/VRTSvcs/ldf
VCS log messages have the following format:
Timestamp Mnemonic Severity UMI message_text
:::   To display specific LDF data
# hamsg [-any] [-sev C|E|W|N|I] 
[-otype VCS|RES|GRP|SYS|AGT]
[-oname object_name] [-cat category] [-msgid message_ID] 
[-path path_name] [-lang language] LDF_file
 
-any Specifies hamsg return messages that match any of the specified query options.
-sev Specifies hamsg return messages that match the specified message severity Critical, Error, Warning, Notice, or Information.
-otype Specifies hamsg return messages that match the specified object type
VCS = general VCS messages
RES = resource
GRP = service group
SYS = system
AGT = agent
-oname : Specifies hamsg return messages that match the specified object name.
-cat : Specifies hamsg return messages that match the specified category. For example, the value 2 in the message id “V-16-2-13067”
-msgid : Specifies hamsg return messages that match the specified message ID. For example, the value 13067 the message id “V-16-2-13067″‘
-path : Specifies where hamsg looks for the specified LDF. If not specified, hamsg looks for files in the default directory /var/VRTSvcs/ldf.
-lang : Specifies the language in which to display messages. For example, the value en specifies English and “ja” specifies Japanese.
The hamsg utility uses the VCS BMC (binary message catalog) to correctly display messages found in the LDF in the user’s language. If a message in the LDF cannot be found in the existing set of BMCs, the following English message will be displayed:
Could not find message Message_ID: arg 1 = arg1_value, arg2 = arg2_value, …
Example:   Could not find message 50010: arg1 = G1, arg2 = thor63
Note: arg1, arg2, and so on refer to the message arguments that need to be inserted into message Message_ID. If the number of message arguments that are specified in the LDF do not match with the corresponding message found in the BMC, “???” is inserted for all message argument placeholders and the message will be displayed.
::: To Displays the entire contents of the engine_A log:
#hamsg engine_A   
::: To Displays miscellaneous LDF information about the hashadow_A LDF:
#hamsg -info hashadow_A
::: To Displays all messages that are of object type “resource” and whose object name is “FOO1” found in the engine_A log:
#hamsg -otype RES -oname FOO1 engine_A
::: To Displays all Warning messages in the FileOnOff_A log:
#hamsg -sev W FileOnOff_A
::: To Displays all messages that either have a Critical Severity or a message ID of 10051 in the engine_A log:
#hamsg -any -sev C -msgid 10051 engine_A
::: To Displays a list of available LDF files that can be viewed on the current system:
#hamsg -list
Ramdev

Ramdev

I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com. You can connect me at - https://www.linkedin.com/in/unixadminschool/

1 Response

  1. September 24, 2015

    […] Read –  How to Query Log Data Files using the hamsg? […]

What is in your mind, about this post ? Leave a Reply

Close
  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us