You have VBS scripts 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 script that checks for free disk space, and generates a custom MessageMaster message if it finds that the disk space is below 100MB.
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 Disk Space Check. Under that, create a version called 1.0. Finally, under that, create a new Message definition called DS-1 (for Disk Space 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 | Warning |
| Title | @workstation is low on disk space |
| Message | The machine @workstation has only @diskSpace MB of free disk space. Please check the machine, and free up some disk space. |
| Delivery Limit | 1 Day |
Note: @diskSpace 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 script that will check for disk space:
Dim fso, d, fSpace
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive("c:")
fSpace = d.FreeSpace/1024 ' get free space in MB
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 DS-1 message, we defined a tag called @diskSpace, and its value will be the amount of free disk space.
dim wShell
Set wShell = WScript.CreateObject("WScript.Shell")
if fSpace < 100 then
wShell.Run """C:\Program Files\Objective Software\Utility\SendMMsg.exe"" " & _
"""System Checks"" ""Disk Space Check"" ""1.0"" ""DS-1""" & _
"""diskSpace=" & cStr(fSpace) & """", 2, True
end if
You can now launch your disk space check script any way that you normally deploy scripts 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.