Watchdog Event Provider via STMP (WDEventProviderSMTP.xml)

With this, please do not use System Manager’s own Watchdog alarm sending.

This feature can be used, for example, to delay Camera No Signal events when the camera is coming online shortly after this event.

Requirements

  • License feature: SMTP Watchdog health provider

    • By default, the latest VMS V9 and V8 VMS licenses include this feature

Configuring email settings

  • Open System Manager.

  • Open the first tab, Email settings.

  • This opens a new window where you can fill in the email settings to this system.

    • If there are multiple servers on the system, this needs to be done for each server separately.

      image-20230727-114435.png
  • To test email sending, you need to add at least one email address to the Email addresses list.

  • Then click this email address active and click the Send test email button

    • This send test email to wanted email address and shows the status if email sending works or not

      image-20230727-114707.png
  • Now you can save settings.

  • After this, there is needed to open Watchdog settings and temporarily add an email address to the event.

  • When saving Watchdog settings with an event, this stores details in the C:\Program Files\DVMS\DVR folder, which allows you to use authenticated SMTP.

    • This is not needed if there is no need to use authentication for SMTP.

If there is not need to use authenticated SMTP, then you can only edit the desired lines in the WDEventProviderSMTP.xml file. This uses only port 25.

<Address value="smtp.company.com" />
<Sender value="wd@company.com" />
<TargetAddresses>
  <TargetAddress value="firstname.lastname@company.com" />
</TargetAddresses>

How to modify the WDEventProviderSMTP.xml file

  • Go to the default folder location C:\Program Files\DVMS\DVR\WDEventProviders

  • Make a copy of the WDEventProviderSMTP.xml file to the Desktop

  • Open this file using example: Notepad++

  • To enable this feature, you need to change the line

    <Enabled value="false" />
    

    To

    <Enabled value="true" />
    
  • DelaySendEvents section is where you can make changes to delay sending the Camera No Signal event.

    • This is helpful if there is an IP camera that is working but not behind a stable connection.

  • Default DelaySendEvents

    • <!-- text --> means a comment in an XML file

        <DelaySendEvents>
          <!-- Wait 60 seconds for video channel 2 for VideoChannelOK event after VideoChannelNotStarted has received 
          <DelaySendEvent seconds="60" channel="2" triggerEvent="15" cancelEvent="13" />
          -->
          <!-- Wait 30 seconds for video channel 2 for VideoChannelOK event after VideoChannelNoSignal has received 
          <DelaySendEvent seconds="30" channel="2" triggerEvent="14" cancelEvent="13" />
          -->
        </DelaySendEvents>
      
  • To change this section, you need to add new lines under comments, for example

    <DelaySendEvents>
        <!-- Wait 60 seconds for video channel 2 for VideoChannelOK event after VideoChannelNotStarted has received 
        <DelaySendEvent seconds="60" channel="2" triggerEvent="15" cancelEvent="13" />
        -->
        <!-- Wait 30 seconds for video channel 2 for VideoChannelOK event after VideoChannelNoSignal has received 
        <DelaySendEvent seconds="30" channel="2" triggerEvent="14" cancelEvent="13" />
        -->
        
        <DelaySendEvent seconds="60" channel="1" triggerEvent="15" cancelEvent="13" />
        <DelaySendEvent seconds="30" channel="1" triggerEvent="14" cancelEvent="13" />
      </DelaySendEvents>
    
  • Now there is add two lines

    <DelaySendEvent seconds="60" channel="1" triggerEvent="15" cancelEvent="13" />
    <DelaySendEvent seconds="30" channel="1" triggerEvent="14" cancelEvent="13" />
    
    • First line mean that we have delayed event “VideoChannelNotStarted” at 60 seconds and if system get in 60 seconds event “VideoChannelOK”, system not send email out but if that is more than 60s, then email is sent out.

    • Second line ean that we have delayed event “VideoChannelNoSignal” at 30 seconds and if system get in 30 seconds event “VideoChannelOK”, system not send email out but if that is more than 30s, then email is sent out.

  • Now save this WDEventProviderSMTP.xml file and copy it to the default location C:\Program Files\DVMS\DVR\WDEventProviders

  • When this is done, restart the WDServer service in Windows Services.

  • Now when there is happening event where is made made changes, system send or not send email out based on these settings in XML file.

Filtering events

XML also provides an option to filter events in the Filters section.

  <Filters>
    <!-- if minutes is 0, event won't be sent at all -->
    <!-- sample filter: never send event 28
    <Filter event="28" minutes="0" /> -->
    <!-- sample filter: send event 4 once/hour maximum
    <Filter event="4" minutes="60" /> -->
  </Filters>

In this section, you can, for example, disable sending a wanted event or send an event once an hour.

Changing time format

In XML has two lines where you can change the time format.

  <!-- The format used in UTC timestamp. See format description in http://msdn.microsoft.com/en-us/library/az4se3k1.aspx -->
  <UtcTimeFormat value="yyyy-MM-dd hh-mm-ss-fff" />

  <!-- The format used in local timestamp. See format description in http://msdn.microsoft.com/en-us/library/az4se3k1.aspx -->
  <LocalTimeFormat value="yyyy-MM-dd hh-mm-ss-fff zzz" />

Software uses standard date and time format strings from Microsoft code.

Here are links to supported strings.

https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings

https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

Example you want to change the local time format to 27.7.2023 and time 16.39 you need edit line

<LocalTimeFormat value="yyyy-MM-dd hh-mm-ss-fff zzz" />

Change this line to this

<LocalTimeFormat value="dd-MM-yyyy HH-mm-ss-fff zzz" />

Then save these changes to the WDEventProviderSMTP.xml file and restart WDServer in Windows Services.

Supported WD Events

The end of the WDEventProviderSMTP.xml file has all current supported Watchdog Event codes.

Check the latest list of the Watchdog event codes here.

  <!-- Current WD events
  // Service states
  SmServerDown = 0
  SmServerUp = 1
  DvrServerDown = 2
  DvrServerUp = 3

  // Network status
  NetworkDown = 4
  NetworkUp = 5

  // DVR core state
  DvrStatusOK = 6
  DvrRefreshing = 7
  DvrVideoCaptureLoadFailure = 8
  DvrAudioCaptureLoadFailure = 9
  DvrDataCaptureLoadFailure = 10
  DvrNoFileSystem = 11
  DvrDiskFailure = 12

  // Video channel status
  VideoChannelOK = 13
  VideoChannelNoSignal = 14
  VideoChannelNotStarted = 15
  VideoChannelNoCapture = 16

  // Audio channel status
  AudioChannelOK = 17
  AudioChannelNoSignal = 18
  AudioChannelNotStarted = 19
  AudioChannelNoCapture = 20

  // Data channel status
  DataChannelOK = 21
  DataChannelNoSignal = 22
  DataChannelNotStarted = 23
  DataChannelNoCapture = 24

  // Watchdog connection
  WDConnectionDown = 25
  WDConnectionUp = 26

  // Additional dvr core states
  DvrSecurityFailure = 27
  DvrOtherInitFailure = 28

  // Archiving failures
  DvrArchiveFailed = 29
  DvrMapNetworkDriveFailed = 30

  // Insuficient disk space
  DvrInsufficientDiskSpace = 31

  // NAS failures
  DvrNASDiskConnectionLostFailure = 32
  DvrNASDiskInitializationFailure = 33

  // Database events
  SMServerDBConnectionLost = 34
  SMServerDBConnectionRestored = 35
  SMServerAuditTrailCacheFull = 36

  // Temperature events
  DvrTemperatureLpcOk = 37
  DvrTemperatureLpcWarning = 38
  DvrTemperatureLpcFailure = 39
  DvrTemperatureCpuOk = 40
  DvrTemperatureCpuWarning = 41
  DvrTemperatureCpuFailure = 42
  DvrTemperatureHddOk = 43
  DvrTemperatureHddWarning = 44
  DvrTemperatureHddFailure = 45
  DvrTemperatureDisplayAdapterOk = 46
  DvrTemperatureDisplayAdapterWarning = 47
  DvrTemperatureDisplayAdapterFailure = 48
  DvrTemperaturePsuOk = 49
  DvrTemperaturePsuWarning = 50
  DvrTemperaturePsuFailure = 51
  DvrTemperatureAcpiOk = 52
  DvrTemperatureAcpiWarning = 53
  DvrTemperatureAcpiFailure = 54
  DvrTemperatureRamOk = 55
  DvrTemperatureRamWarning = 56
  DvrTemperatureRamFailure = 57

  DvrMetadataDatabaseConnectionError = 58

  GatewayUp = 59
  GatewayDown = 60

  DvrFatalRuntimeError = 61

  SMSServerUp = 62
  SMSServerDown = 63
  
  LicenseIsAboutToExpire = 64
  LicenseHasExpired = 65
  
  AutomaticBackupFailed = 66
  -->