Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated for V4.6 and V4.7 only

...

The Log Monitor & Dispatcher, known as LOGMOND, is a special program which monitors a guest LOG file produced by CHARON 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") for Charon-AXP/VAX/PDP version 4.8 and below or 00000424 for version 4.9 and above , it submits the nolicense.bat procedure (this BAT file must be created manually).

(info) Starting with version 4.9, LOGMOND 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 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 "NOLICENSEnolicense.BATbat" 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.

...

  • Create a specific folder to hold the CHARON Charon configuration and log files, the nolicense.bat file ( and the license_changed.bat file for V4.9 and above) 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 , 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

...

Warning

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 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 CHARONCharon-AXP and CHARONCharon-VAX solves this problem.

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. (lightbulb) 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 Charon Log files - Using baretail on Windows for syntax highlighting) or vim (see: CHARON Charon Log files - Using vim for syntax highlighting on Linux and Windows)
    .

  • If you encounter a "Can't open CHARON Charon log file" from the "CHARON Charon Service Manager" utility (CHARON-AXP and CHARON-VAX V4.7 and below), please open the "Service Management" menu then select "Refresh Service List". This error occurs when the Service Manager has not detected a change in the configuration.

...

Info

Example below is based on a CHARONCharon-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

...

  • Run the Launcher, load the configuration file and click on the "Install / Update service" box:
    (lightbulb) It is recommended to run the selected configuration from the Launcher at least once before installing the service to facilitate debugging
    .
    Image Removed

.

  • Define the service name and click on the "Install" button:
    .
    Image Removed
    .
  • Start the Charon Service Manager, right click on the virtual machine, select "Manage CHARON service" and start it:
    .
    Image Removed

Install and start the log monitor service

  • First, prepare a nolicense.bat file. See NOLICENSE.BAT considerations chapter further for more information if needed.

    .

    • CHARON-AXP and CHARON-VAX V4.8 and above:

      Warning

      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:

      Image Removed
      .
    CHARON-AXP and CHARON-VAX V4.7 and below:Run the Launcher, load the configuration file and click on the "Install / Update service" box:
    (lightbulb) It is recommended to run the selected configuration from the Launcher at least once before installing the service to facilitate debugging
    .
    Image Added

.

  • Define the service name and click on the "Install" button:
    .
    Image Added
    .
  • Start the Charon Service Manager, right click on the virtual machine, select "Manage Charon service" and start it:
    .
    Image Added

Install and start the log monitor service

.

Warning

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:

Image Modified


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

...

.

Image Modified

.
  • Install the log monitoring service and start it:
(warning) These command lines must be executed as an administrator in order to manage the services 


.

...

Image Added

  • Notes:
    • The EmulatorLogMonitor service running the logmond processes will discover already installed CHARON Charon virtual machines services. If a new virtual machine service is added, it's log file will be automatically discovered and monitored.
    • If you are running Charon-AXP/VAX/PDP version V4.8, the logmond.exe file is located by default in the "C:\Program Files\CHARONCharon\Build_18302\x64" folder
      .
  • Remove the dongle to check if the C:\Charon\logmond.log file is created:


(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
.

...

Image Added

Alerts customization examples

...

Code Block
languageactionscript3
powershell -command "New-Eventlog -Logname application -Source CHARONCharon -Erroraction silentlycontinue;Write-Eventlog -Logname application -Source CHARONCharon -Entrytype Error -Eventid 314 -Message 'CHARONCharon license dongle disconnected'"

(info) It is recommended to use the powershell command to write events instead of the "eventcreate" command line as some other events are created with powershell scripts. Using the eventcreate command in this case will fail as the source, CHARONCharon, will not be accepted.

Div
classpagebreak


...

Info

To run PowerShell scripts (files that end with .ps1), you must first set the execution policy to Unrestricted (This operation has to be done once).

To do so, open a command line window (cmd.exe) as an Administrator and use the following command:

c:\Charon>powershell -command "Set-ExecutionPolicy Unrestricted"

(info) The ExecutionPolicy can also be set to "RemoteSigned". In this case the .ps1 script files will have to be unblocked as described below.

If you are still prompted to allow for execution of the script, please run the following command to unblock the .ps1 file you want to execute:

c:\Charon>powershell -command "Unblock-File -path c:\charonCharon\sendmail.ps1"


Example using an office365 account

...

Code Block
languagepowershell
# Update the email addresses below:
$From = "<monitoring-account>@<somewhere>"
$To = "<someone>@<somewhere>"

# Send the email
send-mailmessage -to $To -from $From -subject "CHARONCharon detected removal of the license" -body "Please check" -smtpserver smtp.office365.com -usessl -port 587 -delivery none

...

Code Block
languagepowershell
# Update the email addresses below:
$From = "<monitoring-account>@<somewhere>"
$To = "<someone>@<somewhere>"

# The command below will open a window for you to store the password
$Creds=(get-credential -credential "$From")

# Send the email (credentials are then required each time)
send-mailmessage -to $To -from $From -subject "CHARONCharon detected removal of the license" -body "Please check" -smtpserver smtp.office365.com -usessl -port 587 -delivery none -credential $Creds

...

Code Block
languagepowershell
# Update the email addresses below:
$From = "<monitoring-account>@<somewhere>"
$To = "<someone>@<somewhere>"

$Creds = Import-CliXml C:\Charon\creds.clixml

send-mailmessage -to $To -from $From -subject "CHARONCharon detected removal of the license" -body "Please check" -credential $Creds -smtpserver smtp.office365.com -usessl -port 587 -delivery none

...

To send an email using a gmail account, perform the same operations as described in the Example using an office365 account chapter above and replace the smtpserver value by smtp.gmail.com as shown below:

...

Code Block
languagepowershell
# Update the email addresses below:
$From = "<monitoring-account>@gmail.com"
$To = "<someone>@<somewhere>"

$Creds = Import-CliXml C:\Charon\creds.clixml

send-mailmessage -to $To -from $From -subject "CHARONCharon detected removal of the license" -body "Please check" -credential $Creds -smtpserver smtp.gmail.com -usessl -port 587 -delivery none

...

  1. Open "cmd.exe" from the "Start" menu.
  2. Change current directory to the folder (presumably) containing the CHARON Charon configuration file.
  3. Start the Log Monitor & Dispatcher using the following command line as an example:

    For single log file:

    ...> “C:\Program Files\CHARONCharon\Utilities_X.X.XXXXX\x64\logmond” C:\my_charonCharon.log

    For rotating log file:

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

    where:

    • <log-directory> is the directory where the rotating log files are stored
    • <log-prefix> is the same as the "configuration_name" value in corresponding CHARON Charon configuration file (or "hw_model", if "configuration_name" is not specified).

...

Example:

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

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

...

  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 Charon services and for each of them invokes slave task of LOGMOND. The master task of LOGMOND looks for installing or removal CHARON Charon services.
    1. When CHARON Charon service is installed, master creates new slave.
    2. When CHARON Charon service is removed, slave is terminated to. The slave task monitors LOG of particular CHARON 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 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 Charon log file>

If you want to diagnose monitoring rotating log:

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

...

Info

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

Include Page
KBCOMMON:KB-GoToTop
KBCOMMON:KB-GoToTop

...

nolicense.

...

bat considerations

LOGMOND always looks for nolicense.bat in the current working directory. This also applies for the license_changed.bat script for V4.9 and above. What is current working directory for LOGMOND depends on how it is invoked.

...