{"id":34300858,"url":"https://github.com/naparuba/opsbro","last_synced_at":"2026-03-11T20:03:00.354Z","repository":{"id":27843500,"uuid":"31333676","full_name":"naparuba/opsbro","owner":"naparuba","description":"Ops Best friend","archived":false,"fork":false,"pushed_at":"2024-09-22T13:41:02.000Z","size":7298,"stargazers_count":38,"open_issues_count":56,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-12-20T17:55:16.479Z","etag":null,"topics":["agent","automatic-detection","collector","configuration-automation","graphite","kv-store","metrics","metrology","monitoring","node-cluster","python","service-discovery","system-compliance","udp-port"],"latest_commit_sha":null,"homepage":"http://opsbro.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naparuba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-25T20:14:35.000Z","updated_at":"2024-11-03T22:45:49.000Z","dependencies_parsed_at":"2024-09-14T10:41:31.008Z","dependency_job_id":"bdf812b5-50d8-45fb-b831-e9979dec0e8a","html_url":"https://github.com/naparuba/opsbro","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/naparuba/opsbro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naparuba%2Fopsbro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naparuba%2Fopsbro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naparuba%2Fopsbro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naparuba%2Fopsbro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naparuba","download_url":"https://codeload.github.com/naparuba/opsbro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naparuba%2Fopsbro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30398185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T18:46:22.935Z","status":"ssl_error","status_checked_at":"2026-03-11T18:46:17.045Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["agent","automatic-detection","collector","configuration-automation","graphite","kv-store","metrics","metrology","monitoring","node-cluster","python","service-discovery","system-compliance","udp-port"],"created_at":"2025-12-17T06:23:51.219Z","updated_at":"2026-03-11T20:03:00.350Z","avatar_url":"https://github.com/naparuba.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\n[![Build Status](https://travis-ci.org/naparuba/opsbro.svg)](https://travis-ci.org/naparuba/opsbro)\n\n\n## **OpsBro**\n\n\n![Agent](images/cli-header.png)\n\nAll the configuration / deployment is model based (aka into **packs**)\n\n\n## Installation\n\n#### Prerequites\nYou will need:\n\n  * python (2.6, 2.7 or 3.4+ versions)\n\n\n#### Installation\n\nJust launch:\n\n    python setup.py install\n\nExample of the installation at:\n\n\u003ca target=\"blank\" href=\"https://asciinema.org/a/IQYFa6xv4NBTGjbcKLH8uFLtR\"\u003e\u003cimg src=\"https://asciinema.org/a/IQYFa6xv4NBTGjbcKLH8uFLtR.png\" height=\"300\" width=\"200\" /\u003e\u003c/a\u003e\n\n\nNote: main linux distributions are managed and will automatically install dependencies from the package manager (apt/yum/apk/zypper):\n * Alpine 3.1→3.7\n * Amazonlinux 2016 \u0026 2017\n * Centos 6 \u0026 7\n * Debian 6→9\n * Fedora 24→28\n * OpenSuse 42\n * Ubuntu 12.04→18.10\n\n\nOn others distributions depedencies will be take from pypi.\n\n\n## Start OpsBro daemon\nYou can start opsbro as a daemon with:\n \n    service opsbro start\n\n\n## Stop OpsBro daemon\nJust launch:\n  \n    service opsbro stop\n\n\n## Display OpsBro information\nJust launch:\n\n    opsbro agent info\n\nYou will have several information about the current opsbro agent state:\n\n\n\u003ca target=\"blank\" href=\"https://asciinema.org/a/SV1Viswbm6TDOmnA74Ej5gTnp\"\u003e\u003cimg src=\"https://asciinema.org/a/SV1Viswbm6TDOmnA74Ej5gTnp.png\" height=\"300\" width=\"200\" /\u003e\u003c/a\u003e\n\n\n\n## Automatic detection (os, apps, location, ...)\n\nDetectors are rules that are executed by the agent to detect your server properties like\n\n * OS (linux, redhat, centos, debian, windows, ...)\n * Applications (mongodb, redis, mysql, apache, ...)\n * Location (country, city, GPS Lat/Long)\n\nYou should declare a json object like:\n\n    detector:\n        apply_if: \"grep_file('centos', '/etc/redhat-release')\"\n        add_groups:\n            - linux\n            - centos\n        interval: 3600s\n\n * If there is the string centos in the file /etc/redhat-release\n * Then add the group \"linux\" and centos\" to the local agent\n * Execute every 3600 seconds\n\n\n## Service discovery\n\nYou can use OpsBro on one or more server in an independant way, but it's full power is when you are linking them together in a cluster.\n\n#### Agent cluster membership\n\n##### Add your local node to the node cluster\n\nFirst you need to install and launch the node in another server.\n\nThen in this other server you can launch:\n  \n    opsbro gossip join  OTHER-IP\n\n##### Auto discover LAN nodes (UDP broadcast detection)\n\nIf your nodes are on the same LAN, you can use the UDP auto-detection to list others nodes on your network. I will send an UDP broadcast packet that other nodes will answer.\n\nNOTE: if you are using an encryption key (recommanded) then you must already have set it. If not, the other node won't answer to your query.\n\n    opsbro gossip detect --auto-join\n\n\n![Agent](images/gossip-detect.png)\n\n##### List your opsbro cluster members\nYou can list the cluster members on all nodes with :\n\n    opsbro  gossip members\n\n![Agent](images/gossip-members.png)\n\n\n\n## Metrology: collect your server metrics (cpu, kernel, databases metrics, etc)\n\nCollectors are code executed by the agent to grok and store local os or application metrics. \n\nYou can list available collectors with the command:\n\n    opsbro collectors list\n \n \n![Agent](images/collectors-list.png)\n\n\n## How to see collected data? (metrology)\n\nThe opsbro agent is by default getting lot of metrology data from your OS and applications. It's done by \"collctors\" objets. You can easily list them and look at the collected data by launching:\n\n    opsbro collectors show system\n\nFor example for the system collector:\n\n![Agent](images/collectors-show-system.png)\n\n\n## Show dashboards\n\nPacks can provide dashboards to show collected data. Here is an example of the standard linux dashboard:\n\n    opsbro dashboards show linux\n\n![Agent](images/dashboards-show-linux.png)\n\n\nTo list available dashboards:\n   opsbro dashboards list\n\n\n## Export and store your application telemetry into the agent metric system\n\n### Real time application performance metrics\n\nThe statsd protocol is a great way to extract performance statistics from your application into your monitoring system. You application will extract small timing metrics (like function execution time) and send it in a non blocking way (in UDP).\n\nThe statsd daemon part will agregate counters for 10s and will then export the min/max/average/99thpercentile to a graphite server so you can store and graph them.\n\nIn order to enable the statsd listener, you must define enable it your configuration.\n\nYou can show it with the command:\n\n    opsbro packs show\n\nAnd search for the statsd pack:\n\n![Agent](images/packs-show-statsd.png)\n\nAll you need is to change the enabled parameter of the statsd pack.\n\nYou can get a description about the parameter first with:\n\n    opsbro packs parameters get global.statsd.enabled\n\nAnd you can edit it with:\n\n    opsbro packs parameters set global.statsd.enabled true\n\n\n![Agent](images/pack-parameters-get-statsd.png)\n\nThen restart our agent:\n\n    service opsbro restart\n\n\n## Grafana: view your node metrology data into Grafana\n\nYou can see your metrology data into Grafana. All you need to do is to enable the grafana pack for this.\n\n![Agent](images/packs-show-grafana.png)\n\nYou will need:\n  * set a grafana API key\n  * change the grafana URI if not on the same server as your agent\n  * add the group **grafana-connector** to your agent so it will start the grafana module\n\n    opsbro packs parameters set  global.grafana.api_key  'YOUR-API-KEY'\n    opsbro packs parameters set  global.grafana.uri      'http://YOUR-GRAFANA-SERVER:3000'\n\n\nAnd to add the group **grafana-connector** to your agent:\n\n    opsbro agent parameters add groups grafana-connector\n\nAnd voila, you will see a new data-source in your grafana:\n\n![Agent](images/grafana-screen.png)\n\n\n## Monitoring\n\nYou can execute checks on your agent by two means:\n  * Use the collectors data and evaluate check rule on it\n  * Execute a nagios-like plugin\n\n### Common check parameters for evaluated and nagios plugins based checks\n\nSome parameters are common on the two check types you can defined.\n\n  * interval: how much seconds the checks will be scheduled\n  * if_group: if present, will declare and execute the check only if the agent group is present\n\n\n### Evaluate check rule on collectors data\n\nEvaluated check will use collectors data and should be defined with:\n  * ok_output: python expression that create a string that will be shown to the user if the state is OK\n  * critical_if: python expression that try to detect a CRITICAL state\n  * critical_output: python expression that create a string that will be shown to the user if the state is CRITICAL\n  * warning_if: python expression that try to detect WARNING state\n  * warning_output: python expression that create a string that will be shown to the user if the state is WARNING\n  * interval: launch the check every X seconds\n  \nThe evaluation is done like this:\n  * if the critical expression is True =\u003e CRITICAL\n  * else if warning expression is True =\u003e WARNING\n  * else go OK\n  \nFor example here is a memory check on a linux server:\n\n    check:\n        if_group: linux\n\n        ok_output: \"'OK: memory is at %d%%' % {{collector.memory.phys_used}}\"\n\n        critical_if: \"{{collector.memory.phys_used}} \u003e {{parameters.memory_critical}}\"\n        critical_output: \"'CRITICAL: memory is at %d%%' % {{collectors.memory.phys_used}}\"\n\n        warning_if: \"{{collector.memory.phys_used}} \u003e {{parameters.threshold.memory_warning}}\"\n        warning_output:  \"'WARNING: memory is at %d%%' % {{collector.memory.phys_used}}\"\n\n        interval: \"30s\"\n            \nYou can have the result with the command:\n\n    opsbro monitoring state\n\n\n![Agent](images/monitoring-state.png)\n\n\n### Use Nagios plugins\n\nNagios based checks will use Nagios plugins and run them. Use them if you don't have access to the information you need in the collectors.\n\nThe parameter for this is:\n  * script: the command line to execute your plugin\n  \n  Here is an example \n  \n    check:\n        if_group: linux\n        script:   \"/var/lib64/nagios/check_mailq -w 1 -c 2\"\n        interval: 60s\n\n\n## Notify check/node state change with emails\n\nYou can be notified about check state changed with handlers. Currently 2 are managed:\n\n * email\n * slack\n\n### Email handlers\n\nYou can get a mail each time a check did change state. All is managed by the mail pack. You can enable it with:\n\n    opsbro packs parameters set global.mail.enabled true\n\n\n## Notify check \u0026 node state change into slack\n\nYou can be notified about check state changed with handlers:\n\n![Agent](images/slack.png)\n\n  * token: your slack token. Get one at https://api.slack.com/custom-integrations/legacy-tokens\n  * channel: on which channel should the alerts go. If the channel is not existing, it will try to create one\n\nYou can enable it with:\n\n    opsbro agent parameters add groups slack\n    opsbro packs parameters set global.slack.token    'SLACK-TOKEN'\n\n\n## Export your nodes and check states into Shinken or Nagios\n\nYou can export all your nodes informations (new, deleted or change node) into your Shinken installation. It will automatically:\n  * create new host when you start a new node\n  * change the host configuration (host templates) when a new group is add/removed on your agent\n  * remove your host when you delete your agent (by terminating your Cloud instance for example)\n\nAll is managed into the shinken pack.\n\nFor Nagios:\n\n    opsbro  packs parameters set local.shinken.enabled               true\n    opsbro  packs parameters set local.shinken.cfg_path              /usr/local/nagios/etc/objects/agent\n    opsbro  packs parameters set local.shinken.external_command_file /usr/local/nagios/var/rw/nagios.cmd\n    opsbro  packs parameters set local.shinken.reload_command        \"/etc/init.d/nagios reload\"\n    opsbro  packs parameters set local.shinken.monitoring_tool       nagios\n\nNote that you must create the /usr/local/nagios/etc/objects/agent and declare it in the nagios.cfg file.\n\nFor Shinken:\n\n    opsbro  packs parameters set local.shinken.enabled               true\n    opsbro  packs parameters set local.shinken.cfg_path              /etc/shinken/agent\n    opsbro  packs parameters set local.shinken.external_command_file /var/lib/shinken/shinken.cmd\n    opsbro  packs parameters set local.shinken.reload_command        \"/etc/init.d/shinken reload\"\n    opsbro  packs parameters set local.shinken.monitoring_tool       shinken\n\nFor Shinken, note that the external unix pipe (/var/lib/shinken/shinken.cmd) is available with the receiver module [named-pipe](http://shinken.io/package/named-pipe).\n\n\n## DNS: Access your nodes informations by DNS\n\nIf you enable the DNS interface for your agent, it will start an internal DNS server that will answer to queries. So your applications will be able to easily exchange with the valid node that is still alive or launched.\n\nAll you need is to set your agent to the dns-listener group to start the DNS listener module.\n\n    opsbro agent parameters add groups dns-listener\n\nThen you can query your agent in DNS:\n\n    dig -p 6766  @127.0.0.1 linux.group.local.opsbro\n    192.168.56.103\n    192.168.56.105\n\nIt list all available node with the \"group\" linux.\n\n\n## Is there an UI available?\n\nSoon :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaparuba%2Fopsbro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaparuba%2Fopsbro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaparuba%2Fopsbro/lists"}