Display message text in a computer output window on the PATROL Console.


msg_printf(message_ID, [argument_1, argument_2...argument_N])


message_IDinteger that identifies a message that you want to print
argument_1... argument_N

values that replace variables or control characters in the text of the message


The msg_printf() function displays the text of a message to the computer or task output window. This function is very similar to printf(), but msg_printf() displays information from the message catalog while printf() displays information that you supply. 

The parameters that you use with msg_printf() supply information that the message catalog cannot provide. Themessage_ID identifies which message you want to display. The optional arguments provide values for variables or control characters that exist in the message text. For example, the %d character sequence represents a signed decimal. If a message contains %d in its text, you must supply a signed decimal value as an argument to msg_printf(). When this function displays the message, it displays the decimal (provided by you) in place of the %d. The variables and control characters in these messages follow the same rules as the format parameter of the printf() function. See printf()

Typically, msg_printf() returns the empty string, but it returns the following error message when it cannot find a message ID or message catalog: 


When you call the msg_printf() function, a PATROL Console, not a PATROL Agent, retrieves the message and substitutes any arguments. For this reason, the message catalog must be available to the console side of the connection.

This function provides support for internationalized PSL scripts. For more information about internationalization, see Internationalized PSL Scripts.


The following example shows the msg_printf() function:

msg_printf(BMC_KM_ORACLE_ALL_OK, threads_num, host_name);

The BMC_KM_ORACLE_ALL_OK argument is the ID for the following message:

Everything is OK. Total %d threads on host %s.

The msg_printf() function replaces the %d and %s characters with the values from the threads_num and host_name variables. It then displays the preceding message in the computer or task output window.


Was this page helpful? Yes No Submitting... Thank you