Related productsCharon-AXP and Charon-VAX versions 4.6 and 4.7
Operating systems

Windows 7 Professional, Windows 8.1 Professional, Windows Server 2008 R2, Windows Server 2012 (R2), Windows Server 2016


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. This utility is available for Charon-AXP and Charon-VAX V4.6 and above.

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



If you're using rotating log files and you use the minus character ("-") in the configuration_name, the logmond process will not execute the nolicense.bat script file and will report a "wrong prefix" error (this can only be seen using the debugging mode)

Applies to: All Charon kits up to version 4.7 build 17101 (included)

(info) A patch to replace logmond.exe file is available here.

(lightbulb) Patch 17103, released on April 27th 2016, for Charon-AXP and Charon-VAX solves this problem.

Notes

Service setup example

Example below is based on a Charon-AXP V4.7 B17101 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

.

Install and start the log monitor service

.

The nolicense.bat file must be placed in the virtual machine "Home directory". This directory corresponds to the configuration file folder when the service is installed, however it will not change if the configuration file is relocated and the service is updated. To locate this "Home directory" open the "Charon Service Manager" utility, right click on the corresponding service and select "View configuration"

Example:


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

.
(warning) These command lines must be executed as an administrator in order to manage the services 


.


(info) 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

(question) 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\Utilities_X.X.XXXXX\x64\logmond” C:\my_Charon.log

    For rotating log file:

    ...> “C:\Program Files\Charon\Utilities_X.X.XXXXX\x64\logmond-l <log-directory> -p <log-prefix>

    where:


Example:

...> “C:\Program Files\Charon\Utilities_1.0.17101\x64\logmond-l "C:\My Charon logs" -p "MY_VAX"

To stop the Log Monitor & Dispatcher application, open the Task Manager, find the "logmond.exe" process and terminate it.

Debugging

To diagnose LOGMOND using trace feature:

  1. Stop LOGMOND service using "--stop" (or "-d" or "--down"). This is not absolutely necessary though, as multiple running LOGMOND utilities do not affect each other.

  2. Start "almost-as-a-service" LOGMOND with diagnostic trace using two command line switches: "-e" and "-t". This starts master task of LOGMOND which enumerates all Charon services and for each of them invokes slave task of LOGMOND. The master task of LOGMOND looks for installing or removal Charon services.
    1. When Charon service is installed, master creates new slave.
    2. When Charon service is removed, slave is terminated to. The slave task monitors LOG of particular Charon service.
    (info) The "-t" switch enables trace windows, so you can see the process of monitoring.

  3. To terminate "almost-as-a-service" LOGMOND master and all its slaves, bring focus to master's trace window, and press "Ctrl-C" ([X] button closes master task, but slaves continue to run unmastered).


The LOGMOND still supports backward compatibility mode, when it does NOT monitor ALL Charon services, but only monitors a particular folder or even a particular file. So, if you want to diagnose how it monitors a file, you can use the same "-t" option:

C:\...>logmond.exe -t -l <path to Charon log file>

If you want to diagnose monitoring rotating log:

C:\...>logmond.exe -t -l <path to Charon log directory> -p <log prefix>

If you want to diagnose monitoring particular service:

C:\...>logmond.exe -t -s <service name>

When you install LOGMOND to run as a service it implicitly runs with "-e" option but without "-t". Alternatively you may install LOGMOND as a service with explicitly specified name of log file (for backward compatibility)


You better use "-e" together with "-t" to diagnose monitoring Charon services. Unless you run instances with Launcher, in which case you will have to invoke LOGMOND with "-l" with "-t" options.

nolicense.bat considerations

LOGMOND always looks for nolicense.bat in the current working directory. What is current working directory for LOGMOND depends on how it is invoked.

If you run LOGMOND with just path to log file, the LOGMOND inherits current working directory from command prompt it is invoked from. So, before you run LOGMOND this way, change prompt's working directory to where you keep your NOLICENSE.BAT file.

If you install LOGMOND as a service with just path to log file, the service remembers the current working directory of the prompt from which it is installed, and uses it as its own current working directory. So, before you run LOGMOND this way, change prompt's working directory to where you keep your nolicense.bat file.

If you run LOGMOND with name of Charon service, the LOGMOND changes its current working directory to the Charon service's Home directory. So, keep the nolicense.bat file in the service's home directory.

If you run LOGMOND with "-e" option, each slave receives a particular name of Charon service, and therefore changes to the service's Home directory. So, keep the nolicense.bat file in the service's home directory.

Related articles