...
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).
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 thelicense_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 startlogmond
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 Applies to: All CHARON Charon kits up to version 4.7 build 17101 (included)
|
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 Charon Log files - Using baretail on Windows for syntax highlighting) orvim
(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 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:
It is recommended to run the selected configuration from the Launcher at least once before installing the service to facilitate debugging
.
.
- Define the service name and click on the "Install" button:
.
.
- Start the Charon Service Manager, right click on the virtual machine, select "Manage CHARON service" and start it:
.
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" tabExample:
.
It is recommended to run the selected configuration from the Launcher at least once before installing the service to facilitate debugging
.
.
- Define the service name and click on the "Install" button:
.
. - Start the Charon Service Manager, right click on the virtual machine, select "Manage Charon service" and start it:
.
Install and start the log monitor service
First, prepare a
nolicense.bat
file. See NOLICENSE.BAT considerations chapter further for more information if needed.
.
Warning |
---|
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:
...
.
.
- Install the log monitoring service and start it:
![(warning) (warning)](https://stromasys.atlassian.net/wiki/s/-2076947695/6452/ad9745aaa0f4a0241b41fe9039a1b2b32763889a/_/images/icons/emoticons/warning.png)
.
...
- Notes:
- The
EmulatorLogMonitor
service running thelogmond
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
.
- The
- 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
.
...
Alerts customization examples
...
Code Block | ||
---|---|---|
| ||
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'" |
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 | ||
---|---|---|
| ||
...
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:
If you are still prompted to allow for execution of the script, please run the following command to unblock the
|
Example using an office365 account
...
Code Block | ||
---|---|---|
| ||
# 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 | ||
---|---|---|
| ||
# 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 | ||
---|---|---|
| ||
# 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 | ||
---|---|---|
| ||
# 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 |
...
- Open "cmd.exe" from the "Start" menu.
- Change current directory to the folder (presumably) containing the CHARON Charon configuration file.
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:
|
To stop the Log Monitor & Dispatcher application, open the Task Manager, find the "logmond.exe
" process and terminate it.
...
- 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. - 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.- When CHARON Charon service is installed, master creates new slave.
- When CHARON Charon service is removed, slave is terminated to. The slave task monitors LOG of particular CHARON Charon service.
The "
-t
" switch enables trace windows, so you can see the process of monitoring. - 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 " |
Include Page | ||||
---|---|---|---|---|
|
...
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.
...