Repository: hyperjumptech/monika (ts)

Issue:
Requests info is empty on non HTTP probe
**Describe the bug**
Requests info is empty on non HTTP probe

**To Reproduce**
Steps to reproduce the behavior:
1. Run a PostgreSQL service. Run `cd dev && docker compose up`
2. Run Monika with the following configuration and use verbose flag. Run `npm start -- --verbose`

```yaml
probes:
  - id: postgres
    interval: 2
    incidentThreshold: 1
    recoveryThreshold: 1
    postgres:
      - uri: postgres://postgres_user:postgres_password@localhost:5432/postgres_db
```

**Expected behavior**
Probe info should be displayed

**Screenshots**
![verbose-mode-with-empty-requests](https://github.com/hyperjumptech/monika/assets/15191978/99c11ed8-8317-422d-81b5-9b5848a91e83)

**Desktop (please complete the following information):**
 - OS: Pop!_OS
 - Version: 22.04


Pull request:
Fixed: Empty Request Info for Non HTTP Probe
# Monika Pull Request (PR)

## What feature/issue does this PR add
Add verbose startup message for non-http probe. It will resolves #1078.

## How did you implement / how did you fix it
Add generateVerboseStartupMessage method in the prober class and implemented it for each prober

## How to test
1. Run local probe target. Run `cd dev && docker compose up`
2. Run Monika in verbose mode with the following configuration. Run `npm start -- --verbose`

```yaml
probes:
  - id: Hyperjump
    requests:
      - url: https://example.com
      - url: https://hyperjump.tech
  - id: mariadb
    interval: 2
    incidentThreshold: 1
    recoveryThreshold: 1
    mariadb:
      - host: localhost
        port: 3306
        username: mariadb_user
        password: mariadb_password
        database:
  - id: mysql
    interval: 2
    incidentThreshold: 1
    recoveryThreshold: 1
    mysql:
      - host: localhost
        port: 3307
        username: mysql_user
        password: mysql_password
        database:
  - id: mongo
    interval: 2
    incidentThreshold: 1
    recoveryThreshold: 1
    mongo:
      - uri: mongodb://mongo_user:mongo_password@localhost:27017
  - id: postgres
    interval: 2
    incidentThreshold: 1
    recoveryThreshold: 1
    postgres:
      - uri: postgres://postgres_user:postgres_password@localhost:5432/postgres_db
  - id: redis
    interval: 2
    incidentThreshold: 1
    recoveryThreshold: 1
    redis:
      - uri: redis://:redis_password@localhost:6379
```

## Screenshot
![image](https://github.com/hyperjumptech/monika/assets/15191978/3adfc3b1-6bda-4e80-8c24-2e32f765e1c5)


Patch:
diff --git a/src/components/logger/startup-message.ts b/src/components/logger/startup-message.ts
index 90ebcf68..be667355 100644
--- a/src/components/logger/startup-message.ts
+++ b/src/components/logger/startup-message.ts
@@ -30,10 +30,10 @@ import type { MonikaFlags } from '../../context/monika-flags'
 import type { Config } from '../../interfaces/config'
 import type { Notification } from '@hyperjumptech/monika-notification'
 import { channels } from '@hyperjumptech/monika-notification'
-import type { Probe, ProbeAlert } from '../../interfaces/probe'
-import type { RequestConfig } from '../../interfaces/request'
+import type { Probe } from '../../interfaces/probe'
 import { log } from '../../utils/pino'
 import { isSymonModeFrom } from '../config'
+import { createProber } from '../probe/prober/factory'
 
 type LogStartupMessage = {
   config: Config
@@ -135,46 +135,18 @@ function generateProbeMessage(probes: Probe[]): string {
   let startupMessage = 'Probes:\n'
 
   for (const probe of probes) {
-    const { alerts, description, id, interval, name, requests } = probe
+    const prober = createProber({
+      probeConfig: probe,
+      counter: 0,
+      notifications: [],
+    })
 
-    startupMessage += `- Probe ID: ${id}
-Name: ${name}
-Description: ${description || '-'}
-Interval: ${interval}
-`
-    startupMessage += `    Requests:\n`
-    startupMessage += generateProbeRequestMessage(requests)
-    startupMessage += generateAlertMessage(alerts)
+    startupMessage += prober.generateVerboseStartupMessage()
   }
 
   return startupMessage
 }
 
-function generateProbeRequestMessage(requests: RequestConfig[]): string {
-  let startupMessage = ''
-
-  for (const request of requests) {
-    const { body, headers, method, url } = request
-
-    startupMessage += `      - Request Method: ${method || `GET`}
-  Request URL: ${url}
-  Request Headers: ${JSON.stringify(headers) || `-`}
-  Request Body: ${JSON.stringify(body) || `-`}
-`
-  }
-
-  return startupMessage
-}
-
-function generateAlertMessage(alerts: ProbeAlert[]): string {
-  const hasAlert = alerts.length > 0
-  const defaultAlertsInString =
-    '[{ "assertion": "response.status < 200 or response.status > 299", "message": "HTTP Status is not 200"}, { "assertion": "response.time > 2000", "message": "Response time is more than 2000ms" }]'
-  const alertsInString = JSON.stringify(alerts)
-
-  return `    Alerts: ${hasAlert ? alertsInString : defaultAlertsInString}\n`
-}
-
 function generateNotificationMessage(notifications: Notification[]): string {
   const hasNotification = notifications.length > 0
 
diff --git a/src/components/probe/prober/factory.ts b/src/components/probe/prober/factory.ts
index 5916cc2a..d4901d61 100644
--- a/src/components/probe/prober/factory.ts
+++ b/src/components/probe/prober/factory.ts
@@ -27,31 +27,57 @@ import { MariaDBProber } from './mariadb'
 import { PostgresProber } from './postgres'
 import { RedisProber } from './redis'
 import { SocketProber } from './socket'
-import type { Prober, ProberMetadata } from '.'
+import { BaseProber, type Prober, type ProberMetadata } from '.'
 
 export function createProbers(probeMetadata: ProberMetadata): Prober[] {
   const { probeConfig } = probeMetadata
   const result: Prober[] = []
 
   if (probeConfig?.mongo) {
-    result.push(new MongoProber(probeMetadata))
+    result.push(createProber(probeMetadata))
   }
 
   if (probeConfig?.mariadb || probeConfig?.mysql) {
-    result.push(new MariaDBProber(probeMetadata))
+    result.push(createProber(probeMetadata))
   }
 
   if (probeConfig?.postgres) {
-    result.push(new PostgresProber(probeMetadata))
+    result.push(createProber(probeMetadata))
   }
 
   if (probeConfig?.redis) {
-    result.push(new RedisProber(probeMetadata))
+    result.push(createProber(probeMetadata))
   }
 
   if (probeConfig?.socket) {
-    result.push(new SocketProber(probeMetadata))
+    result.push(createProber(probeMetadata))
   }
 
   return result
 }
+
+export function createProber(probeMetadata: ProberMetadata): Prober {
+  const { probeConfig } = probeMetadata
+
+  if (probeConfig?.mariadb || probeConfig?.mysql) {
+    return new MariaDBProber(probeMetadata)
+  }
+
+  if (probeConfig?.mongo) {
+    return new MongoProber(probeMetadata)
+  }
+
+  if (probeConfig?.postgres) {
+    return new PostgresProber(probeMetadata)
+  }
+
+  if (probeConfig?.redis) {
+    return new RedisProber(probeMetadata)
+  }
+
+  if (probeConfig?.socket) {
+    return new SocketProber(probeMetadata)
+  }
+
+  return new BaseProber(probeMetadata)
+}
diff --git a/src/components/probe/prober/index.ts b/src/components/probe/prober/index.ts
index bf6f0257..87fa427e 100644
--- a/src/components/probe/prober/index.ts
+++ b/src/components/probe/prober/index.ts
@@ -1,3 +1,27 @@
+/**********************************************************************************
+ * MIT License                                                                    *
+ *                                                                                *
+ * Copyright (c) 2021 Hyperjump Technology                                        *
+ *                                                                                *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy   *
+ * of this software and associated documentation files (the "Software"), to deal  *
+ * in the Software without restriction, including without limitation the rights   *
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell      *
+ * copies of the Software, and to permit persons to whom the Software is          *
+ * furnished to do so, subject to the following conditions:                       *
+ *                                                                                *
+ * The above copyright notice and this permission notice shall be included in all *
+ * copies or substantial portions of the Software.                                *
+ *                                                                                *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR     *
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,       *
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE    *
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER         *
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  *
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  *
+ * SOFTWARE.                                                                      *
+ **********************************************************************************/
+
 import type { Notification } from '@hyperjumptech/monika-notification'
 import { checkThresholdsAndSendAlert } from '..'
 import { getContext } from '../../../context'
@@ -26,6 +50,7 @@ type RespProsessingParams = {
 
 export interface Prober {
   probe: () => Promise<void>
+  generateVerboseStartupMessage: () => string
 }
 
 export type ProberMetadata = {
@@ -49,6 +74,46 @@ export class BaseProber implements Prober {
     this.processProbeResults([])
   }
 
+  generateVerboseStartupMessage(): string {
+    const { description, id, interval, name } = this.probeConfig
+
+    let result = `- Probe ID: ${id}
+  Name: ${name}
+  Description: ${description || '-'}
+  Interval: ${interval}
+`
+    result += '  Requests:\n'
+    result += this.generateProbeRequestMessage()
+    result += this.generateAlertMessage()
+
+    return result
+  }
+
+  private generateProbeRequestMessage(): string {
+    let startupMessage = ''
+
+    for (const request of this.probeConfig.requests || []) {
+      const { body, headers, method, url } = request
+
+      startupMessage += `  - Request Method: ${method || `GET`}
+    Request URL: ${url}
+    Request Headers: ${JSON.stringify(headers) || `-`}
+    Request Body: ${JSON.stringify(body) || `-`}
+`
+    }
+
+    return startupMessage
+  }
+
+  private generateAlertMessage(): string {
+    const hasAlert = this.probeConfig.alerts.length > 0
+    const defaultAlertsInString =
+      '[{ "assertion": "response.status < 200 or response.status > 299", "message": "HTTP Status is not 200"}, { "assertion": "response.time > 2000", "message": "Response time is more than 2000ms" }]'
+    const alertsInString = JSON.stringify(this.probeConfig.alerts)
+
+    return `    Alerts: ${hasAlert ? alertsInString : defaultAlertsInString}\n`
+  }
+
   protected processProbeResults(probeResults: ProbeResult[]): void {
     for (const index of probeResults.keys()) {
       this.responseProcessing({
diff --git a/src/components/probe/prober/mariadb/index.ts b/src/components/probe/prober/mariadb/index.ts
index 84b4ecbe..810d3a55 100644
--- a/src/components/probe/prober/mariadb/index.ts
+++ b/src/components/probe/prober/mariadb/index.ts
@@ -13,6 +13,39 @@ export class MariaDBProber extends BaseProber {
 
     this.processProbeResults(result)
   }
+
+  generateVerboseStartupMessage(): string {
+    const { description, id, interval, name } = this.probeConfig
+
+    let result = `- Probe ID: ${id}
+  Name: ${name}
+  Description: ${description || '-'}
+  Interval: ${interval}
+`
+    result += '  Connection Details:'
+    result += this.getConnectionDetails()
+
+    return result
+  }
+
+  private getConnectionDetails(): string {
+    const connectionDetails = this.probeConfig?.mariadb
+      ? this.probeConfig?.mariadb
+      : this.probeConfig?.mysql
+
+    return (
+      connectionDetails
+        ?.map(
+          (db) => `
+    Host: ${db.host}
+    Port: ${db.port}
+    Database: ${db.database}
+    Username: ${db.username}
+`
+        )
+        .join('\n') || ''
+    )
+  }
 }
 
 type ProbeMariaDBParams = {
diff --git a/src/components/probe/prober/mongo/index.ts b/src/components/probe/prober/mongo/index.ts
index 2256a225..006a12d0 100644
--- a/src/components/probe/prober/mongo/index.ts
+++ b/src/components/probe/prober/mongo/index.ts
@@ -19,6 +19,40 @@ export class MongoProber extends BaseProber {
 
     this.processProbeResults(result)
   }
+
+  generateVerboseStartupMessage(): string {
+    const { description, id, interval, name } = this.probeConfig
+
+    let result = `- Probe ID: ${id}
+  Name: ${name}
+  Description: ${description || '-'}
+  Interval: ${interval}
+`
+    result += '  Connection Details:'
+    result += this.getConnectionDetails()
+
+    return result
+  }
+
+  private getConnectionDetails(): string {
+    return (
+      this.probeConfig.mongo
+        ?.map((db) => {
+          if (db.uri) {
+            return `
+    URI: ${db.uri}
+`
+          }
+
+          return `
+    Host: ${db.host}
+    Port: ${db.port}
+    Username: ${db.username}
+`
+        })
+        .join('\n') || ''
+    )
+  }
 }
 
 type ProbeMongoParams = {
diff --git a/src/components/probe/prober/postgres/index.ts b/src/components/probe/prober/postgres/index.ts
index 78715ab3..22799885 100644
--- a/src/components/probe/prober/postgres/index.ts
+++ b/src/components/probe/prober/postgres/index.ts
@@ -19,6 +19,41 @@ export class PostgresProber extends BaseProber {
 
     this.processProbeResults(result)
   }
+
+  generateVerboseStartupMessage(): string {
+    const { description, id, interval, name } = this.probeConfig
+
+    let result = `- Probe ID: ${id}
+  Name: ${name || '-'}
+  Description: ${description || '-'}
+  Interval: ${interval}
+`
+    result += '  Connection Details:'
+    result += this.getConnectionDetails()
+
+    return result
+  }
+
+  private getConnectionDetails(): string {
+    return (
+      this.probeConfig.postgres
+        ?.map((db) => {
+          if (db.uri) {
+            return `
+    URI: ${db.uri}
+`
+          }
+
+          return `
+    Host: ${db.host}
+    Port: ${db.port}
+    Username: ${db.username}
+    Database: ${db.database}
+`
+        })
+        .join('\n') || ''
+    )
+  }
 }
 
 type ProbePostgresParams = {
diff --git a/src/components/probe/prober/redis/index.ts b/src/components/probe/prober/redis/index.ts
index 0c40fabd..281cd60a 100644
--- a/src/components/probe/prober/redis/index.ts
+++ b/src/components/probe/prober/redis/index.ts
@@ -19,6 +19,40 @@ export class RedisProber extends BaseProber {
 
     this.processProbeResults(result)
   }
+
+  generateVerboseStartupMessage(): string {
+    const { description, id, interval, name } = this.probeConfig
+
+    let result = `- Probe ID: ${id}
+  Name: ${name}
+  Description: ${description || '-'}
+  Interval: ${interval}
+`
+    result += '  Connection Details:'
+    result += this.getConnectionDetails()
+
+    return result
+  }
+
+  private getConnectionDetails(): string {
+    return (
+      this.probeConfig.redis
+        ?.map((db) => {
+          if (db.uri) {
+            return `
+    URI: ${db.uri}
+`
+          }
+
+          return `
+    Host: ${db.host}
+    Port: ${db.port}
+    Username: ${db.username}
+        `
+        })
+        .join('\n') || ''
+    )
+  }
 }
 
 type ProbeRedisParams = {
diff --git a/src/components/probe/prober/socket/index.ts b/src/components/probe/prober/socket/index.ts
index 8922e15a..e70b1686 100644
--- a/src/components/probe/prober/socket/index.ts
+++ b/src/components/probe/prober/socket/index.ts
@@ -18,6 +18,28 @@ export class SocketProber extends BaseProber {
 
     this.processProbeResults(result)
   }
+
+  generateVerboseStartupMessage(): string {
+    const { description, id, interval, name } = this.probeConfig
+
+    let result = `- Probe ID: ${id}
+  Name: ${name}
+  Description: ${description || '-'}
+  Interval: ${interval}
+`
+    result += '  Connection Details:'
+    result += this.getConnectionDetails()
+
+    return result
+  }
+
+  private getConnectionDetails(): string {
+    return `
+    Host: ${this.probeConfig?.socket?.host}
+    Port: ${this.probeConfig?.socket?.port}
+    Username: ${this.probeConfig?.socket?.data}
+`
+  }
 }
 
 type ProbeSocketParams = {


Test patch:
diff --git a/src/components/probe/prober/factory.test.ts b/src/components/probe/prober/factory.test.ts
new file mode 100644
index 00000000..f641957c
--- /dev/null
+++ b/src/components/probe/prober/factory.test.ts
@@ -0,0 +1,286 @@
+/**********************************************************************************
+ * MIT License                                                                    *
+ *                                                                                *
+ * Copyright (c) 2021 Hyperjump Technology                                        *
+ *                                                                                *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy   *
+ * of this software and associated documentation files (the "Software"), to deal  *
+ * in the Software without restriction, including without limitation the rights   *
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell      *
+ * copies of the Software, and to permit persons to whom the Software is          *
+ * furnished to do so, subject to the following conditions:                       *
+ *                                                                                *
+ * The above copyright notice and this permission notice shall be included in all *
+ * copies or substantial portions of the Software.                                *
+ *                                                                                *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR     *
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,       *
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE    *
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER         *
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  *
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  *
+ * SOFTWARE.                                                                      *
+ **********************************************************************************/
+
+import { expect } from 'chai'
+import { Probe } from '../../../interfaces/probe'
+import { createProber } from './factory'
+
+describe('Prober factory', () => {
+  describe('Prober verbose startup message', () => {
+    it('should return MariaDB verbose startup message', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        interval: 1,
+        mariadb: [
+          {
+            host: 'localhost',
+            port: 3306,
+            username: 'mariadb_user',
+            password: 'mariadb_password',
+            database: '',
+          },
+        ],
+      } as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes('localhost')
+      expect(prober.generateVerboseStartupMessage()).includes('3306')
+      expect(prober.generateVerboseStartupMessage()).includes('mariadb_user')
+      expect(prober.generateVerboseStartupMessage()).not.includes(
+        'mariadb_password'
+      )
+    })
+
+    it('should return MongoDB verbose startup message', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        interval: 1,
+        mongo: [
+          {
+            host: 'localhost',
+            password: 'mongo_password',
+            port: '27017',
+            username: 'mongo_user',
+          },
+        ],
+      } as unknown as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes('localhost')
+      expect(prober.generateVerboseStartupMessage()).includes('27017')
+      expect(prober.generateVerboseStartupMessage()).includes('mongo_user')
+      expect(prober.generateVerboseStartupMessage()).not.includes(
+        'mongo_password'
+      )
+    })
+
+    it('should return MongoDB verbose startup message (with uri)', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        interval: 1,
+        mongo: [{ uri: 'mongodb://mongo_user:mongo_password@localhost:27017' }],
+      } as unknown as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes(
+        'mongodb://mongo_user:mongo_password@localhost:27017'
+      )
+    })
+
+    it('should return MySQL verbose startup message', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        description: 'MySQL probe',
+        interval: 1,
+        mariadb: [
+          {
+            host: 'localhost',
+            port: 3306,
+            username: 'mysql_user',
+            password: 'mysql_password',
+            database: '',
+          },
+        ],
+      } as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes('localhost')
+      expect(prober.generateVerboseStartupMessage()).includes('3306')
+      expect(prober.generateVerboseStartupMessage()).includes('mysql_user')
+      expect(prober.generateVerboseStartupMessage()).not.includes(
+        'mysql_password'
+      )
+    })
+
+    it('should return PostgreSQL verbose startup message', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        interval: 1,
+        postgres: [
+          {
+            database: 'postgres_db',
+            host: 'localhost',
+            password: 'postgres_password',
+            port: '5432',
+            username: 'postgres_user',
+          },
+        ],
+      } as unknown as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes('localhost')
+      expect(prober.generateVerboseStartupMessage()).includes('5432')
+      expect(prober.generateVerboseStartupMessage()).includes('postgres_user')
+      expect(prober.generateVerboseStartupMessage()).includes('postgres_db')
+      expect(prober.generateVerboseStartupMessage()).not.includes(
+        'postgres_password'
+      )
+    })
+
+    it('should return PostgreSQL verbose startup message (with uri)', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        description: 'PostgreSQL probe',
+        interval: 1,
+        postgres: [
+          {
+            uri: 'postgres://postgres_user:postgres_password@localhost:5432/postgres_db',
+          },
+        ],
+      } as unknown as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes(
+        'postgres://postgres_user:postgres_password@localhost:5432/postgres_db'
+      )
+    })
+
+    it('should return Redis verbose startup message', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        interval: 1,
+        redis: [
+          {
+            host: 'localhost',
+            password: 'redis_password',
+            port: '6379',
+          },
+        ],
+      } as unknown as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes('localhost')
+      expect(prober.generateVerboseStartupMessage()).includes('6379')
+      expect(prober.generateVerboseStartupMessage()).not.includes(
+        'redis_password'
+      )
+    })
+
+    it('should return Redis verbose startup message (with uri)', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        description: 'Redis probe',
+        interval: 1,
+        redis: [
+          {
+            uri: 'redis://:redis_password@localhost:6379',
+          },
+        ],
+      } as unknown as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes(
+        'redis://:redis_password@localhost:6379'
+      )
+    })
+
+    it('should return socket verbose startup message', () => {
+      // arrange
+      const probe = {
+        id: '1',
+        interval: 1,
+        socket: {
+          host: 'localhost',
+          port: '8080',
+          data: 'some-data',
+        },
+      } as unknown as Probe
+
+      // act
+      const prober = createProber({
+        counter: 0,
+        notifications: [],
+        probeConfig: probe,
+      })
+
+      // assert
+      expect(prober.generateVerboseStartupMessage()).includes('localhost')
+      expect(prober.generateVerboseStartupMessage()).includes('8080')
+    })
+  })
+})