Skip to content

Commit

Permalink
Merge pull request #27 from rchakode/feat/v22.02.0
Browse files Browse the repository at this point in the history
Feat/v22.02.0
  • Loading branch information
rchakode authored Apr 25, 2022
2 parents 30abf8c + 652aefe commit 0e88701
Show file tree
Hide file tree
Showing 43 changed files with 458 additions and 151 deletions.
8 changes: 7 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
generated
.qmake.stash
.vscode/
Makefile
log
realopinsight.pro.user
generated
.idea
30 changes: 30 additions & 0 deletions .github/workflows/build-image-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build image on PR
on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Build and push Docker image
env:
IMAGE_BASENAME: rchakode/realopinsight
REGISTRY_USERNAME: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
run: |
echo "setting build version"
RELEASE_VERSION="$(date +%F)-$(git rev-parse --short HEAD)"
VERSION_FILE=realopinsight.pro
VERSION_LINE=$(grep -n '^PACKAGE_VERSION=' $VERSION_FILE | cut -f1 -d:)
VERSION_ORIG=$(grep '^PACKAGE_VERSION=' $VERSION_FILE | cut -d= -f2)
sed -i "${VERSION_LINE}s/${VERSION_ORIG}/${RELEASE_VERSION}/" $VERSION_FILE
cat $VERSION_FILE
echo "building container image => ${IMAGE_BASENAME}:${RELEASE_VERSION}"
IMAGE_TAGGED_NAME=${IMAGE_BASENAME}:${RELEASE_VERSION}
docker build -t ${IMAGE_TAGGED_NAME} .
docker login --username ${REGISTRY_USERNAME} --password ${REGISTRY_PASSWORD}
docker push $IMAGE_TAGGED_NAME
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.vscode/c_cpp_properties.json
.qmake.stash
.vscode/settings.json
.vscode/
Makefile
log
realopinsight.pro.user
generated
.idea
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/realopinsight.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rchakode/realopinsight:builder-20201008t1602134119 as builder
FROM rchakode/realopinsight-builder:v22.05.00-qt515-wt471 as builder
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
WORKDIR /app
COPY . .
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rabits/qt:5.13-desktop as builder-deps
FROM rabits/qt:5.15-desktop as builder-deps

ENV QT_ROOT /usr
ENV WT_ROOT /usr/local
Expand Down Expand Up @@ -32,7 +32,7 @@ RUN apt update && \

FROM builder-deps as builder
WORKDIR /tmp
RUN WT_VERSION=4.3.1 && \
RUN WT_VERSION=4.7.1 && \
WT_TARBALL=${WT_VERSION}.tar.gz && \
wget https://github.com/emweb/wt/archive/${WT_TARBALL} && \
tar zxf ${WT_TARBALL} && \
Expand Down
113 changes: 33 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,97 +1,50 @@

![](./images/banners/realopinsight-overview-thumbnail.png)


![GPL v3 License](https://img.shields.io/github/license/rchakode/realopinsight.svg?label=License)
[![Calendar Versioning](https://img.shields.io/badge/calver-YY.MM.MICRO-bb8fce.svg)](http://calver.org)
![build](https://github.com/rchakode/realopinsight/workflows/CI/badge.svg)
![Docker pulls](https://img.shields.io/docker/pulls/rchakode/realopinsight.svg?label=Docker%20Pulls)

# Overview
RealOpInsight allows to monitor, measure and observe end-user applications availability atop of Kubernetes®, Zabbix®, Nagios®. It features application-specific knowledges to aggregate and handle the status of low-level probes in a way that is meaningful for any targeted end-user application.
---

- [Overview](#overview)
- [Key Features](#key-features)
- [Quick Start](#quick-start)
- [Deployment on kubernetes](#deployment-on-kubernetes)
- [Deployment on Docker](#deployment-on-docker)
- [Getting Started](#getting-started)
- [Getting Started](#getting-started)
- [License](#license)
- [Contributions](#contributions)
- [Copyrights & License](#copyrights--license)

# Key Features
Fully open source ([GPL v3 Licence](LICENSE)), RealOpinsight features include:
* **Monitor business values, Define & track SLA/SLO targets:** Focus on the applications that underlie your business, set up application-aware notifications, measure, observe and analyze applications availability over time.
* **Federated & unified applications monitoring:** RealOpInsight enables to set up unified applications monitoring views on top of applications and corporate environments that rely on many monitoring systems. Thereby breaking monitoring silos, it boosts the productivity of operations staffs while helping them solving incident with relevant priorities.
* **Relationship mapping & event correlation:** Map relationships among each application components, set up application-specific policies to calculate and propagate the severity of incidents so as to meet your particular incident management needs.
* **Simple and secured integration through API:** Don't waste time on complex or boring configuration tasks, RealOpInsight only requires a read-only access to the API of the monitoring data collection backends (i.e. Kubernetes API, Zabbix API...). It's released as Docker images along with Kubernetes Helm3 manifests to ease its deployment.
* **Tactical Operations Dashboards:** Whether you're an operations staff or executive, RealOpInsight allows to build user-specific tactical dashboards that allow you to have a quick insight on how your applications are operating while be able to have more details in one click.

![](./images/banners/screenshots.png)

# Quick Start
RealOpInsight is released as Docker images along with Kubernetes Helm3 manifests to ease its deployment.

The below sections show how to set an instance of RealOpInsight in a couple of seconds on Kubernetes or on an [OCI](https://opencontainers.org/)-compliant container engine (Docker, Podman, CRI-O, etc).

## Deployment on Kubernetes
Assuming you have a Linux terminal with Helm3 installed and able to access a KUBECONFIG file to deploy resources on Kubernetes, the following command shall install an instance in the `monitoring` namespace. **The namespace must exist**, it can be changed to another value.

```
helm upgrade \
--namespace monitoring \
--install realopinsight \
helm/realopinsight/
```

By default the Helm manifests also deploy a **ClusterIP** service named `realopinsiht` to expose the UI on port `80` and Prometheus metrics on port `4584`. The associated in-cluster URLs are the following:
* UI: `http://realopinsight.monitoring/ui`.
* Prometheus metrics: `http://realopinsight.monitoring:4583/metrics`.
# Overview
RealOpInsight leverages probes status from Kubernetes®, Zabbix® and/or Nagios® to feature upon that application-specific high-level visualization to track the availability of applications over time.

## Remote access to the UI
To get a remote access to the UI, use one of the following options:
* Change the service type to **LoadBalancer** (see [Helm value files](helm/realopinsight/values.yaml));
* Enable an Ingress access (see [Helm value files](helm/realopinsight/values.yaml));
* Enable port-forwarding from your local machine as follows (change the namespace if different).
```
kubectl port-forward \
--namespace monitoring \
service/realopinsight-ui 4583:80
```
Then point your browser at the following address: http://localhost:4583/ui/.
Key features:

## Deployment on Docker
The following command shall pull the image and start an instance of RealOpInsight in background. The `-d` option can be removed to start the instance in foreground.
With this command the data of the instance will be stored locally on the Docker machine at the specified path (value of option `--volume`, can be changed if needed).
* **Monitor business values, Define & track SLA/SLO targets:** Focus on the applications that underlie your business, set up application-aware notifications, measure, observe and analyze applications availability over time. Be able to easily evaluate the real impact of each incident.
* **Federated & unified applications monitoring:** Break silos by setting up unified applications monitoring operations views that hide the underlying monitoring systems while helping you solving incidents with relevant business priorities.
* **Relationship mapping & event correlation:** Map relationships among application components, set up specific business-oriented policies to handle and propagate each incident with appropriate business impact.
* **Simple and secured integration through API:** Don't waste time on complex configuration tasks, just a couple of minute is required to deploy and get started with RealOpInsight.
* **Tactical Operations Dashboards:** For operations staff or executive, build specific tactical dashboards to get quick insight on how your applications are operating, be able to get details in one click.
* Open source licensed under the terms of [GPL v3 Licence](LICENSE).

```
$ docker run -d \
--name realopinsight \
--network host \
--volume $HOME/.realopinsight:/opt/realopinsight \
rchakode/realopinsight
```
![](./images/banners/screenshots.png)

Once the container started, it shall enable the following endpoints:
* UI: `http://localhost:4583/ui`.
* Prometheus metrics: `http://localhost:4584/metrics`.
# Getting Started
* [Deployment on Kubernetes](./docs/deployement-on-kubernetes.md)
* [Deployment on Docker](./docs/deployement-on-deployment-on-docker.md)
* [Integration with Kubernetes](https://realopinsight.com/docs/quickstart-kubernetes-dashboard/)
* [Integration with Zabbix](https://realopinsight.com/docs/quickstart-zabbix-dashboard/)
* [Integration with Nagios and alike](https://realopinsight.com/docs/quickstart-nagios-icinga-centreon-dashboard/)
* [Design fundamentals](https://realopinsight.com/docs/monitoring-data-sources/)

## Default admin credentials
The default username and password for the UI are `admin` and `password`.
> Default credentials: username => `admin`, password => `password` (should be changed).
> For a production setup, you must change this default password as quick as possible.
# License
RealOpInsight is licensed under the terms of [GPLv3 License](LICENSE), mainly due to copyleft contamination by third-party software to which it's bound (e.g. [Qt](https://www.qt.io/), [Wt](https://www.webtoolkit.eu/wt)).

## Configuration and next steps
Consider the following resources to start integrating RealOpInsight with your target monitoring environment.
* [Architecture & Supported Monitoring Sources](https://realopinsight.com/docs/monitoring-data-sources/)
* [Integration with Kubernetes](https://realopinsight.com/docs/quickstart-kubernetes-dashboard/)
* [Integration with Zabbix](https://realopinsight.com/docs/quickstart-zabbix-dashboard/)
* [Integration with Nagios and related systems](https://realopinsight.com/docs/quickstart-nagios-icinga-centreon-dashboard/)

# Contributions
Contributions in any form (feedback, code, documentation...) are welcome.
For code contributions it's required to have skills in writing code in C+11 or later.
The software also includes [Qt](https://www.qt.io/) and [Wt](https://www.webtoolkit.eu/wt) at it core. Having fundamentals to develop software using this frameworks may be helpful, but not required.
# Copyrights & License
This project has been initiated by Rodrigue Chakode and open to contributions.
Contributions in any form (code, documentation...) must be aligned and compliant with the following terms.
Contributions in any forms are welcomed (feedback, code, documentation, etc).

The software is licensed under the terms of [GPLv3 License](LICENSE), mainly due to contamination by third-party systems that the software is bound to. All those third-party systems may offer dual licenses (e.g. for proprietary uses), subject to pay some license fees. You can contact us you're interested in such a use.
RealOpInsight is developed using C++14 and is bound the [Qt](https://www.qt.io/) and [Wt](https://www.webtoolkit.eu/wt) frameworks.
Having fundamentals to develop software in C++11 or higher is required.
It may be helpful, but not required, to have experience building software with Qt and Wt.
10 changes: 5 additions & 5 deletions core/src/K8sHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,11 @@ QSet<QString> K8sHelper::findMatchingService(const QMap<QString, QMap<QString, Q
const QMap<QString, QVariant>& podLabels)
{
QSet<QString>&& out{};

auto&& podLabelsTags = QSet<QString>::fromList(podLabels.keys());
auto&& labelsList = podLabels.keys();
QSet<QString> podLabelsTags (labelsList.begin(), labelsList.end());
for (auto&& currentServiceSelectors: allServicesSelectors.toStdMap()) {
auto&& selectorTags = currentServiceSelectors.second.keys();
if (podLabelsTags.contains(QSet<QString>::fromList(selectorTags))) {
auto selectorTags = currentServiceSelectors.second.keys();
if (podLabelsTags.contains(QSet<QString>(selectorTags.begin(), selectorTags.end()))) {
bool matched = true;
for (auto&& curTag: selectorTags) {
if (currentServiceSelectors.second[curTag] != podLabels[curTag]) {
Expand All @@ -475,7 +475,7 @@ QSet<QString> K8sHelper::findMatchingService(const QMap<QString, QMap<QString, Q
}
}
}
return std::move(out);
return out;
}

void K8sHelper::setNetworkReplySslOptions(QNetworkReply* reply, bool verifyPeerOption)
Expand Down
2 changes: 1 addition & 1 deletion core/src/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ int Parser::computeCoordinates(void)
}
} else if (splitedLine[0] == "edge") {
// multiInsert because a node can have several childs
m_cdata->edges.insertMulti(splitedLine[1], splitedLine[2]);
m_cdata->edges.insert(splitedLine[1], splitedLine[2]);
} else if (splitedLine[0] == "stop") {
break;
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/ZbxHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@ int ZbxHelper::setBusinessServiceDependencies(NodeListT &bpnodes, const ZabbixPa

int ZbxHelper::setITServiceDataPoint(NodeListT &cnodes, const ZabbixServiceTriggerDependenciesMapT &serviceTriggerDependencies)
{
auto triggerIdList = serviceTriggerDependencies.values();
QSet<QString> uniqueTriggerIds(triggerIdList.begin(), triggerIdList.end());
QStringList params;

QSet<QString> uniqueTriggerIds = serviceTriggerDependencies.values().toSet();
params.push_back(getTriggersIdsJsonList(uniqueTriggerIds));
params.push_back(QString::number(GetTriggersByIds));

Expand Down
14 changes: 7 additions & 7 deletions dbo/src/UserManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ std::unique_ptr<Wt::WValidator> UserFormModel::createNameValidator(void)
validator->setMandatory(true);
validator->setMinimumLength(1);
validator->setMaximumLength(MAX_LENGTH);
return std::move(validator);
return validator;
}

std::unique_ptr<Wt::WValidator> UserFormModel::createPasswordValidator(void)
{
auto validator = std::make_unique<Wt::Auth::PasswordStrengthValidator>();
validator->setMinimumLength(Wt::Auth::PasswordStrengthType::TwoCharClass, 6);
validator->setMandatory(true);
return std::move(validator);
return validator;
}

std::unique_ptr<Wt::WValidator> UserFormModel::createEmailValidator(void)
Expand All @@ -165,7 +165,7 @@ std::unique_ptr<Wt::WValidator> UserFormModel::createEmailValidator(void)
validator->setInvalidBlankText(Q_TR("Required field"));
validator->setInvalidBlankText(Q_TR("Invalid email"));
validator->setMandatory(true);
return std::move(validator);
return validator;
}

std::unique_ptr<Wt::WValidator> UserFormModel::createConfirmPasswordValidator(void)
Expand Down Expand Up @@ -379,15 +379,15 @@ std::unique_ptr<Wt::WComboBox> UserFormView::createUserRoleField(void)

auto fieldWidget = std::make_unique<Wt::WComboBox>();
fieldWidget->setModel(fieldModel);
return std::move(fieldWidget);
return fieldWidget;
}


std::unique_ptr<Wt::WLineEdit> UserFormView::createPaswordField(void)
{
auto field = std::make_unique<Wt::WLineEdit>();
field->setEchoMode(Wt::EchoMode::Password);
return std::move(field);
return field;
}


Expand Down Expand Up @@ -431,7 +431,7 @@ std::unique_ptr<Wt::WSpinBox> UserFormView::createDashboardTilesPerRowField(void
spinbox->setMinimum(1);
spinbox->setMaximum(16);
spinbox->setValue(5);
return std::move(spinbox);
return spinbox;
}


Expand Down Expand Up @@ -476,7 +476,7 @@ std::unique_ptr<Wt::WPanel> DbUserManager::createUserPanel(const DboUserT& user)
panel->setCentralWidget(std::move(form));
panel->setCollapsible(true);
panel->setCollapsed(true);
return std::move(panel);
return panel;
}

void DbUserManager::handleFormAddUser(DboUserT dboUser)
Expand Down
Loading

0 comments on commit 0e88701

Please sign in to comment.