Charon Log monitoring on Windows (logmond) - Best practices for V4.8

Charon Log monitoring on Windows (logmond) - Best practices for V4.8

Table of contents

Description

The Log Monitor & Dispatcher, known as LOGMOND, is a special program which monitors a guest LOG file produced by Charon and executes a customized script when it detects removal of a license.

It runs in the background (as a program or as a service) and periodically scans a specified LOG file. When it detects a message with the code 0000002A or 00000351 ("Detected removal of a license"), it submits the nolicense.bat procedure (this BAT file must be created manually).

The Log Monitor & Dispatcher service is installed as EmulatorLogMonitor. By default it is installed in such a way that requires explicit actions to be started (either through a command line interface or using the standard ways of service management). For unattended execution, change the service’s configuration so that Windows starts the service automatically.

The tool requires a specific file "nolicense.bat" containing some specific instructions to be taken in situation of license absence. It is recommended you create this file in the folder (presumably) containing the LOG file.

When it is invoked by the “Log Monitor & Dispatcher”, the current directory of the batch process is set to the same folder from which the “Log Monitor & Dispatcher” was previously installed as a service or from which it was started as a background process. This means that the user action file may, in principle, operate with relative paths and relocate (as part of the whole configuration, i.e. together with accompanying LOG file).

The user action file will not invoke interactive applications as it may run in an environment where interactive services do not work, for example: when “Log Monitor & Dispatcher” is installed as a service.

The Log Monitor utility will report an alert only when no more license is available. It cannot send an alert when 2 dongles were connected (the main one and a backup one for example) and one is disconnected

 

Recommendations

  • Create a specific folder to hold the Charon configuration and log files, the nolicense.bat file and any specific action script you would add.

  • Use the rotating log files mechanism or use a single log file with "append" mode.

  • Install your virtual machines as services (this is the default mode starting with Charon-AXP and Charon-VAX version 4.8), they will then be able to start when the Charon Windows server will boot. This will also allows you to install and start the Charon log monitor service, named "EmulatorLogMonitor": doing so you will not have to start logmond manually in interactive mode and newly added virtual machines services will be automatically taken into account

Notes

  • The log monitor utility will detect the absence of the dongle only at a specified interval, called the license check interval and defined by the license. Its default is set to 1 hour. In case you need to perform tests, you can send us a fresh C2V file and ask for an update to reduce this interval.
    .

  • Once started the logmond utility will lock the virtual machine log file, you will not be able to move it, copy it or delete it. You will however be able to open it using the notepad utility or other log editors like baretail for example which will allow you to have a continuous view of the log with highlights (see: Charon Log files - Using baretail on Windows for syntax highlighting) or vim (see: Charon Log files - Using vim for syntax highlighting on Linux and Windows)
    .

Service setup example

Example below is based on a Charon-AXP V4.8 B18309 running on a Windows 2012 R2 server and emulating an AlphaServer DS20. All files (configuration, bin, rom and nolicense.bat) are located in C:\Charon, rotating log files are located in C:\Charon\logs

The configuration file is defined as follows:

 

Setup and start your virtual machine

  • Start the "Charon Virtual Machines Manager"

  • Create your virtual machine and start it

Install and start the log monitor service

 

The nolicense.bat file has to be placed in the virtual machine "Home directory". To locate this "Home directory" open the "Charon Virtual Machines manager" utility, select the virtual machine and switch to the "VM Configuration" tab

Example:


.

The example below will append a line in a text file:.

.

  • Install the log monitoring service and start it:

    These command lines must be executed as an administrator in order to manage the services 


    .

 

  • Notes:

    • The "logmond -r" command removes the service if any

    • The "logmond -i" command installs the service

    • The "logmond -u" command starts the service

    • The powershell commands shows 2 logmond processes, one scans for new services, the other is monitoring the log file of the current service (myds20)

    • The EmulatorLogMonitor service running the logmond processes will discover already installed Charon virtual machines services. If a new virtual machine service is added, it's log file will be automatically discovered and monitored.

    • The logmond.exe file is located by default in the "C:\Program Files\Charon\Build_18302\x64" folder
      .

  • Remove the dongle to check if the C:\Charon\logmond.log file is created:
    During the tests the license check interval was set to 5 minutes therefore, when the dongle is disconnected, a message is sent telling there are only 4 minutes remaining before the DS20 stops
    .

Running the log monitor from the command line

The "logmond" utility has several parameters available. Use the "logmond -h" command to have a complete list.

Starting in background mode

In order to start the Log Monitor & Dispatcher as a background application:

  1. Open "cmd.exe" from the "Start" menu.

  2. Change current directory to the folder (presumably) containing the Charon configuration file.

  3. Start the Log Monitor & Dispatcher using the following command line as an example:

    For single log file:

    ...> "C:\Program Files\Charon\Build_18302\x64\logmond" C:\my_Charon.log

    For rotating log file:

    ...> "C:\Program Files\Charon\Build_18302\x64\logmond" -l <log-directory> -p <log-prefix>

    where:



© Stromasys, 1999-2025  - All the information is provided on the best effort basis, and might be changed anytime without notice. Information provided does not mean Stromasys commitment to any features described. 
Need fast, reliable migration? We have done it countless times. Talk to an expert