This is a standalone program that installs and runs as a Windows Server service that verifies and monitors if the Mi-Token-related services are running and if the AD LDS tokens database is replicating.


Installation


Download the attached zip file and unzip it inside C:\Program Files\Mi-Token


Open a CMD command line window as an administrator, navigate to the installation directory, and run the following command:


MiTokenMonitorService.exe install



Configuration


The monitor service can send an alert email for a list of defined email addresses every defined time frame. The configuration of the service is located in the MiTokenMonitorUtilities.exe.config file.


SMTP credentials


In order to send emails, set the following entries according to your SMTP server:


    <add key="SmtpServer" value="" />

    <add key="SmtpPort" value="" />

    <add key="SmtpUsername" value="" />

    <add key="SmtpPassword" value="" />


The service requires a SMTP configuration that uses TLS. The SmtpUsername parameter will be used as the source email address (Sent from).


Email notification list


You can specify one or more email addresses to receive the alerts. The list is defined in the following tag:


<add key="notifyList" value="" />


Separate each email address with a semicolon, for example:


<add key="notifyList" value="sysadmin@mydomain.com;support@mydomain.com" />



Monitoring time frame


The service will monitor the server indefinitely as long as it is running. The runEveryMinutes entry defines how often the monitor will verify the services and the Event Viewer logs. This entry accepts any positive integer between 5 and 1440.


The monitor service will count the elapsed minutes starting at midnight according to the server's time. If the verified time equals a number of minutes multiple of the runEveryMinutes parameter, the service will check the server's services and Event Viewer and send the corresponding email alerts (when applicable).


For example, if runEveryMinutes is set to 10:


<add key="runEveryMinutes" value="10" />


The service will monitor the server at:

00:10

00:20

00:30

...

09:00

09:10

09:20

...

13:30

13:40

etc.


Verify old events


The monitor service verifies if the services are running every time. The Event Viewer will check the events recorded in the running day and it can be set to verify older dates with the checkLastDays parameter, which defines how many days back (cunting from the current date) the service will query the Event Viewer. For instance:


<add key="checkLastDays" value="3" />


The service will check the Event Viewer on the current day and up to three days before. This ensures that if an Alert has been issued and no corrective action was taken, the service will issue an alert.


Service start and stop


You can start and stop the service from the Windows Services console:



Uninstallation


Open a CMD command line window as an administrator, navigate to the installation directory, and run the following command:


MiTokenMonitorService.exe uninstall