|
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 00000424 ("Detected removal of a license") or 0000002A or 00000351 for backward compatibility, it submits the nolicense.bat
procedure (this BAT file must be created manually). It also invokes the license_changed.bat
script, if it exists, when it detects a message with code 0000040B / "License has changed. License detected and online".
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
", and optionally a file named "license_changed.bat
", containing some specific instructions to be taken in situation of license absence or license change. These files must be created in the virtual machine's home directory.
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. |
A new utility is available for download that offers more monitoring capabilites than logmond. Please see CHARON on Windows - Charon Log Monitor and contact us to get the download link if needed. |
nolicense.bat
file, the license_changed.bat
if needed, and any specific action script you would add.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. Use interactive mode for tests and debugging purpose.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)..
Example below is based on a Charon-AXP V4.9 B19402 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:
First, prepare a nolicense.bat
file. See nolicense.bat considerations chapter further for more information if needed..
The |
Example:
.
Use the notepad for example to create the nolicense.bat
script. We will here add a line in a log file:
echo %date% %time% dongle removed >>C:\Charon\logmond.log
The license_changed.bat
script can also contain quite the same line:
echo %date% %time% license has changed >>C:\Charon\logmond.log
.
logmond -r
" command removes the service if anylogmond -i
" command installs the servicelogmond -u
" command starts the serviceEmulatorLogMonitor
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.C:\Program Files\Charon\Build_19402\x64
" folder for Charon-AXP/VAX/PDP V4.9, "C:\Program Files\Charon\Build_20200\x64
" for V4.10. The "logmond
" utility has several parameters available. Use the "logmond -h
" command to have a complete list.
In order to start the Log Monitor & Dispatcher as a background application:
Start the Log Monitor & Dispatcher using the following command line as an example:
For single log file:
...> |
For rotating log file:
...> |
where:
log-directory
> is the directory where the rotating log files are storedlog-prefix
> is the same as the "configuration_name" value in corresponding Charon configuration file (or "hw_model", if "configuration_name" is not specified).Example:
|
To stop the Log Monitor & Dispatcher application, open the Task Manager, find the "logmond.exe
" process and terminate it.
To diagnose LOGMOND using trace feature:
--stop
" (or "-d
" or "--down
"). This is not absolutely necessary though, as multiple running LOGMOND utilities do not affect each other.-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.-t
" switch enables trace windows, so you can see the process of monitoring.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 " |
LOGMOND always looks for nolicense.bat
and license_changed.bat
files 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 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
and license_changed.bat
files in the virtual machine'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
and license_changed.bat
files in the virtual machine's home directory.
Stromasys highly recommends to use logmond as a service, installing it with the "-i
" option then starting it with "-u
".