From ee77153913f178ec7a4cfed2d325d7d51dfb6fb8 Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Wed, 4 Dec 2024 19:48:33 +0100 Subject: [PATCH 1/5] Issue #129: Rename sql type to internalDbQuery * Renamed localSql to internalDbQuery * Fixed dead links and missing sections. --- src/site/markdown/develop/computes/add.md | 2 +- src/site/markdown/develop/computes/and.md | 2 +- src/site/markdown/develop/computes/append.md | 2 +- .../develop/computes/array-translate.md | 2 +- src/site/markdown/develop/computes/awk.md | 2 +- src/site/markdown/develop/computes/convert.md | 2 +- src/site/markdown/develop/computes/divide.md | 2 +- .../develop/computes/duplicate-column.md | 2 +- .../computes/exclude-matching-lines.md | 2 +- .../develop/computes/extract-wbem-property.md | 2 +- src/site/markdown/develop/computes/extract.md | 2 +- src/site/markdown/develop/computes/index.md | 2 +- .../markdown/develop/computes/json2csv.md | 2 +- .../markdown/develop/computes/keep-columns.md | 2 +- .../computes/keep-only-matching-lines.md | 2 +- .../markdown/develop/computes/multiply.md | 2 +- src/site/markdown/develop/computes/prepend.md | 2 +- src/site/markdown/develop/computes/replace.md | 2 +- .../markdown/develop/computes/substring.md | 2 +- .../markdown/develop/computes/subtract.md | 2 +- .../develop/computes/translate-per-bit.md | 2 +- .../markdown/develop/computes/translate.md | 2 +- src/site/markdown/develop/computes/xml2csv.md | 2 +- src/site/markdown/develop/connector.md | 6 ++-- .../develop/detection/command-line.md | 4 +-- src/site/markdown/develop/references.md | 4 +-- .../markdown/develop/sources/after-all.md | 18 +++++++++++ .../markdown/develop/sources/before-all.md | 18 +++++++++++ .../markdown/develop/sources/command-line.md | 4 +-- src/site/markdown/develop/sources/copy.md | 2 +- src/site/markdown/develop/sources/http.md | 2 +- src/site/markdown/develop/sources/index.md | 14 +++++++-- .../develop/sources/internaldb-query.md | 30 +++++++++++++++++++ src/site/markdown/develop/sources/ipmi.md | 2 +- .../markdown/develop/sources/local-sql.md | 28 ----------------- src/site/markdown/develop/sources/pre.md | 18 ----------- src/site/markdown/develop/sources/snmp-get.md | 2 +- .../markdown/develop/sources/snmp-table.md | 2 +- src/site/markdown/develop/sources/static.md | 2 +- .../markdown/develop/sources/table-join.md | 2 +- .../markdown/develop/sources/table-union.md | 2 +- src/site/markdown/develop/sources/wbem.md | 2 +- src/site/markdown/develop/sources/wmi.md | 2 +- src/site/site.xml | 5 ++-- 44 files changed, 122 insertions(+), 93 deletions(-) create mode 100644 src/site/markdown/develop/sources/after-all.md create mode 100644 src/site/markdown/develop/sources/before-all.md create mode 100644 src/site/markdown/develop/sources/internaldb-query.md delete mode 100644 src/site/markdown/develop/sources/local-sql.md delete mode 100644 src/site/markdown/develop/sources/pre.md diff --git a/src/site/markdown/develop/computes/add.md b/src/site/markdown/develop/computes/add.md index 53e1f28..70d1c46 100644 --- a/src/site/markdown/develop/computes/add.md +++ b/src/site/markdown/develop/computes/add.md @@ -9,7 +9,7 @@ The `value` can be a number, or a reference to another column of the same table, ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/and.md b/src/site/markdown/develop/computes/and.md index 8c5510f..5d818f1 100644 --- a/src/site/markdown/develop/computes/and.md +++ b/src/site/markdown/develop/computes/and.md @@ -10,7 +10,7 @@ The `value` can be a number, or a reference to another column of the same table, ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/append.md b/src/site/markdown/develop/computes/append.md index 0e98aa3..673d382 100644 --- a/src/site/markdown/develop/computes/append.md +++ b/src/site/markdown/develop/computes/append.md @@ -10,7 +10,7 @@ Since the data is converted from a CSV to a Table, you can add columns by adding ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/array-translate.md b/src/site/markdown/develop/computes/array-translate.md index ad44743..d5ef548 100644 --- a/src/site/markdown/develop/computes/array-translate.md +++ b/src/site/markdown/develop/computes/array-translate.md @@ -12,7 +12,7 @@ The `resultSeparator` value can be used to define how to separate the values aft ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/awk.md b/src/site/markdown/develop/computes/awk.md index 6376267..e9433a3 100644 --- a/src/site/markdown/develop/computes/awk.md +++ b/src/site/markdown/develop/computes/awk.md @@ -15,7 +15,7 @@ Eg: ```yaml script: ${esc.d}{file::my-script.awk}``` for a script named `my-scri ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/convert.md b/src/site/markdown/develop/computes/convert.md index 8be8465..8d6cfdf 100644 --- a/src/site/markdown/develop/computes/convert.md +++ b/src/site/markdown/develop/computes/convert.md @@ -8,7 +8,7 @@ The `convert` compute allows make to convert a column from a hexadecimal value t ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/divide.md b/src/site/markdown/develop/computes/divide.md index ae193b4..0934597 100644 --- a/src/site/markdown/develop/computes/divide.md +++ b/src/site/markdown/develop/computes/divide.md @@ -9,7 +9,7 @@ The `value` can be a number other than '0', or a reference to another column of ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/duplicate-column.md b/src/site/markdown/develop/computes/duplicate-column.md index 07130d5..b8f4d4a 100644 --- a/src/site/markdown/develop/computes/duplicate-column.md +++ b/src/site/markdown/develop/computes/duplicate-column.md @@ -8,7 +8,7 @@ The `duplicateColumn` compute allows to duplicate a column. The added column wil ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/exclude-matching-lines.md b/src/site/markdown/develop/computes/exclude-matching-lines.md index 2de8dd5..daef255 100644 --- a/src/site/markdown/develop/computes/exclude-matching-lines.md +++ b/src/site/markdown/develop/computes/exclude-matching-lines.md @@ -8,7 +8,7 @@ The `excludeMatchingLines` compute allows to remove the lines of your table wher ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/extract-wbem-property.md b/src/site/markdown/develop/computes/extract-wbem-property.md index edfa4d6..889c01d 100644 --- a/src/site/markdown/develop/computes/extract-wbem-property.md +++ b/src/site/markdown/develop/computes/extract-wbem-property.md @@ -8,7 +8,7 @@ The `ExtractPropertyFromWbemPath` compute allows to extract the specified proper ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/extract.md b/src/site/markdown/develop/computes/extract.md index b79fe60..fb5136c 100644 --- a/src/site/markdown/develop/computes/extract.md +++ b/src/site/markdown/develop/computes/extract.md @@ -9,7 +9,7 @@ The `subSeparators` value is used to split the original column into an array and ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/index.md b/src/site/markdown/develop/computes/index.md index 875d106..a174cc6 100644 --- a/src/site/markdown/develop/computes/index.md +++ b/src/site/markdown/develop/computes/index.md @@ -12,7 +12,7 @@ This page describes all the compute formats support by the connector. ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/json2csv.md b/src/site/markdown/develop/computes/json2csv.md index 7a7d261..4413d64 100644 --- a/src/site/markdown/develop/computes/json2csv.md +++ b/src/site/markdown/develop/computes/json2csv.md @@ -10,7 +10,7 @@ The `properties` value is the list of strings specifying the properties of the e ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/keep-columns.md b/src/site/markdown/develop/computes/keep-columns.md index 82d1aad..2ee5386 100644 --- a/src/site/markdown/develop/computes/keep-columns.md +++ b/src/site/markdown/develop/computes/keep-columns.md @@ -8,7 +8,7 @@ The `keepColumns` compute allows to keep only the selected columns from a table. ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/keep-only-matching-lines.md b/src/site/markdown/develop/computes/keep-only-matching-lines.md index 6e6af43..0883a19 100644 --- a/src/site/markdown/develop/computes/keep-only-matching-lines.md +++ b/src/site/markdown/develop/computes/keep-only-matching-lines.md @@ -8,7 +8,7 @@ The `KeepOnlyMatchingLines` compute allows to keep only the lines of your table ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/multiply.md b/src/site/markdown/develop/computes/multiply.md index f462c0b..d1907a5 100644 --- a/src/site/markdown/develop/computes/multiply.md +++ b/src/site/markdown/develop/computes/multiply.md @@ -9,7 +9,7 @@ The `value` can be a number, or a reference to another column of the same table, ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/prepend.md b/src/site/markdown/develop/computes/prepend.md index 731842a..e5ec8a6 100644 --- a/src/site/markdown/develop/computes/prepend.md +++ b/src/site/markdown/develop/computes/prepend.md @@ -10,7 +10,7 @@ Since the data is converted from a CSV to a Table, you can add columns by adding ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/replace.md b/src/site/markdown/develop/computes/replace.md index 99c4801..ee57ad8 100644 --- a/src/site/markdown/develop/computes/replace.md +++ b/src/site/markdown/develop/computes/replace.md @@ -8,7 +8,7 @@ The `Replace` compute allows to replace a specific value in a column by another ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/substring.md b/src/site/markdown/develop/computes/substring.md index 5a7b6b2..6b1d47c 100644 --- a/src/site/markdown/develop/computes/substring.md +++ b/src/site/markdown/develop/computes/substring.md @@ -8,7 +8,7 @@ The `Substring` compute allows to extract a String from a column. ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/subtract.md b/src/site/markdown/develop/computes/subtract.md index 4d872ee..a1d5b36 100644 --- a/src/site/markdown/develop/computes/subtract.md +++ b/src/site/markdown/develop/computes/subtract.md @@ -9,7 +9,7 @@ The `value` can be a number, or a reference to another column of the same table, ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/translate-per-bit.md b/src/site/markdown/develop/computes/translate-per-bit.md index a82e00e..7b4f784 100644 --- a/src/site/markdown/develop/computes/translate-per-bit.md +++ b/src/site/markdown/develop/computes/translate-per-bit.md @@ -9,7 +9,7 @@ The `BitList` is the list of bits to be taken into account. ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/translate.md b/src/site/markdown/develop/computes/translate.md index 040de48..12347a1 100644 --- a/src/site/markdown/develop/computes/translate.md +++ b/src/site/markdown/develop/computes/translate.md @@ -8,7 +8,7 @@ The `Translate` compute allows to translate values from specified column followi ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/computes/xml2csv.md b/src/site/markdown/develop/computes/xml2csv.md index edfff21..5ddc1ef 100644 --- a/src/site/markdown/develop/computes/xml2csv.md +++ b/src/site/markdown/develop/computes/xml2csv.md @@ -8,7 +8,7 @@ The `xml2Csv` compute allows to convert a XML source to a character-separated ta ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/connector.md b/src/site/markdown/develop/connector.md index 2afe999..9f4aac5 100644 --- a/src/site/markdown/develop/connector.md +++ b/src/site/markdown/develop/connector.md @@ -133,7 +133,7 @@ connector: keep: # | possible values: [ vms, osf1, hp, rs6000, linux, oob, nt, network, storage, solaris, sunos ] exclude: # | possible values: [ vms, osf1, hp, rs6000, linux, oob, nt, network, storage, solaris, sunos ] # OsCommand criterion - - type: osCommand + - type: commandLine commandLine: # errorMessage: # expectedResult: # @@ -199,7 +199,7 @@ metrics: constants: # : # -pre: # +beforeAll: # : # monitors: @@ -232,7 +232,7 @@ monitors: computes: # # OsCommand Source : # - type: osCommand + type: commandLine commandLine: # timeout: # executeLocally: # diff --git a/src/site/markdown/develop/detection/command-line.md b/src/site/markdown/develop/detection/command-line.md index c78d4bc..9d400d0 100644 --- a/src/site/markdown/develop/detection/command-line.md +++ b/src/site/markdown/develop/detection/command-line.md @@ -11,7 +11,7 @@ connector: detection: # # ... criteria: # - - type: osCommand + - type: commandLine commandLine: # errorMessage: # expectedResult: # @@ -35,7 +35,7 @@ connector: connector: detection: criteria: - - type: osCommand + - type: commandLine commandLine: naviseccli -help expectedResult: Navisphere executeLocally: true diff --git a/src/site/markdown/develop/references.md b/src/site/markdown/develop/references.md index 4c51fcf..d414ff6 100644 --- a/src/site/markdown/develop/references.md +++ b/src/site/markdown/develop/references.md @@ -86,7 +86,7 @@ ${esc.d}{file::} ```yaml criteria: - - type: osCommand + - type: commandLine commandLine: /bin/sh ${esc.d}{file::storman-drives.sh} expectedResult: Hard drive errorMessage: No Adaptec Controller with Physical Disks attached or not enough rights to execute arcconf. @@ -108,7 +108,7 @@ ${esc.d}{attribute::} type: monoInstance sources: source(1): - type: osCommand + type: commandLine commandLine: /bin/sh ${esc.d}{file::script.sh} ${esc.d}{attribute::id} keep: ^MSHW; separators: ; diff --git a/src/site/markdown/develop/sources/after-all.md b/src/site/markdown/develop/sources/after-all.md new file mode 100644 index 0000000..ce85ac9 --- /dev/null +++ b/src/site/markdown/develop/sources/after-all.md @@ -0,0 +1,18 @@ +keywords: develop, connector, afterAll +description: This page defines sources that need to be executed after the monitoring jobs (discovery, collect and simple). + +# *AfterAll* Sources + +This page outlines the sources which are executed after each monitoring job, including discovery, collect, and simple jobs. These sources play a crucial role in finalizing processes, such as closing sessions, cleaning up temporary resources, or performing other post-monitoring activities. + +## Format + +```yaml +connector: + # ... + +afterAll: + : # +``` + +Each source format is defined in the [Sources Section](index.md) Section page. diff --git a/src/site/markdown/develop/sources/before-all.md b/src/site/markdown/develop/sources/before-all.md new file mode 100644 index 0000000..09bc598 --- /dev/null +++ b/src/site/markdown/develop/sources/before-all.md @@ -0,0 +1,18 @@ +keywords: develop, connector, beforeAll +description: This page defines sources that need to be executed before each monitoring job (discovery, collect and simple). + +# *BeforeAll* Sources + +This page describes the *BeforeAll* sources, which are executed prior to each monitoring job, including discovery, collection, and simple jobs. These preliminary sources are essential for setting up the connections or performing preparatory actions. They can also be referenced by other sources within a monitoring job. + +## Format + +```yaml +connector: + # ... + +beforeAll: + : # +``` + +Each source format is defined in the [Sources Section](index.md) Section page. diff --git a/src/site/markdown/develop/sources/command-line.md b/src/site/markdown/develop/sources/command-line.md index 2869a30..0129cb6 100644 --- a/src/site/markdown/develop/sources/command-line.md +++ b/src/site/markdown/develop/sources/command-line.md @@ -6,7 +6,7 @@ description: The "osCommand" source executes the specified command and allows th ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: @@ -14,7 +14,7 @@ monitors: : # sources: # : - type: osCommand + type: commandLine commandLine: # timeout: # executeLocally: # diff --git a/src/site/markdown/develop/sources/copy.md b/src/site/markdown/develop/sources/copy.md index 4a0dfb1..41b9824 100644 --- a/src/site/markdown/develop/sources/copy.md +++ b/src/site/markdown/develop/sources/copy.md @@ -6,7 +6,7 @@ description: To duplicate the content of a source in MetricsHub, use the "copy" ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/http.md b/src/site/markdown/develop/sources/http.md index 50a3346..8beec17 100644 --- a/src/site/markdown/develop/sources/http.md +++ b/src/site/markdown/develop/sources/http.md @@ -6,7 +6,7 @@ description: The HTTP source queries any resource available through HTTP or HTTP ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/index.md b/src/site/markdown/develop/sources/index.md index e854e66..1459f37 100644 --- a/src/site/markdown/develop/sources/index.md +++ b/src/site/markdown/develop/sources/index.md @@ -9,12 +9,16 @@ In a MetricsHub connector, the sources describe how to query the monitored syste ## Format -Sources can be specified either under the `pre` section or within the monitoring *\* section (e.g., `discovery`, `collect`, or `simple`): +Sources can be defined in one of three locations, depending on when they need to be executed: + +- **beforeAll Section**: Sources specified here are executed before any monitoring job begins, setting up the connections or performing preparatory actions needed for subsequent tasks. +- **afterAll Section**: Sources defined here are executed after all monitoring jobs are completed, typically used for cleanup, session termination, or post-processing. +- **Monitoring Job Section**: Sources included directly within a specific monitoring `` (e.g., `discovery`, `collect`, or `simple`) are executed as part of that job's workflow, tailored to the specific requirements of the job. ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: @@ -22,6 +26,10 @@ monitors: : # sources: # : # + +afterAll: # + : # + ``` -Under each source we can define a set of computes. Refer to the [Computes Section](develop/computes.md) page for more details. +Under each source we can define a set of computes. Refer to the [Computes Section](../computes/index.md) page for more details. diff --git a/src/site/markdown/develop/sources/internaldb-query.md b/src/site/markdown/develop/sources/internaldb-query.md new file mode 100644 index 0000000..cb59f46 --- /dev/null +++ b/src/site/markdown/develop/sources/internaldb-query.md @@ -0,0 +1,30 @@ +keywords: sql, h2, database +description: The Internal DB Query source allows to perform database queries using MetricsHub's internal database engine. + +# Internal DB Query Source + +The *Internal DB Query* source enables the execution of SQL queries using **MetricsHub**'s internal database engine, powered by H2. This source is particularly useful for accessing and manipulating data within MetricsHub's internal database to facilitate custom monitoring jobs. + +```yaml +connector: + # ... +beforeAll: # + : # + +monitors: + : # + : # + sources: # + : + type: interalDbQuery + tables: + - source: + alias: + columns: + - name: + number: + type: + query: + computes: +``` + diff --git a/src/site/markdown/develop/sources/ipmi.md b/src/site/markdown/develop/sources/ipmi.md index cfe8452..4caed09 100644 --- a/src/site/markdown/develop/sources/ipmi.md +++ b/src/site/markdown/develop/sources/ipmi.md @@ -6,7 +6,7 @@ decription: The IPMI source connects to a Baseboard Management Controller (BMC) ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/local-sql.md b/src/site/markdown/develop/sources/local-sql.md deleted file mode 100644 index a169522..0000000 --- a/src/site/markdown/develop/sources/local-sql.md +++ /dev/null @@ -1,28 +0,0 @@ -keywords: sql, h2, database -description: The Local SQL source allows to perform SQL queries on other Sources. - -# Local SQL Source - -```yaml -connector: - # ... -pre: # - : # - -monitors: - : # - : # - sources: # - : - type: localSql - tables: - - source: - alias: - columns: - - name: - number: - type: - query: - computes: -``` - diff --git a/src/site/markdown/develop/sources/pre.md b/src/site/markdown/develop/sources/pre.md deleted file mode 100644 index 7d15dba..0000000 --- a/src/site/markdown/develop/sources/pre.md +++ /dev/null @@ -1,18 +0,0 @@ -keywords: develop, connector, pre, presources -description:This page define sources that need to be executed before each monitoring job (discovery, multiCollect, …). - -# *Pre* Sources - -This page outlines the sources that must be run prior to each monitoring job (such as discovery, collect, simple etc.). These preliminary sources can be referenced in other sources within a monitoring job. - -## Format - -```yaml -connector: - # ... - -pre: - : # -``` - -Each source format is defined in the [Sources Section](sources.md) Section page. diff --git a/src/site/markdown/develop/sources/snmp-get.md b/src/site/markdown/develop/sources/snmp-get.md index 593f028..3ffb41e 100644 --- a/src/site/markdown/develop/sources/snmp-get.md +++ b/src/site/markdown/develop/sources/snmp-get.md @@ -6,7 +6,7 @@ description: The "snmpGet" source polls the specified SNMP OID with MetricsHub. ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/snmp-table.md b/src/site/markdown/develop/sources/snmp-table.md index badd823..b88e4b8 100644 --- a/src/site/markdown/develop/sources/snmp-table.md +++ b/src/site/markdown/develop/sources/snmp-table.md @@ -6,7 +6,7 @@ description: The "snmpTable" source type polls an entire table from an SNMP agen ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/static.md b/src/site/markdown/develop/sources/static.md index 3c3225d..8dd26d6 100644 --- a/src/site/markdown/develop/sources/static.md +++ b/src/site/markdown/develop/sources/static.md @@ -6,7 +6,7 @@ description: To specify hard-coded content as a source for MetricsHub, use sourc ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/table-join.md b/src/site/markdown/develop/sources/table-join.md index ef08229..3a962c8 100644 --- a/src/site/markdown/develop/sources/table-join.md +++ b/src/site/markdown/develop/sources/table-join.md @@ -6,7 +6,7 @@ description: Use the "tableJoin" source type to mix and match 2 sources like a J ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/table-union.md b/src/site/markdown/develop/sources/table-union.md index ac04622..d5dc579 100644 --- a/src/site/markdown/develop/sources/table-union.md +++ b/src/site/markdown/develop/sources/table-union.md @@ -6,7 +6,7 @@ description: Several tables can be concatenated together with the "tableUnion" s ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/wbem.md b/src/site/markdown/develop/sources/wbem.md index 927cb75..30f2847 100644 --- a/src/site/markdown/develop/sources/wbem.md +++ b/src/site/markdown/develop/sources/wbem.md @@ -6,7 +6,7 @@ description: Use the "WBEM" source type to query a WBEM or CIM Agent in MetricsH ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/markdown/develop/sources/wmi.md b/src/site/markdown/develop/sources/wmi.md index 67494ab..b4d2d64 100644 --- a/src/site/markdown/develop/sources/wmi.md +++ b/src/site/markdown/develop/sources/wmi.md @@ -6,7 +6,7 @@ description: The "WMI" source type queries the WINMGMT service on a Windows syst ```yaml connector: # ... -pre: # +beforeAll: # : # monitors: diff --git a/src/site/site.xml b/src/site/site.xml index 844fe20..ebe8139 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -109,8 +109,9 @@ - - + + + From 7e8bf035dc539e1ba8e72ed4df00839639dffb62 Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Wed, 4 Dec 2024 19:53:21 +0100 Subject: [PATCH 2/5] Issue #129: Rename sql type to internalDbQuery * Fixed keywords. --- src/site/markdown/develop/sources/internaldb-query.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/markdown/develop/sources/internaldb-query.md b/src/site/markdown/develop/sources/internaldb-query.md index cb59f46..18d98aa 100644 --- a/src/site/markdown/develop/sources/internaldb-query.md +++ b/src/site/markdown/develop/sources/internaldb-query.md @@ -1,4 +1,4 @@ -keywords: sql, h2, database +keywords: internal, database, query, h2 description: The Internal DB Query source allows to perform database queries using MetricsHub's internal database engine. # Internal DB Query Source From bd4edfe0cefb107e24dbdfef578cee03d92ae6f1 Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Thu, 5 Dec 2024 12:30:09 +0100 Subject: [PATCH 3/5] Issue #129: Rename sql type to internalDbQuery * Fixed keywords * Added sql criterion and source --- src/site/markdown/develop/computes/append.md | 2 +- src/site/markdown/develop/computes/index.md | 2 +- src/site/markdown/develop/connector.md | 2 +- .../develop/detection/command-line.md | 2 +- .../develop/detection/engine-requirements.md | 2 +- src/site/markdown/develop/detection/http.md | 2 +- src/site/markdown/develop/detection/index.md | 2 +- src/site/markdown/develop/detection/ipmi.md | 2 +- .../markdown/develop/detection/process.md | 2 +- .../develop/detection/resource-type.md | 2 +- .../markdown/develop/detection/service.md | 2 +- .../markdown/develop/detection/snmp-get.md | 2 +- .../develop/detection/snmp-getnext.md | 2 +- src/site/markdown/develop/detection/sql.md | 38 +++++++++++++++++++ src/site/markdown/develop/detection/wbem.md | 2 +- src/site/markdown/develop/detection/wmi.md | 2 +- src/site/markdown/develop/references.md | 2 +- .../markdown/develop/sources/command-line.md | 2 +- ...ternaldb-query.md => internal-db-query.md} | 0 src/site/markdown/develop/sources/sql.md | 28 ++++++++++++++ src/site/site.xml | 8 ++-- 21 files changed, 88 insertions(+), 20 deletions(-) create mode 100644 src/site/markdown/develop/detection/sql.md rename src/site/markdown/develop/sources/{internaldb-query.md => internal-db-query.md} (100%) create mode 100644 src/site/markdown/develop/sources/sql.md diff --git a/src/site/markdown/develop/computes/append.md b/src/site/markdown/develop/computes/append.md index 673d382..de4a7cf 100644 --- a/src/site/markdown/develop/computes/append.md +++ b/src/site/markdown/develop/computes/append.md @@ -1,7 +1,7 @@ keywords: append, string, concat, right description: Use the "append" compute operation to append a specified string to a source. -# `append` (Append) +# `append` The `Append` compute allow to concatenate a value at the end of all the lines in a selected column. The `value` can be a number, or a reference to another column of the same table, using the '$' character followed by the column number. diff --git a/src/site/markdown/develop/computes/index.md b/src/site/markdown/develop/computes/index.md index a174cc6..68f40e9 100644 --- a/src/site/markdown/develop/computes/index.md +++ b/src/site/markdown/develop/computes/index.md @@ -1,4 +1,4 @@ -keywords: develop, connector, compute +keywords: develop, compute description: This page describes all the compute formats support by the connector # Computes diff --git a/src/site/markdown/develop/connector.md b/src/site/markdown/develop/connector.md index 9f4aac5..4c3d310 100644 --- a/src/site/markdown/develop/connector.md +++ b/src/site/markdown/develop/connector.md @@ -1,4 +1,4 @@ -keywords: develop, connector +keywords: develop description: The intended audience of this guide is the advanced user of MetricsHub, who feels confident enough to dig into the depth of connector development. # Connector diff --git a/src/site/markdown/develop/detection/command-line.md b/src/site/markdown/develop/detection/command-line.md index 9d400d0..962487a 100644 --- a/src/site/markdown/develop/detection/command-line.md +++ b/src/site/markdown/develop/detection/command-line.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. ## Command Line (Detection) diff --git a/src/site/markdown/develop/detection/engine-requirements.md b/src/site/markdown/develop/detection/engine-requirements.md index 7273e28..b46acab 100644 --- a/src/site/markdown/develop/detection/engine-requirements.md +++ b/src/site/markdown/develop/detection/engine-requirements.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # Product Requirements (Detection) diff --git a/src/site/markdown/develop/detection/http.md b/src/site/markdown/develop/detection/http.md index 5e24a70..7db7372 100644 --- a/src/site/markdown/develop/detection/http.md +++ b/src/site/markdown/develop/detection/http.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # HTTP (Detection) diff --git a/src/site/markdown/develop/detection/index.md b/src/site/markdown/develop/detection/index.md index d5c543b..41fefef 100644 --- a/src/site/markdown/develop/detection/index.md +++ b/src/site/markdown/develop/detection/index.md @@ -1,4 +1,4 @@ -keywords: develop, connector, detection +keywords: develop, detection description: This page defines the connector’s detection section. # Detection diff --git a/src/site/markdown/develop/detection/ipmi.md b/src/site/markdown/develop/detection/ipmi.md index 8fa8ade..4aedd5e 100644 --- a/src/site/markdown/develop/detection/ipmi.md +++ b/src/site/markdown/develop/detection/ipmi.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. ## IPMI (Detection) diff --git a/src/site/markdown/develop/detection/process.md b/src/site/markdown/develop/detection/process.md index 17576e9..478c5e5 100644 --- a/src/site/markdown/develop/detection/process.md +++ b/src/site/markdown/develop/detection/process.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. ## Process (Detection) diff --git a/src/site/markdown/develop/detection/resource-type.md b/src/site/markdown/develop/detection/resource-type.md index 4ec506f..41b3fb9 100644 --- a/src/site/markdown/develop/detection/resource-type.md +++ b/src/site/markdown/develop/detection/resource-type.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # Device Type (Detection) diff --git a/src/site/markdown/develop/detection/service.md b/src/site/markdown/develop/detection/service.md index 5bc111b..ae5da9e 100644 --- a/src/site/markdown/develop/detection/service.md +++ b/src/site/markdown/develop/detection/service.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # Service (Detection) diff --git a/src/site/markdown/develop/detection/snmp-get.md b/src/site/markdown/develop/detection/snmp-get.md index 8f4362a..3f51c23 100644 --- a/src/site/markdown/develop/detection/snmp-get.md +++ b/src/site/markdown/develop/detection/snmp-get.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # SNMP Get (Detection) diff --git a/src/site/markdown/develop/detection/snmp-getnext.md b/src/site/markdown/develop/detection/snmp-getnext.md index 0dd20c9..42f9f8d 100644 --- a/src/site/markdown/develop/detection/snmp-getnext.md +++ b/src/site/markdown/develop/detection/snmp-getnext.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # SNMP GetNext (Detection) diff --git a/src/site/markdown/develop/detection/sql.md b/src/site/markdown/develop/detection/sql.md new file mode 100644 index 0000000..5ea9ae3 --- /dev/null +++ b/src/site/markdown/develop/detection/sql.md @@ -0,0 +1,38 @@ +keywords: develop, sql, criteria +description: This page defines the detection’s criteria that are defined in a connector. + +# SQL (Detection) + +The goal of this part is to see how to define SQL criteria. + +```yaml +connector: + # ... + detection: # + # ... + criteria: # + - type: sql + query: # + expectedResult: # + errorMessage: # +``` + +## Input Properties + +| Input Property | Description | +| ---------------- | ------------------------------------------------------------------------ | +| `query` | SQL query to be executed | +| `expectedResult` | Regular expression that is expected to match the result of the SQL query | +| `errorMessage` | The message to display if the detection criterion fails | + +### Example + +```yaml +connector: + detection: + criteria: + - type: sql + query: SELECT @@version_comment REGEXP 'mysql' AS is_mysql; + expectedResult: 1 + errorMessage: Not a MySQL Server +``` diff --git a/src/site/markdown/develop/detection/wbem.md b/src/site/markdown/develop/detection/wbem.md index ff4bf42..a0823c6 100644 --- a/src/site/markdown/develop/detection/wbem.md +++ b/src/site/markdown/develop/detection/wbem.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # WBEM (Detection) diff --git a/src/site/markdown/develop/detection/wmi.md b/src/site/markdown/develop/detection/wmi.md index 0592fe2..56eb635 100644 --- a/src/site/markdown/develop/detection/wmi.md +++ b/src/site/markdown/develop/detection/wmi.md @@ -1,4 +1,4 @@ -keywords: develop, connector, criteria +keywords: develop, criteria description: This page defines the detection’s criteria that are defined in a connector. # WMI (Detection) diff --git a/src/site/markdown/develop/references.md b/src/site/markdown/develop/references.md index d414ff6..687f50d 100644 --- a/src/site/markdown/develop/references.md +++ b/src/site/markdown/develop/references.md @@ -1,4 +1,4 @@ -keywords: develop, connector, source, reference +keywords: develop, source, reference description: This page shows how to reference connector objects such as sources, entries, columns and files, etc. inside the YAML document. # Connector Object References diff --git a/src/site/markdown/develop/sources/command-line.md b/src/site/markdown/develop/sources/command-line.md index 0129cb6..cffff49 100644 --- a/src/site/markdown/develop/sources/command-line.md +++ b/src/site/markdown/develop/sources/command-line.md @@ -1,5 +1,5 @@ keywords: ssh, bash, shell, command, cli, batch, powershell -description: The "osCommand" source executes the specified command and allows the processing of its output. +description: The "commandLine" source executes the specified command and allows the processing of its output. # Command Line (Source) diff --git a/src/site/markdown/develop/sources/internaldb-query.md b/src/site/markdown/develop/sources/internal-db-query.md similarity index 100% rename from src/site/markdown/develop/sources/internaldb-query.md rename to src/site/markdown/develop/sources/internal-db-query.md diff --git a/src/site/markdown/develop/sources/sql.md b/src/site/markdown/develop/sources/sql.md new file mode 100644 index 0000000..2aef331 --- /dev/null +++ b/src/site/markdown/develop/sources/sql.md @@ -0,0 +1,28 @@ +keywords: sql, database +description: Use the "SQL" source type to query a relational database with an SQL query in MetricsHub. + +# SQL (Source) + +The *SQL* source type in MetricsHub allows you to execute SQL queries against a relational database. + +```yaml +connector: + # ... +pre: # + : # + +monitors: + : # + : # + sources: # + : + type: sql + query: # + forceSerialization: + executeForEachEntryOf: # + source: # + concatMethod: # oneOf [ , ] | possible values for : [ list, json_array, json_array_extended ] + concatStart: # + concatEnd: # + computes: +``` \ No newline at end of file diff --git a/src/site/site.xml b/src/site/site.xml index ebe8139..3bb644c 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -95,6 +95,7 @@ + @@ -109,7 +110,8 @@ - + + @@ -127,10 +129,10 @@ - + - + From c438cf4e95969764430184f4d676d5f63bbd4706 Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Thu, 5 Dec 2024 12:39:23 +0100 Subject: [PATCH 4/5] Issue #129: Rename sql type to internalDbQuery * Working with metricshub-connector-maven-plugin 1.0.07 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4bb5e72..53ee375 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ org.sentrysoftware.maven metricshub-connector-maven-plugin - 1.0.06 + 1.0.07 From 51fc4b6ed11d3e960d5d97d213e8d0857d6a9dcb Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Thu, 5 Dec 2024 13:29:08 +0100 Subject: [PATCH 5/5] Issue #129: Rename sql type to internalDbQuery * Replaced osCommand occurrences with commandLine * Fixed keywords. --- src/site/markdown/develop/connector.md | 6 +++--- src/site/markdown/develop/index.md | 2 +- src/site/markdown/develop/monitors.md | 2 +- src/site/markdown/develop/sources/after-all.md | 2 +- src/site/markdown/develop/sources/before-all.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/site/markdown/develop/connector.md b/src/site/markdown/develop/connector.md index 4c3d310..ae0ae0d 100644 --- a/src/site/markdown/develop/connector.md +++ b/src/site/markdown/develop/connector.md @@ -132,7 +132,7 @@ connector: - type: deviceType keep: # | possible values: [ vms, osf1, hp, rs6000, linux, oob, nt, network, storage, solaris, sunos ] exclude: # | possible values: [ vms, osf1, hp, rs6000, linux, oob, nt, network, storage, solaris, sunos ] - # OsCommand criterion + # CommandLine criterion - type: commandLine commandLine: # errorMessage: # @@ -230,8 +230,8 @@ monitors: type: ipmi forceSerialization: computes: # - # OsCommand Source - : # + # CommandLine Source + : # type: commandLine commandLine: # timeout: # diff --git a/src/site/markdown/develop/index.md b/src/site/markdown/develop/index.md index cbcbb27..ffdc551 100644 --- a/src/site/markdown/develop/index.md +++ b/src/site/markdown/develop/index.md @@ -1,4 +1,4 @@ -keywords: develop, connector, yaml, syntax, community, custom +keywords: develop, yaml, syntax, community, custom description: Master connector creation for MetricsHub. Dive into monitoring, from basic to advanced concepts. Perfect for MetricsHub enthusiasts and community contributors. # Connector Design Guide diff --git a/src/site/markdown/develop/monitors.md b/src/site/markdown/develop/monitors.md index 9be91b8..55ec8b1 100644 --- a/src/site/markdown/develop/monitors.md +++ b/src/site/markdown/develop/monitors.md @@ -1,4 +1,4 @@ -keywords: develop, connector, monitors +keywords: develop, monitors description: This page describes how to specify the monitor to discovery and collect in a connector file. # Monitors diff --git a/src/site/markdown/develop/sources/after-all.md b/src/site/markdown/develop/sources/after-all.md index ce85ac9..87580d8 100644 --- a/src/site/markdown/develop/sources/after-all.md +++ b/src/site/markdown/develop/sources/after-all.md @@ -1,4 +1,4 @@ -keywords: develop, connector, afterAll +keywords: develop, afterAll description: This page defines sources that need to be executed after the monitoring jobs (discovery, collect and simple). # *AfterAll* Sources diff --git a/src/site/markdown/develop/sources/before-all.md b/src/site/markdown/develop/sources/before-all.md index 09bc598..2cc2c46 100644 --- a/src/site/markdown/develop/sources/before-all.md +++ b/src/site/markdown/develop/sources/before-all.md @@ -1,4 +1,4 @@ -keywords: develop, connector, beforeAll +keywords: develop, beforeAll description: This page defines sources that need to be executed before each monitoring job (discovery, collect and simple). # *BeforeAll* Sources