{"id":19236907,"url":"https://github.com/crunchydata/exporter2perfdata","last_synced_at":"2025-04-21T05:32:42.267Z","repository":{"id":40543819,"uuid":"366780348","full_name":"CrunchyData/exporter2perfdata","owner":"CrunchyData","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-26T11:19:13.000Z","size":72,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T10:35:35.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrunchyData.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-12T16:25:55.000Z","updated_at":"2022-08-09T07:40:35.000Z","dependencies_parsed_at":"2022-06-29T20:43:52.224Z","dependency_job_id":null,"html_url":"https://github.com/CrunchyData/exporter2perfdata","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fexporter2perfdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fexporter2perfdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fexporter2perfdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fexporter2perfdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrunchyData","download_url":"https://codeload.github.com/CrunchyData/exporter2perfdata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250002309,"owners_count":21359092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T16:24:00.744Z","updated_at":"2025-04-21T05:32:41.977Z","avatar_url":"https://github.com/CrunchyData.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# exporter2perfdata\n\nexporter2perfdata collects metric from the Prometheus exporters using RESTAPI and converts it to perfdata format for Icinga 2 / Nagios. This module helps Icinga 2 / Nagios to consume metric from Prometheus exporters.\n\n## How to compile\n\nIncremental make\n```\nmake\n```\n\nor\n\nClean and make\n```\nmake clean all\n```\n\n\n## How to test\n\n```\nmake test\n```\n\nInstall\n```\nsudo cp exporter2perfdata /usr/lib64/nagios/plugins/\nsudo chmod 755 /usr/lib64/nagios/plugins/exporter2perfdata\n```\n\n## Usage\n\n```\n./exporter2perfdata -h\n\nexporter2perfdata: 2.0\n\nUsage of exporter2perfdata:\n  -action string\n    \texporter Metric name [REQUIRED]\n  -compare-type int\n    \tCompare Type 0=None,1=GT,2=LT,3=NEQ\n  -critical string\n    \tCritical threshold\n  -exclude string\n    \t\u003cdomain\u003e\u003cvalue\u003e to include\n  -expression string\n    \texpression for calculated values\n  -force-ok\n    \tForce UNKNOWN to return OK status\n  -include string\n    \t\u003cdomain\u003e\u003cvalue\u003e to include\n  -text-values int\n    \tTreat values as TEXT\n  -url string\n    \texporter url http(s)://\u003cip | domain\u003e\u003c:port\u003e [REQUIRED]\n  -version\n    \tPrint version\n  -warning string\n    \tWarning threshold\n```\n\n### Simple capture the metric\n```\n/exporter2perfdata --url=\u003cexporter url \u003e --action=\"\u003cmetric name\u003e\"\n```\n\n### Capture metric and validate results\n\nMetric Value \u003e 3600 will cause a CRITICAL Alert\nMetric Value \u003e 1800 will cause a WARNING Alert\n\n```\n./exporter2perfdata --url=\u003cexporter url\u003e --action=\"\u003cmetric name\u003e\" --compare-type=\"1\" --warning=\"1800\" --critical=\"3600\"\n```\n\nMetric Value \u003c 600 will cause a CRITICAL Alert\nMetric Value \u003c 800 will cause a WARNING Alert\n\n```\n./exporter2perfdata --url=\u003cexporter url\u003e --action=\"\u003cmetric name\u003e\" --compare-type=\"2\" --warning=\"800\" --critical=\"600\"\n```\n\n## Configuration\n\nConfiguration file `exporter2perfdata.conf` needs to be copied to `plugins-contrib.d/` folder.\n\n### Icigna2 config\n\n```\ncp exporter2perfdata.conf to /usr/share/icinga2/include/plugins-contrib.d/\n```\n\n# Icinga2 metric and alert configuration\n\n```\napply Service \"ccp_pg_ready\" {\n  import \"generic-service\"\n\n  check_command    = \"exporter2perfdata\"\n  vars.pg_url      = host.vars.pg_url_node\n\n  vars.pg_action   = \"ccp_pg_ready\"\n  /* Checks to see if the given system is NOT (compare = 3) a primary (return value 2) by default.\n   * Set on a per-host basis to be able to check whether a system is no longer a replica (return value 1)\n   */\n  vars.pg_compare  = \"3\"\n  vars.pg_critical  = host.vars.ccp_pg_ready_critical\n  if (host.vars.ccp_pg_ready_critical == \"\") {\n          vars.pg_critical = \"2\"\n  }\n\n  assign where host.vars.node_common == \"true\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunchydata%2Fexporter2perfdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrunchydata%2Fexporter2perfdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunchydata%2Fexporter2perfdata/lists"}