You have .CMD or .BAT files that run in your enterprise, and you would like to make them generate MessageMaster messages that you and other IT Support staff can subscribe to.
To illustrate, we will demonstrate with an example. We will write a batch file that checks that Norton Anti-Virus is installed, and generates a custom MessageMaster message if it finds that it is missing.
In order to be able to generate a custom MessageMaster message, you first have to create a Message Definition for it. This is done from the MessageMaster Console, under the Message Admin menu. (Having to pre-define your messages may seem strange at first, but the benefits soon outweigh the inconvenience. See "Why do you have to pre-define message definitions", referenced below.)
First, decide where in the MessageMaster hierarchy you want to create your message. The levels of the hierarchy are Category, Application, Module, Version, Message. By default you will have two Categories, EventMaster (if you have EventMaster installed) and MessageMaster. In this example, we will create a third Category for our custom message, called In-house Applications.
Under the In-house Applications Category, create an Application called System Checks. Under that, create a Module called NAV Check. Under that, create a version called 1.0. Finally, under that, create a new Message definition called NAV-1 (for Norton Anti-Virus 1), just so that our message id has some meaning. Fill in the other details of the message definition as follows:
| Field | Value to enter |
| Severity | Error |
| Title | @workstation is missing anti-virus software! |
| Message | The machine @workstation does not have Norton Anti-Virus installed. The file "@navPath" was not present on the system. Please use the NAV console to push NAV to this machine immediately. |
| Delivery Limit | 1 Day |
Note: @navPath is a custom 'tag' that we're defining in this message. At the time that we generate the message, we'll be able to provide a value that will be substituted for this tag in the message. @workstation is a built-in tag. See 'MessageMaster Variables' for a list of all built-in tags that can be used in message definitions and titles, referenced below.
Here is a sample batch file that will check if NAV is installed:
if not exist "%ProgramFiles%\NavNT\vpc32.exe" goto genMMError
echo NAV exists. Check complete.
goto theEnd
:genMMError
echo NAV is missing. Generating MessageMaster message.
:: MessageMaster code goes here. See below.
:theEnd
Use the SendMMsg.exe utility to generate the message. The utility can be found in the c:\Program Files\Objective Software\Utility directory.
The parameters that we pass to SendMMsg.exe will reflect the location of our message definition in the MessageMaster hierarchy, and will also pass any custom tags that we've used in our message, along with their values. In our NAV-1 message, we defined a tag called @navPath, and its value will be the path of the file whose existence we're checking for. (Note: the following code is all one line in the batch file.)
"%ProgramFiles%\Objective Software\Utility\SendMMsg.exe" "System Checks"
"NAV Check" "1.0" "NAV-1" "navPath=%ProgramFiles%\NavNT\vpc32.exe"
You can now launch your NAV check batch file any way that you normally deploy programs in your enterprise. One way is to set it up as a startup script in Active Directory, to run on all machines in your enterprise.
Note: only clients that have MessageMaster Client installed will successfully generate a message.
The best way to receive your new custom message is to subscribe to it. See 'Subscription - Agents and Carriers', referenced below, for how to use the MessageMaster subscription system.
Or you can search for your message in the MessageMaster database by using the Search page of the MessageMaster console.