ConsoleDot events integrations with 3rd-party tools (such as Splunk) build together with Notifications.
Currently supported integrations:
- Splunk
- ServiceNow
- podman/docker
- OpenJDK Development Environment
(
java-latest-openjdk-devel
package in Fedora)
Set HTTP Event Collector (HEC) on your (local) Splunk and copy the token. Ensure that the HEC has SSL disabled and that all tokens are enabled.
$ cd splunk-quarkus
$ podman build -f Dockerfile.jvm -t quay.io/cloudservices/eventing-integrations-splunk ..
Note: All integrations are connecting to Kafka defined within ACG_CONFIG
listenting on platform.notifications.tocamel
topic.
Switching between integrations is done through two application properties:
camel.main.javaRoutesIncludePattern
-- selects Camel routes- always include
**/MainRoutes*,**/ErrorHandlingRoutes*
- and then append concrete integration selector (e.g.
,**/Splunk*
)
- always include
integrations.component.name
-- selects messages out of Kafka for this type- ingress route selects messages of Cloud Event type
com.redhat.console.notification.toCamel.<integrations.component.name>
- ingress route selects messages of Cloud Event type
For specific property configuration per integration type see below.
Running within container:
podman run -it -e ACG_CONFIG=/cdapp/devel.json -v devel.json:/cdapp/devel.json quay.io/cloudservices/eventing-integrations-splunk
You might ommit the interative terminal options -it
if you want to have
it running in background (detached).
To run it locally with dev mode execute:
$ cd splunk-quarkus
$ ACG_CONFIG=./devel.json ../mvnw quarkus:dev -Dcamel.main.javaRoutesIncludePattern="**/MainRoutes*,**/ErrorHandlingRoutes*,**/Splunk*" -Dintegrations.component.name=splunk -Dquarkus.kafka.devservices.enabled=false
To run Service Now integration locally with dev mode execute:
$ cd splunk-quarkus
$ ACG_CONFIG=./devel.json ../mvnw quarkus:dev -Dcamel.main.javaRoutesIncludePattern="**/MainRoutes*,**/ErrorHandlingRoutes*,**/ServiceNow*" -Dintegrations.component.name=servicenow -Dquarkus.kafka.devservices.enabled=false
Generate a message on platform.notifications.tocamel
Kafka topic.
Manually this can be achieved for example by producing a message using
kafka-console-producer.sh
tool from Kafka:
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic platform.notifications.tocamel
Here are CloudEvent examples for testing:
Splunk event
{"specversion":"1.0","type":"com.redhat.console.notification.toCamel.splunk","source":"notifications","id":"9dc9a4b1-8868-4afc-a69d-e8723b20452c","time":"2022-02-02T14:09:55.532551Z","rh-account":"12345","data":"{\"notif-metadata\":{\"url\":\"http://localhost:8088\",\"X-Insight-Token\":\"TOKEN\",\"extras\":\"{}\"},\"account_id\":\"12345\",\"org_id\":\"67890\",\"application\":\"advisor\",\"bundle\":\"rhel\",\"context\":{},\"event_type\":\"new-recommendation\",\"timestamp\":\"2022-02-02T14:09:55.344612\",\"events\":[{\"some\":\"eventdata\"}]}"}
ServiceNow event
{"specversion":"1.0","type":"com.redhat.console.notification.toCamel.servicenow","source":"notifications","id":"9dc9a4b1-8868-4afc-a69d-e8723b20452c","time":"2022-02-02T14:09:55.532551Z","rh-account":"12345","data":"{\"notif-metadata\":{\"url\":\"http://localhost:8088\",\"X-Insight-Token\":\"TOKEN\",\"extras\":\"{}\"},\"account_id\":\"12345\",\"org_id\":\"67890\",\"application\":\"advisor\",\"bundle\":\"rhel\",\"context\":{},\"event_type\":\"new-recommendation\",\"timestamp\":\"2022-02-02T14:09:55.344612\",\"events\":[{\"some\":\"eventdata\"}]}"}
(don't forget to replace TOKEN
with your token or password)
Within platform this can be achieved for example using the Drift service:
- registering a system
- creating a baseline out of the registered system
- assigning the system to baseline
- chaning a fact of the baseline (e.g. bios) or changing the system (updating a package)
- running a system check-in from the system
With local dev mode
$ cd splunk-quarkus
$ ACG_CONFIG=./devel.json ../mvnw quarkus:dev -Dquarkus.kafka.devservices.enabled=false
running tests are paused.
You can hit o
to toggle test output and r
key to resume testing and again r
to re-run tests.
Alternatively you can run tests via
$ ACG_CONFIG=./devel.json ../mvnw quarkus:test -Dquarkus.kafka.devservices.enabled=false
and use r
to re-run tests.
It is also possible to run tests one-time
$ ACG_CONFIG=./devel.json ../mvnw test -Dquarkus.kafka.devservices.enabled=false
The best way how to update Java/Quarkus dependencies is to update Quarkus platform version.
The platform version is mapped to a set of dependent packages of Camel provided by a BOM (Bill of Materials)
package io.quarkus.platform:quarkus-camel-bom
(available from quarkusio/quarkus-platform).
See also
- Camel Dependency Management for Quarkus
- Quarkus Platform Guide
- Check version of quarkus.platform.version project property whether it matches
the newest possible version as per quarkus-camel-bom.
- Note: always use
.Final
versions.
- Note: always use
- Increase the minor version of
quarkus.platform.version
project property by one. - Read Quarkus Migration guide for the minor version.
- Compile code with
mvnw clean compile
(from the corresponding directory) and check for errors. - Repeat to increase the minor version up to the highest possible.
- Test the app, e.g. by running
mvnw quarkus:dev
.- Check how to run Splunk Camel