├── .nvmrc ├── .node-version ├── grafana.version ├── src ├── debian │ ├── compat │ ├── source │ │ └── format │ ├── control │ ├── opennms-grafana-plugin.postinst │ └── rules ├── components │ ├── App │ │ ├── index.ts │ │ └── App.tsx │ ├── AppConfig │ │ └── index.ts │ ├── SwitchBox.tsx │ ├── OnmsColors.ts │ ├── FieldDisplay.tsx │ ├── OnmsInlineField.tsx │ ├── DatasourceQueryEditorHelpLink.tsx │ ├── ClearFilterData.tsx │ ├── ColorBar.tsx │ ├── SegmentSectionWithIcon.tsx │ ├── ColorThemeDisplay.tsx │ └── ValueOverrideSwitch.tsx ├── test │ ├── react │ │ ├── .config │ │ │ └── setEnvVars.ts │ │ └── tos_helper.spec.ts │ └── grafana │ │ └── app │ │ └── plugins │ │ └── sdk.ts ├── datasources │ ├── entity-ds │ │ ├── index.ts │ │ ├── help-README.md │ │ ├── queries │ │ │ ├── index.ts │ │ │ ├── queryMonitoredServices.ts │ │ │ ├── queryOutages.ts │ │ │ ├── querySNMPInterfaces.ts │ │ │ ├── queryIPInterfaces.ts │ │ │ └── attributeMappings.ts │ │ ├── plugin.json │ │ ├── EntityQueryEditorHelp.tsx │ │ ├── module.ts │ │ ├── constants.ts │ │ ├── EntityConfigEditor.tsx │ │ └── img │ │ │ └── entity-ds.svg │ ├── flow-ds │ │ ├── help-README.md │ │ ├── plugin.json │ │ ├── FlowQueryEditorHelp.tsx │ │ ├── FlowConfigEditor.tsx │ │ ├── ToolButton.tsx │ │ ├── module.ts │ │ ├── Tools.tsx │ │ ├── img │ │ │ └── flow-ds.svg │ │ ├── FlowDataSource.ts │ │ └── useSegmentOptions.ts │ └── perf-ds │ │ ├── help-README.md │ │ ├── constants.ts │ │ ├── plugin.json │ │ ├── PerformanceQueryEditorHelp.tsx │ │ ├── module.ts │ │ ├── img │ │ └── pm-ds.svg │ │ ├── PerformanceConfigEditor.tsx │ │ ├── PerformanceExpression.tsx │ │ └── InputValueOverrideConfig.tsx ├── panels │ ├── alarm-histogram │ │ ├── index.ts │ │ ├── plugin.json │ │ ├── module.ts │ │ ├── AlarmGroupEditor.tsx │ │ ├── AlarmDirectionEditor.tsx │ │ ├── constants.ts │ │ ├── AlarmHistogramControl.tsx │ │ ├── img │ │ │ └── alarm-histogram.svg │ │ └── README.md │ ├── alarm-table │ │ ├── AlarmTableHelper.ts │ │ ├── plugin.json │ │ ├── hooks │ │ │ ├── useAlarmTableModalTabs.ts │ │ │ ├── useAlarmTableRowHighlighter.ts │ │ │ ├── useAlarm.ts │ │ │ ├── useAlarmTableConfigDefaults.ts │ │ │ └── useAlarmTableSelection.ts │ │ ├── modal │ │ │ ├── AlarmTableModalJson.tsx │ │ │ ├── AlarmTableModalContent.tsx │ │ │ └── AlarmTableModalOverview.tsx │ │ ├── module.ts │ │ ├── constants.ts │ │ ├── AlarmTableTypes.ts │ │ ├── AlarmTableOptions.tsx │ │ ├── AlarmTableMenu.tsx │ │ ├── img │ │ │ └── alarm-table.svg │ │ ├── AlarmTableAlarms.tsx │ │ ├── AlarmTableData.tsx │ │ └── AlarmTablePaging.tsx │ ├── dashboard-convert │ │ ├── module.ts │ │ ├── plugin.json │ │ └── img │ │ │ └── dashboard-convert.svg │ ├── filter-panel │ │ ├── plugin.json │ │ ├── module.ts │ │ ├── FilterPanelTypes.ts │ │ ├── FilterPanelLayoutOptions.tsx │ │ ├── FilterPanelDataSource.tsx │ │ └── img │ │ │ └── filter.svg │ └── flow-histogram │ │ ├── plugin.json │ │ ├── module.ts │ │ ├── FlowHistogramTypes.ts │ │ ├── img │ │ └── flow-histogram.svg │ │ └── FlowHistogramConstants.ts ├── img │ ├── if_icon-close_211652.png │ ├── Helm_Screenshot_Alarms.png │ ├── Helm_Screenshot_Metrics.png │ ├── if_icon-close-circled_211650.png │ ├── Helm_Screenshot_Environmental.png │ ├── if_icon-ios7-checkmark_211715.png │ ├── Helm_Screenshot_Entities_Data_Source.png │ ├── if_icon-ios7-checkmark-outline_211714.png │ ├── Helm_Screenshot_Performance_Data_Source.png │ └── opennms-grafana-plugin.svg ├── lib │ ├── dashboard-convert │ │ ├── index.ts │ │ ├── types.ts │ │ ├── alarmHistogramPanel.ts │ │ ├── requires.ts │ │ ├── flowDs.ts │ │ ├── convert.ts │ │ ├── inputs.ts │ │ ├── utils.ts │ │ ├── flowHistogramPanel.ts │ │ └── entityDs.ts │ ├── variableHelpers.ts │ ├── api_types.ts │ └── localStorageService.ts ├── styles │ ├── dark.scss │ └── light.scss ├── hooks │ ├── useFilterData.ts │ ├── useEntities.tsx │ ├── useDataSources.tsx │ ├── useOpenNMSClient.ts │ └── useEntityProperties.ts ├── module.ts ├── constants │ └── constants.ts └── rpm │ └── spec.mustache ├── .circleci ├── trivy-config │ └── trivyignore ├── grafana-plugin-validator-config.yaml └── get-version.sh ├── .dockerignore ├── mkdocs.sh ├── jest-setup.js ├── .config ├── webpack │ ├── constants.ts │ └── utils.ts ├── .eslintrc ├── .prettierrc.js ├── types │ └── custom.d.ts ├── Dockerfile ├── tsconfig.json ├── jest │ ├── utils.js │ └── mocks │ │ └── react-inlinesvg.tsx ├── jest-setup.js └── jest.config.js ├── .release-lint-excludes ├── .github ├── assign-by-files.yml ├── label-pr.yml ├── labeler.yml ├── workflows │ ├── labeler.yml │ └── auto-assign.yml ├── dependabot.yml └── PULL_REQUEST_TEMPLATE.md ├── .eslintrc ├── tsconfig.json ├── __mocks__ └── axios.js ├── docs ├── modules │ ├── about │ │ └── assets │ │ │ └── images │ │ │ ├── sample-dash.png │ │ │ ├── data-architecture.png │ │ │ └── data-architecture.drawio │ ├── reference │ │ ├── assets │ │ │ └── images │ │ │ │ └── severities.png │ │ └── pages │ │ │ ├── severities.adoc │ │ │ └── how-to-build-with-docker.adoc │ ├── getting_started │ │ ├── assets │ │ │ └── images │ │ │ │ ├── gf-flows.png │ │ │ │ ├── gf-plugins.png │ │ │ │ ├── gf-data-link.png │ │ │ │ ├── gf-edit-panel.png │ │ │ │ ├── gf-alarm-table.png │ │ │ │ ├── gf-data-config.png │ │ │ │ ├── gf-data-config2.png │ │ │ │ ├── gf-data-sources.png │ │ │ │ ├── gf-panel-config.png │ │ │ │ ├── gf-sample-dash.png │ │ │ │ ├── gf-add-data-source.png │ │ │ │ ├── gf-community-dash.png │ │ │ │ └── gf-custom-actions.png │ │ └── pages │ │ │ ├── index.adoc │ │ │ ├── dashboard_planning.adoc │ │ │ ├── importing.adoc │ │ │ └── flow-deep-dive.adoc │ ├── panel_configuration │ │ └── assets │ │ │ └── images │ │ │ ├── pc-sum.png │ │ │ ├── alarm-panel.png │ │ │ ├── pc-forecast.png │ │ │ ├── pc-outpos3.png │ │ │ ├── pc-periods.png │ │ │ ├── pc-server1.png │ │ │ ├── filter-panel.png │ │ │ ├── flow-histogram.png │ │ │ ├── pc-TCP-panel.png │ │ │ ├── pc-Variables.png │ │ │ ├── pc-expression3.png │ │ │ ├── pc-filter-ds.png │ │ │ ├── pc-fp-sample.png │ │ │ ├── pc-node-Final.png │ │ │ ├── pc-time-range.png │ │ │ ├── alarm-histogram.png │ │ │ ├── gf-panel-config.png │ │ │ ├── pc-filter-panel2.png │ │ │ ├── pc-select-nodes.png │ │ │ ├── pc-storage-used.png │ │ │ ├── pc-variable-drop.png │ │ │ ├── pc-variable-list.png │ │ │ ├── opg-variable-syntax.png │ │ │ ├── pc-alarm-attributes.png │ │ │ ├── alarms-table-example.png │ │ │ ├── pc-filter-panel-cust.png │ │ │ ├── alarm-histogram-example.png │ │ │ └── flow-histogram-example.png │ ├── installation │ │ ├── assets │ │ │ └── images │ │ │ │ └── dashboard-conversion-tool.png │ │ └── pages │ │ │ ├── plugin.adoc │ │ │ ├── requirements.adoc │ │ │ └── source.adoc │ ├── contributing │ │ └── pages │ │ │ ├── how-to-build-docs.adoc │ │ │ └── developing.adoc │ └── ROOT │ │ ├── pages │ │ └── index.adoc │ │ └── nav.adoc └── antora.yml ├── .prettierrc.js ├── get-version.sh ├── spec └── .eslintrc.json ├── .vscode └── settings.json ├── docker-compose.yaml ├── local-site.yml ├── jest.config.js ├── Gruntfile.js ├── site.yml ├── Dockerfile ├── .gitignore ├── LICENSE ├── makezip.js ├── webpack.config.ts └── docker-compose.yml /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 18.17.1 2 | -------------------------------------------------------------------------------- /grafana.version: -------------------------------------------------------------------------------- 1 | 9.5.15 2 | -------------------------------------------------------------------------------- /src/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /src/debian/source/format: -------------------------------------------------------------------------------- 1 | 1.0 2 | -------------------------------------------------------------------------------- /.circleci/trivy-config/trivyignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | ** 2 | !artifacts 3 | -------------------------------------------------------------------------------- /src/components/App/index.ts: -------------------------------------------------------------------------------- 1 | export * from './App' 2 | -------------------------------------------------------------------------------- /mkdocs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | antora generate local-site.yml -------------------------------------------------------------------------------- /src/components/AppConfig/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AppConfig' 2 | -------------------------------------------------------------------------------- /src/test/react/.config/setEnvVars.ts: -------------------------------------------------------------------------------- 1 | process.env.TEST_IP_1 = '10.1.1.1' 2 | -------------------------------------------------------------------------------- /src/datasources/entity-ds/index.ts: -------------------------------------------------------------------------------- 1 | export * as EntityHelper from './EntityHelper' 2 | -------------------------------------------------------------------------------- /jest-setup.js: -------------------------------------------------------------------------------- 1 | // Jest setup provided by Grafana scaffolding 2 | import './.config/jest-setup'; 3 | -------------------------------------------------------------------------------- /.config/webpack/constants.ts: -------------------------------------------------------------------------------- 1 | export const SOURCE_DIR = 'src'; 2 | export const DIST_DIR = 'dist'; 3 | -------------------------------------------------------------------------------- /.release-lint-excludes: -------------------------------------------------------------------------------- 1 | .circleci/config.yml 2 | .circleci/get-version.sh 3 | makedeb.js 4 | makerpm.js 5 | -------------------------------------------------------------------------------- /.github/assign-by-files.yml: -------------------------------------------------------------------------------- 1 | --- 2 | "**/*.adoc": 3 | - indigo423 4 | 5 | "docs/**/*": 6 | - indigo423 -------------------------------------------------------------------------------- /.github/label-pr.yml: -------------------------------------------------------------------------------- 1 | - regExp: "^docs/.*$" 2 | labels: ["docs"] 3 | - regExp: "^.*\\.adoc$" 4 | labels: ["docs"] -------------------------------------------------------------------------------- /src/panels/alarm-histogram/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AlarmGroupEditor' 2 | export * from './AlarmDirectionEditor' 3 | -------------------------------------------------------------------------------- /src/img/if_icon-close_211652.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/if_icon-close_211652.png -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | docs: 2 | - 'docs/*' 3 | - 'docs/**/*' 4 | - 'opennms-doc/*' 5 | - 'opennms-doc/**/*' 6 | - '**/*.adoc' 7 | -------------------------------------------------------------------------------- /src/img/Helm_Screenshot_Alarms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/Helm_Screenshot_Alarms.png -------------------------------------------------------------------------------- /src/img/Helm_Screenshot_Metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/Helm_Screenshot_Metrics.png -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "./.config/.eslintrc" 4 | ], 5 | "rules": { 6 | "no-console": "off" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.config/tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | } 6 | } -------------------------------------------------------------------------------- /__mocks__/axios.js: -------------------------------------------------------------------------------- 1 | // ./__mocks__/axios.js 2 | const mockAxios = require('jest-mock-axios').default; 3 | module.exports = mockAxios; 4 | -------------------------------------------------------------------------------- /src/img/if_icon-close-circled_211650.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/if_icon-close-circled_211650.png -------------------------------------------------------------------------------- /src/img/Helm_Screenshot_Environmental.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/Helm_Screenshot_Environmental.png -------------------------------------------------------------------------------- /src/img/if_icon-ios7-checkmark_211715.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/if_icon-ios7-checkmark_211715.png -------------------------------------------------------------------------------- /docs/modules/about/assets/images/sample-dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/about/assets/images/sample-dash.png -------------------------------------------------------------------------------- /src/img/Helm_Screenshot_Entities_Data_Source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/Helm_Screenshot_Entities_Data_Source.png -------------------------------------------------------------------------------- /src/img/if_icon-ios7-checkmark-outline_211714.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/if_icon-ios7-checkmark-outline_211714.png -------------------------------------------------------------------------------- /docs/modules/reference/assets/images/severities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/reference/assets/images/severities.png -------------------------------------------------------------------------------- /src/img/Helm_Screenshot_Performance_Data_Source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/src/img/Helm_Screenshot_Performance_Data_Source.png -------------------------------------------------------------------------------- /docs/modules/about/assets/images/data-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/about/assets/images/data-architecture.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-flows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-flows.png -------------------------------------------------------------------------------- /src/test/grafana/app/plugins/sdk.ts: -------------------------------------------------------------------------------- 1 | export class QueryCtrl { 2 | constructor(public $scope: any, public $injector: any) { 3 | } 4 | 5 | refresh() { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-plugins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-plugins.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-sum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-sum.png -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // Prettier configuration provided by Grafana scaffolding 3 | ...require("./.config/.prettierrc.js"), 4 | 5 | "semi": false 6 | }; -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-data-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-data-link.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-edit-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-edit-panel.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-alarm-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-alarm-table.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-data-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-data-config.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-data-config2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-data-config2.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-data-sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-data-sources.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-panel-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-panel-config.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-sample-dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-sample-dash.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/alarm-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/alarm-panel.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-forecast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-forecast.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-outpos3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-outpos3.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-periods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-periods.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-server1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-server1.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-add-data-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-add-data-source.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-community-dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-community-dash.png -------------------------------------------------------------------------------- /docs/modules/getting_started/assets/images/gf-custom-actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/getting_started/assets/images/gf-custom-actions.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/filter-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/filter-panel.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/flow-histogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/flow-histogram.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-TCP-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-TCP-panel.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-Variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-Variables.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-expression3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-expression3.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-filter-ds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-filter-ds.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-fp-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-fp-sample.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-node-Final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-node-Final.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-time-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-time-range.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/alarm-histogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/alarm-histogram.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/gf-panel-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/gf-panel-config.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-filter-panel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-filter-panel2.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-select-nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-select-nodes.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-storage-used.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-storage-used.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-variable-drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-variable-drop.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-variable-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-variable-list.png -------------------------------------------------------------------------------- /docs/modules/installation/assets/images/dashboard-conversion-tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/installation/assets/images/dashboard-conversion-tool.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/opg-variable-syntax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/opg-variable-syntax.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-alarm-attributes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-alarm-attributes.png -------------------------------------------------------------------------------- /get-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PROJECT_DIR=$( dirname "${BASH_SOURCE[0]}" ) 4 | PKG_INFO=(./package.json) 5 | VERSION=$(jq ".version" ${PKG_INFO}) 6 | echo "${VERSION//\"/}" > version.tag 7 | -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/alarms-table-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/alarms-table-example.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/pc-filter-panel-cust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/pc-filter-panel-cust.png -------------------------------------------------------------------------------- /src/lib/dashboard-convert/index.ts: -------------------------------------------------------------------------------- 1 | import { dashboardConvert } from './convert' 2 | import { getDashboardTitle } from './utils' 3 | 4 | export { 5 | dashboardConvert, 6 | getDashboardTitle 7 | } 8 | -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/alarm-histogram-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/alarm-histogram-example.png -------------------------------------------------------------------------------- /docs/modules/panel_configuration/assets/images/flow-histogram-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNMS/grafana-plugin/HEAD/docs/modules/panel_configuration/assets/images/flow-histogram-example.png -------------------------------------------------------------------------------- /src/datasources/flow-ds/help-README.md: -------------------------------------------------------------------------------- 1 | # OpenNMS plugin for Grafana: Flow Datasource 2 | 3 | See the [Flow Datasource Documentation](%OPG_DOCS_BASE_URL%/datasources/flow_datasource.html) for help on configuring and using the datasource. -------------------------------------------------------------------------------- /src/panels/alarm-table/AlarmTableHelper.ts: -------------------------------------------------------------------------------- 1 | import { Field } from '@grafana/data' 2 | 3 | export const getAlarmIdFromFields = (fields: Field[], index: number) => { 4 | return fields.find((d) => d.name === 'ID')?.values.get(index) 5 | } 6 | -------------------------------------------------------------------------------- /src/datasources/entity-ds/help-README.md: -------------------------------------------------------------------------------- 1 | # OpenNMS plugin for Grafana: Entity Datasource 2 | 3 | See the [Entity Datasource Documentation](%OPG_DOCS_BASE_URL%/datasources/entity_datasource.html) for help on configuring and using the datasource. -------------------------------------------------------------------------------- /src/datasources/perf-ds/help-README.md: -------------------------------------------------------------------------------- 1 | # OpenNMS plugin for Grafana: Performance Datasource 2 | 3 | See the [Performance Datasource Documentation](%OPG_DOCS_BASE_URL%/datasources/performance_datasource.html) for help on configuring and using the datasource. 4 | -------------------------------------------------------------------------------- /src/styles/dark.scss: -------------------------------------------------------------------------------- 1 | @import "../datasources/perf-ds/sass/opennms.dark.scss"; 2 | @import "../panels/alarm-table/sass/table.dark.scss"; 3 | @import "../panels/filter-panel/sass/filter.dark.scss"; 4 | @import "../panels/flow-histogram/sass/legend.dark.scss"; 5 | -------------------------------------------------------------------------------- /src/styles/light.scss: -------------------------------------------------------------------------------- 1 | @import "../datasources/perf-ds/sass/opennms.light.scss"; 2 | @import "../panels/alarm-table/sass/table.light.scss"; 3 | @import "../panels/filter-panel/sass/filter.light.scss"; 4 | @import "../panels/flow-histogram/sass/legend.light.scss"; 5 | -------------------------------------------------------------------------------- /spec/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "mocha": true, 5 | "node": true, 6 | "commonjs": true, 7 | "es6": true 8 | }, 9 | "globals": { 10 | "expect": "readable" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/datasources/entity-ds/queries/index.ts: -------------------------------------------------------------------------------- 1 | export * from './queryAlarms' 2 | export * from './queryIPInterfaces' 3 | export * from './queryMonitoredServices' 4 | export * from './queryNodes' 5 | export * from './queryOutages' 6 | export * from './querySNMPInterfaces' 7 | -------------------------------------------------------------------------------- /src/components/App/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { AppRootProps } from '@grafana/data' 3 | 4 | export class App extends React.PureComponent { 5 | render() { 6 | return
OpenNMS Plugin for Grafana
; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/hooks/useFilterData.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getFilterId, 3 | getFilterIdFromParts 4 | } from '../datasources/entity-ds/EntityHelper' 5 | 6 | export const useFilterData = () => { 7 | return { 8 | getFilterId, 9 | getFilterIdFromParts 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.circleci/grafana-plugin-validator-config.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | enabled: true 3 | strict: true 4 | 5 | # there are issues updating OPG v9 libraries in order to pass the 6 | # osv-scanner and @grafana/plugin-validator, so we are disabling 7 | # for now 8 | analyzers: 9 | osv-scanner: 10 | enabled: false 11 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true, 3 | "javascript.validate.enable": false, 4 | "typescript.validate.enable": false, 5 | "spellright.language": [ 6 | "en" 7 | ], 8 | "spellright.documentTypes": [ 9 | "markdown", 10 | "latex", 11 | "plaintext", 12 | "asciidoc" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/panels/dashboard-convert/module.ts: -------------------------------------------------------------------------------- 1 | import { PanelPlugin } from '@grafana/data' 2 | import { DashboardConvertPanelControl } from './DashboardConvertPanelControl' 3 | 4 | export const plugin = new PanelPlugin(DashboardConvertPanelControl).setPanelOptions((builder) => { 5 | // no custom editor for now 6 | }) 7 | -------------------------------------------------------------------------------- /src/panels/filter-panel/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "panel", 3 | "name": "Filter Panel", 4 | "id": "opennms-filter-panel", 5 | 6 | "info": { 7 | "description": "OpenNMS Filter Panel", 8 | "logos": { 9 | "small": "img/filter.svg", 10 | "large": "img/filter.svg" 11 | }, 12 | "version": "9" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/module.ts: -------------------------------------------------------------------------------- 1 | import { AppPlugin } from '@grafana/data' 2 | import { App } from './components/App' 3 | import { AppConfig } from './components/AppConfig' 4 | 5 | export const plugin = new AppPlugin<{}>().setRootPage(App).addConfigPage({ 6 | title: 'Configuration', 7 | icon: 'cog', 8 | body: AppConfig, 9 | id: 'configuration' 10 | }) 11 | -------------------------------------------------------------------------------- /src/debian/control: -------------------------------------------------------------------------------- 1 | Source: opennms-grafana-plugin 2 | Section: contrib/net 3 | Priority: optional 4 | Maintainer: Benjamin Reed 5 | Build-Depends: debhelper (>= 9) 6 | Standards-Version: 3.7.3 7 | 8 | Package: opennms-grafana-plugin 9 | Architecture: all 10 | Depends: grafana (>= 9.0) 11 | Description: An OpenNMS Console for Grafana 12 | -------------------------------------------------------------------------------- /src/panels/flow-histogram/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "panel", 3 | "name": "Flow Histogram", 4 | "id": "opennms-flow-histogram-panel", 5 | "info": { 6 | "description": "OpenNMS Flow Histogram Panel", 7 | "logos": { 8 | "small": "img/flow-histogram.svg", 9 | "large": "img/flow-histogram.svg" 10 | }, 11 | "version": "9" 12 | } 13 | } -------------------------------------------------------------------------------- /src/datasources/perf-ds/constants.ts: -------------------------------------------------------------------------------- 1 | 2 | export const PerformanceTypeOptions = { 3 | Attribute: { label: 'Attribute', value: 1 }, 4 | Expression: { label: 'Expression', value: 2 }, 5 | Filter: { label: 'Filter', value: 3 }, 6 | StringProperty: { label: 'String Property', value: 4 }, 7 | } 8 | 9 | export const DefaultOverrideAttributeQueryNodeLimit = 1000 10 | -------------------------------------------------------------------------------- /docs/antora.yml: -------------------------------------------------------------------------------- 1 | name: grafana-plugin 2 | version: '10-SNAPSHOT' 3 | title: Plugin for Grafana 4 | asciidoc: 5 | attributes: 6 | full-display-version: '10.0.0-SNAPSHOT' 7 | grafana-version-required: '9.x' 8 | grafana-version-tested: '9.0' 9 | node-js-build-version: '16.x' 10 | product-name: 'OpenNMS Plugin for Grafana' 11 | nav: 12 | - modules/ROOT/nav.adoc 13 | -------------------------------------------------------------------------------- /src/panels/alarm-histogram/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "panel", 3 | "name": "Alarm Histogram", 4 | "id": "opennms-alarm-histogram-panel", 5 | 6 | "info": { 7 | "description": "OpenNMS Alarm Histogram Panel", 8 | "logos": { 9 | "small": "img/alarm-histogram.svg", 10 | "large": "img/alarm-histogram.svg" 11 | }, 12 | "version": "9" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/panels/alarm-table/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "panel", 3 | "name": "Alarm Table", 4 | "id": "opennms-alarm-table-panel", 5 | 6 | "dateFormats": ["table", "time_series"], 7 | 8 | "info": { 9 | "description": "OpenNMS Alarm Table Panel", 10 | "logos": { 11 | "small": "img/alarm-table.svg", 12 | "large": "img/alarm-table.svg" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/panels/dashboard-convert/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "panel", 3 | "name": "Dashboard Convert Panel", 4 | "id": "opennms-dashboard-convert-panel", 5 | 6 | "info": { 7 | "description": "OpenNMS Dashboard Convert Panel", 8 | "logos": { 9 | "small": "img/dashboard-convert.svg", 10 | "large": "img/dashboard-convert.svg" 11 | }, 12 | "version": "9" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.0' 2 | 3 | services: 4 | grafana: 5 | container_name: 'opennms-grafana-plugin' 6 | build: 7 | context: ./.config 8 | args: 9 | grafana_version: ${GRAFANA_VERSION:-9.4.7} 10 | ports: 11 | - 3000:3000/tcp 12 | volumes: 13 | - ./dist:/var/lib/grafana/plugins/opennms-opennms-app 14 | - ./provisioning:/etc/grafana/provisioning 15 | -------------------------------------------------------------------------------- /src/datasources/flow-ds/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OpenNMS Flow", 3 | "id": "opennms-flow-datasource", 4 | "type": "datasource", 5 | 6 | "metrics": true, 7 | "annotations": false, 8 | 9 | "info": { 10 | "description": "OpenNMS Flow Datasource", 11 | "logos": { 12 | "small": "img/flow-ds.svg", 13 | "large": "img/flow-ds.svg" 14 | }, 15 | "version": "9" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/panels/alarm-table/hooks/useAlarmTableModalTabs.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | 3 | export const useAlarmTableModalTabs = () => { 4 | const [tabActive, setTabActive] = useState(0); 5 | 6 | const tabClick = (e) => { 7 | setTabActive(e); 8 | } 9 | 10 | const resetTabs = () => { 11 | setTabActive(0) 12 | } 13 | 14 | return { tabActive, tabClick, resetTabs } 15 | } 16 | -------------------------------------------------------------------------------- /src/panels/filter-panel/module.ts: -------------------------------------------------------------------------------- 1 | import { PanelPlugin } from '@grafana/data' 2 | import { FilterPanelControl } from './FilterPanelControl' 3 | import { FilterPanelOptions } from './FilterPanelOptions' 4 | 5 | export const plugin = new PanelPlugin(FilterPanelControl).setPanelOptions((builder) => { 6 | builder.addCustomEditor({ id: 'filter-editor', path: 'filterEditor', name: 'Filter', editor: FilterPanelOptions }) 7 | }) 8 | -------------------------------------------------------------------------------- /src/hooks/useEntities.tsx: -------------------------------------------------------------------------------- 1 | export const useEntities = () => { 2 | const entities = [ 3 | { label: 'Alarms', value: '0' }, 4 | { label: 'Nodes', value: '1' }, 5 | { label: 'IP Interfaces', value: '2' }, 6 | { label: 'SNMP Interfaces', value: '3' }, 7 | { label: 'Monitored Services', value: '4'}, 8 | { label: 'Outages', value: '5' }, 9 | ] 10 | 11 | return { 12 | entities 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/datasources/entity-ds/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OpenNMS Entities", 3 | "id": "opennms-entity-datasource", 4 | "type": "datasource", 5 | 6 | "metrics": true, 7 | "annotations": false, 8 | 9 | "info": { 10 | "description": "OpenNMS Entities Datasource", 11 | "logos": { 12 | "small": "img/entity-ds.svg", 13 | "large": "img/entity-ds.svg" 14 | }, 15 | "version": "9" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.config/.eslintrc: -------------------------------------------------------------------------------- 1 | /* 2 | * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ 3 | * 4 | * In order to extend the configuration follow the steps in 5 | * https://grafana.github.io/plugin-tools/docs/advanced-configuration#extending-the-eslint-config 6 | */ 7 | { 8 | "extends": ["@grafana/eslint-config"], 9 | "root": true, 10 | "rules": { 11 | "react/prop-types": "off" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/panels/alarm-table/modal/AlarmTableModalJson.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { OnmsAlarm } from 'opennms/src/model' 3 | 4 | interface AlarmTableModalJsonProps { 5 | alarm: OnmsAlarm | undefined; 6 | } 7 | 8 | export const AlarmTableModalJson: React.FC = ({alarm}) => { 9 | return (
10 |
11 |             {JSON.stringify(alarm,null,2)}
12 |         
13 |
) 14 | } 15 | -------------------------------------------------------------------------------- /src/panels/alarm-table/module.ts: -------------------------------------------------------------------------------- 1 | import { PanelPlugin } from '@grafana/data' 2 | import { AlarmTableControl } from './AlarmTableControl' 3 | import { AlarmTableOptions } from './AlarmTableOptions' 4 | 5 | export const plugin = new PanelPlugin(AlarmTableControl) 6 | plugin.useFieldConfig() 7 | plugin.setPanelOptions((builder) => { 8 | builder.addCustomEditor({ id: 'alarm-table-options', path: 'alarmTable', name: '', editor: AlarmTableOptions }) 9 | }) 10 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | # Workflow to associate labels automatically 2 | name: PR-Labeler 3 | # Trigger the workflow on pull request events 4 | on: 5 | - pull_request_target 6 | 7 | jobs: 8 | label: 9 | permissions: 10 | contents: read 11 | pull-requests: write 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/labeler@v4 15 | with: 16 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 17 | -------------------------------------------------------------------------------- /src/components/SwitchBox.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export interface SwitchBoxProps { 4 | className?: string 5 | children: React.ReactNode 6 | } 7 | 8 | export const SwitchBox: React.FC = ({className = undefined, children }) => { 9 | return ( 10 |
11 | {children} 12 |
13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /.config/.prettierrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ 3 | * 4 | * In order to extend the configuration follow the steps in .config/README.md 5 | */ 6 | 7 | module.exports = { 8 | "endOfLine": "auto", 9 | "printWidth": 120, 10 | "trailingComma": "es5", 11 | "semi": true, 12 | "jsxSingleQuote": false, 13 | "singleQuote": true, 14 | "useTabs": false, 15 | "tabWidth": 2 16 | }; -------------------------------------------------------------------------------- /src/panels/flow-histogram/module.ts: -------------------------------------------------------------------------------- 1 | import { PanelPlugin } from '@grafana/data'; 2 | import { FlowHistogramControl } from './FlowHistogramControl' 3 | import { FlowHistogramOptions } from './FlowHistogramOptions' 4 | 5 | export const plugin = new PanelPlugin(FlowHistogramControl).setPanelOptions((builder) => { 6 | builder.addCustomEditor({ id: 'flow-histogram-options', path: 'flowHistogramOptions', name: 'Flow Histogram Panel', editor: FlowHistogramOptions }) 7 | }); 8 | -------------------------------------------------------------------------------- /src/debian/opennms-grafana-plugin.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | [ -f /etc/default/grafana-server ] && . /etc/default/grafana-server 6 | 7 | [ -z "$GRAFANA_USER" ] && GRAFANA_USER="grafana" 8 | [ -z "$GRAFANA_GROUP" ] && GRAFANA_GROUP="grafana" 9 | 10 | case "$1" in 11 | configure) 12 | mkdir -p /var/lib/grafana/plugins 13 | chown -R "$GRAFANA_USER:$GRAFANA_GROUP" /var/lib/grafana/plugins 14 | chmod 755 /var/lib/grafana/plugins 15 | ;; 16 | esac 17 | -------------------------------------------------------------------------------- /src/panels/filter-panel/FilterPanelTypes.ts: -------------------------------------------------------------------------------- 1 | import { SelectableValue } from '@grafana/data' 2 | import { GrafanaDatasource } from 'hooks/useDataSources' 3 | import { ActiveFilter } from '../../datasources/entity-ds/types' 4 | 5 | export interface FilterControlProps { 6 | dashboardUid?: string 7 | filterEditor: { 8 | datasource: SelectableValue | undefined, 9 | activeFilters: ActiveFilter[], 10 | isHorizontalLayout?: boolean 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.github/workflows/auto-assign.yml: -------------------------------------------------------------------------------- 1 | name: "Auto Assign Pull Request" 2 | on: 3 | pull_request: 4 | types: [review_requested, ready_for_review, opened, synchronize, reopened] 5 | branches: 6 | - develop 7 | jobs: 8 | assign_reviewer: 9 | if: github.event.pull_request.draft == false 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: shufo/auto-assign-reviewer-by-files@v1.1.3 13 | with: 14 | config: ".github/assign-by-files.yml" 15 | token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /src/datasources/flow-ds/FlowQueryEditorHelp.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { QueryEditorHelpProps } from '@grafana/data' 3 | import { DatasourceQueryEditorHelpLink } from '../../components/DatasourceQueryEditorHelpLink' 4 | import { FlowQuery } from './types' 5 | 6 | export const FlowQueryEditorHelp: React.FC> = () => { 7 | return ( 8 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/panels/alarm-histogram/module.ts: -------------------------------------------------------------------------------- 1 | import { PanelPlugin } from '@grafana/data' 2 | import { AlarmHistogramControl } from './AlarmHistogramControl' 3 | import { AlarmGroupEditor, AlarmDirectionEditor } from '.' 4 | 5 | export const plugin = new PanelPlugin(AlarmHistogramControl).setPanelOptions((builder) => { 6 | builder.addCustomEditor({id: 'alarm-group',path: 'alarmGroup', name:'Alarm Group',editor: AlarmGroupEditor}) 7 | builder.addCustomEditor({id: 'alarm-direction',path: 'alarmDirection', name:'Alarm Direction',editor: AlarmDirectionEditor}) 8 | }) 9 | -------------------------------------------------------------------------------- /src/datasources/entity-ds/EntityQueryEditorHelp.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { QueryEditorHelpProps } from '@grafana/data' 3 | import { DatasourceQueryEditorHelpLink } from '../../components/DatasourceQueryEditorHelpLink' 4 | import { EntityQuery } from './types' 5 | 6 | export const EntityQueryEditorHelp: React.FC> = () => { 7 | return ( 8 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/datasources/perf-ds/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OpenNMS Performance", 3 | "id": "opennms-performance-datasource", 4 | "type": "datasource", 5 | 6 | "metrics": true, 7 | "annotations": false, 8 | "hiddenQueries": true, 9 | 10 | "queryOptions": { 11 | "minInterval": true, 12 | "maxDataPoints": true 13 | }, 14 | 15 | "info": { 16 | "description": "OpenNMS Performance Datasource", 17 | "logos": { 18 | "small": "img/pm-ds.svg", 19 | "large": "img/pm-ds.svg" 20 | }, 21 | "version": "9" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /local-site.yml: -------------------------------------------------------------------------------- 1 | site: 2 | title: Grafana Plugin Documentation 3 | url: https://docs.opennms.com/grafana-plugin/ 4 | start_page: grafana-plugin::index.adoc 5 | content: 6 | sources: 7 | - url: . 8 | branches: HEAD 9 | start_path: docs 10 | ui: 11 | bundle: 12 | url: https://github.com/opennms-forge/antora-ui-opennms/releases/download/v3.1.0/ui-bundle.zip 13 | asciidoc: 14 | attributes: 15 | experimental: true 16 | stem: latexmath 17 | output: 18 | clean: true 19 | dir: ./public 20 | destinations: 21 | - provider: fs 22 | - provider: archive 23 | -------------------------------------------------------------------------------- /src/datasources/perf-ds/PerformanceQueryEditorHelp.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { QueryEditorHelpProps } from '@grafana/data' 3 | import { DatasourceQueryEditorHelpLink } from '../../components/DatasourceQueryEditorHelpLink' 4 | import { PerformanceQuery } from './types' 5 | 6 | export const PerformanceQueryEditorHelp: React.FC> = () => { 7 | return ( 8 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /docs/modules/contributing/pages/how-to-build-docs.adoc: -------------------------------------------------------------------------------- 1 | 2 | = Write and Build Documentation 3 | :description: Learn how to contribute documentation to the {product-name} that lets you create flexible dashboards to visualize and interact with data stored by OpenNMS. 4 | 5 | The {product-name} is free and open source and, as such, we welcome any kind of contribution. 6 | 7 | For guidelines on writing documentation for the project and information on how to build the documentation locally, see https://docs.opennms.com/horizon/latest/write-the-docs/overview.html[Write the Docs] in the main OpenNMS documentation. 8 | -------------------------------------------------------------------------------- /src/datasources/flow-ds/FlowConfigEditor.tsx: -------------------------------------------------------------------------------- 1 | import { DataSourcePluginOptionsEditorProps } from '@grafana/data'; 2 | import { DataSourceHttpSettings } from '@grafana/ui'; 3 | import React from 'react'; 4 | import { FlowDataSourceOptions } from './types'; 5 | 6 | interface Props extends DataSourcePluginOptionsEditorProps {} 7 | 8 | export const FlowConfigEditor: React.FC = ({ onOptionsChange, options }) => { 9 | return ( 10 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | // force timezone to UTC to allow tests to work regardless of local timezone 2 | // generally used by snapshots, but can affect specific tests 3 | process.env.TZ = 'UTC'; 4 | 5 | const { grafanaESModules, nodeModulesToTransform } = require('./.config/jest/utils'); 6 | 7 | module.exports = { 8 | // Jest configuration provided by Grafana scaffolding 9 | ...require('./.config/jest.config'), 10 | // Inform jest to only transform specific node_module packages. 11 | transformIgnorePatterns: [nodeModulesToTransform([...grafanaESModules, 'opennms'])], 12 | setupFiles: ['/src/test/react/.config/setEnvVars.ts'], 13 | }; 14 | -------------------------------------------------------------------------------- /src/datasources/entity-ds/module.ts: -------------------------------------------------------------------------------- 1 | import { DataSourcePlugin } from '@grafana/data' 2 | import { EntityConfigEditor } from './EntityConfigEditor' 3 | import { EntityDataSource } from './EntityDataSource' 4 | import { EntityQueryEditor } from './EntityQueryEditor' 5 | import { EntityQueryEditorHelp } from './EntityQueryEditorHelp' 6 | import { EntityDataSourceOptions, EntityQuery } from './types' 7 | 8 | 9 | export const plugin = new DataSourcePlugin(EntityDataSource) 10 | .setConfigEditor(EntityConfigEditor) 11 | .setQueryEditor(EntityQueryEditor) 12 | .setQueryEditorHelp(EntityQueryEditorHelp); 13 | -------------------------------------------------------------------------------- /src/hooks/useDataSources.tsx: -------------------------------------------------------------------------------- 1 | import { getBackendSrv } from '@grafana/runtime'; 2 | import { useEffect, useState } from 'react'; 3 | 4 | export interface GrafanaDatasource {name: string, type: string, id: string} 5 | 6 | export const useDatasources = () => { 7 | const [datasources, setDatasources] = useState([]); 8 | 9 | const updateDatasources = async () => { 10 | const data = await getBackendSrv().get('/api/datasources'); 11 | setDatasources(data); 12 | } 13 | 14 | useEffect(() => { 15 | updateDatasources(); 16 | // eslint-disable-next-line react-hooks/exhaustive-deps 17 | }, []) 18 | return { datasources } 19 | } 20 | -------------------------------------------------------------------------------- /src/components/OnmsColors.ts: -------------------------------------------------------------------------------- 1 | export const onmsColorArray = [ 2 | ['#999000', '#eee000', '#86b15b', '#fccc3b', '#ee901c', '#e3692f', '#db4345'], 3 | ['#999000', '#999', '#360', '#fc0', '#f90', '#f30', '#c00'], 4 | ['#614765', '#ccc', '#00b48b', '#00d3c9', '#ffce56', '#ff9033', '#ff3b50'], 5 | ['#999000', '#999', '#a1cc72', '#6ec5c6', '#f9df6c', '#dda35c', '#ea3225'], 6 | ['#a44ae6', '#5dc93b', '#ccc', '#76b7f9', '#fffd54', '#f4b54b', '#eb3223'] 7 | ] 8 | 9 | export const onmsColorsByName = { 10 | default: onmsColorArray[0], 11 | openNms: onmsColorArray[1], 12 | ohMy: onmsColorArray[2], 13 | noNeverMind: onmsColorArray[3], 14 | thatsCool: onmsColorArray[4] 15 | } 16 | -------------------------------------------------------------------------------- /src/panels/alarm-histogram/AlarmGroupEditor.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { PanelOptionsEditorProps } from '@grafana/data' 3 | import { Select } from '@grafana/ui' 4 | import { AlarmGroups } from './constants' 5 | 6 | interface Props extends PanelOptionsEditorProps { } 7 | 8 | export const AlarmGroupEditor: React.FC = ({ value, onChange }) => { 9 | return ( 10 |
11 | onChange(e.value)} 19 | /> 20 |
21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /src/lib/dashboard-convert/types.ts: -------------------------------------------------------------------------------- 1 | export type DsType = 'entity' | 'performance' | 'flow' 2 | 3 | export interface DatasourceMetadata { 4 | /** Human-friendly name of datasource, e.g. "OpenNMS Entity" */ 5 | name: string 6 | 7 | /** Grafana integer id of this datasource */ 8 | id: number 9 | 10 | /** Grafana uid of this datasource, e.g. "xT5Xzsq7z" */ 11 | uid: string 12 | 13 | /** e.g. 'opennms-entity-datasource */ 14 | type: string 15 | 16 | /** raw version string, from plugin.json info.version 17 | * probably '9' for Version 9.x, '' for anything previous */ 18 | version: string 19 | 20 | /** e.g. 8 or 9 */ 21 | pluginVersion: number 22 | 23 | /** 'entity', 'performance', 'flow' */ 24 | datasourceType?: DsType 25 | } 26 | -------------------------------------------------------------------------------- /src/panels/filter-panel/FilterPanelLayoutOptions.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Switch } from '@grafana/ui' 3 | import { OnmsInlineField } from 'components/OnmsInlineField' 4 | import { SwitchBox } from 'components/SwitchBox' 5 | 6 | interface FilterPanelLayoutOptionsProps { 7 | isHorizontal?: boolean 8 | onChange: Function 9 | } 10 | 11 | export const FilterPanelLayoutOptions: React.FC = ({ isHorizontal, onChange }) => { 12 | return ( 13 | 14 | 15 | onChange(!isHorizontal)} /> 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /src/hooks/useOpenNMSClient.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react' 2 | import { DataSourceRef } from '@grafana/data' 3 | import { getDataSourceSrv } from '@grafana/runtime' 4 | import { ClientDelegate } from 'lib/client_delegate' 5 | 6 | export const useOpenNMSClient = (datasource: DataSourceRef | null | undefined) => { 7 | const [client, setClient] = useState() 8 | 9 | useEffect(() => { 10 | const updateDatasource = async () => { 11 | const datasources = getDataSourceSrv() 12 | const datasourceObject: any = await datasources.get(datasource) 13 | setClient(datasourceObject.client); 14 | } 15 | 16 | if (datasource) { 17 | updateDatasource(); 18 | } 19 | }, [datasource]) 20 | 21 | return { client } 22 | } 23 | -------------------------------------------------------------------------------- /src/components/FieldDisplay.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | interface FieldDisplayProps { 4 | icon?: boolean 5 | color?: string 6 | children?: any 7 | } 8 | export const FieldDisplay: React.FC = ({children, icon, color}) => { 9 | return ( 10 |
{children}
21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /src/datasources/entity-ds/EntityConfigEditor.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { DataSourcePluginOptionsEditorProps } from '@grafana/data' 3 | import { DataSourceHttpSettings } from '@grafana/ui' 4 | import { EntityDataSourceOptions } from './types' 5 | import { ClearFilterData } from '../../components/ClearFilterData' 6 | 7 | interface Props extends DataSourcePluginOptionsEditorProps { } 8 | 9 | export const EntityConfigEditor: React.FC = ({ onOptionsChange, options }) => { 10 | return ( 11 | <> 12 | 17 | 18 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /.config/types/custom.d.ts: -------------------------------------------------------------------------------- 1 | // Image declarations 2 | declare module '*.gif' { 3 | const src: string; 4 | export default src; 5 | } 6 | 7 | declare module '*.jpg' { 8 | const src: string; 9 | export default src; 10 | } 11 | 12 | declare module '*.jpeg' { 13 | const src: string; 14 | export default src; 15 | } 16 | 17 | declare module '*.png' { 18 | const src: string; 19 | export default src; 20 | } 21 | 22 | declare module '*.webp' { 23 | const src: string; 24 | export default src; 25 | } 26 | 27 | declare module '*.svg' { 28 | const content: string; 29 | export default content; 30 | } 31 | 32 | // Font declarations 33 | declare module '*.woff'; 34 | declare module '*.woff2'; 35 | declare module '*.eot'; 36 | declare module '*.ttf'; 37 | declare module '*.otf'; 38 | -------------------------------------------------------------------------------- /.config/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG grafana_version=latest 2 | ARG grafana_image=grafana-enterprise 3 | 4 | FROM grafana/${grafana_image}:${grafana_version} 5 | 6 | # Make it as simple as possible to access the grafana instance for development purposes 7 | # Do NOT enable these settings in a public facing / production grafana instance 8 | ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin" 9 | ENV GF_AUTH_ANONYMOUS_ENABLED "true" 10 | ENV GF_AUTH_BASIC_ENABLED "false" 11 | # Set development mode so plugins can be loaded without the need to sign 12 | ENV GF_DEFAULT_APP_MODE "development" 13 | 14 | # Inject livereload script into grafana index.html 15 | USER root 16 | RUN sed -i 's/<\/body><\/html>/