{"id":20338386,"url":"https://github.com/alerta/nagios-alerta","last_synced_at":"2025-04-11T23:11:42.178Z","repository":{"id":10914914,"uuid":"13213948","full_name":"alerta/nagios-alerta","owner":"alerta","description":"Forward nagios alerts to the alerta monitoring system","archived":false,"fork":false,"pushed_at":"2021-11-09T21:03:09.000Z","size":3701,"stargazers_count":24,"open_issues_count":3,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-11T23:11:37.807Z","etag":null,"topics":["alerta","event-broker","naemon","nagios","nagios3","nagios4"],"latest_commit_sha":null,"homepage":"http://alerta.io","language":"C","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/alerta.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}},"created_at":"2013-09-30T11:53:59.000Z","updated_at":"2024-11-07T15:51:47.000Z","dependencies_parsed_at":"2022-08-27T11:33:40.717Z","dependency_job_id":null,"html_url":"https://github.com/alerta/nagios-alerta","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fnagios-alerta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fnagios-alerta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fnagios-alerta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alerta%2Fnagios-alerta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alerta","download_url":"https://codeload.github.com/alerta/nagios-alerta/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492877,"owners_count":21113163,"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":["alerta","event-broker","naemon","nagios","nagios3","nagios4"],"created_at":"2024-11-14T21:12:58.858Z","updated_at":"2025-04-11T23:11:42.148Z","avatar_url":"https://github.com/alerta.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nagios-to-Alerta Gateway\n========================\n\n[![build-test](https://github.com/alerta/nagios-alerta/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/alerta/nagios-alerta/actions/workflows/test.yml)\n\nConsolidate Nagios alerts from across multiple sites into a single\n\"at-a-glance\" console. Nagios 3 and Nagios 4 are now supported.\n\nTransform this ...\n\n![nagios](/docs/images/nagios3-v3.png?raw=true)\n\nInto this ...\n\n![alerta](/docs/images/nagios3-alerta-v3.png?raw=true)\n\nSystem Requirements\n------------\n\nYou'll need the following system packages to Install nagios-alerta:\n\nIn RedHat/CentOS/Fedora:\n```\nyum install -y git curl gcc make libcurl-devel jansson-devel\n```\n\nIn Debian/Ubuntu:\n```\napt-get install -y git-core curl gcc make libcurl4-openssl-dev libjansson-dev libglib2.0-dev pkg-config\n```\n\nInstallation (Nagios 3)\n------------\n\n    $ git clone https://github.com/alerta/nagios-alerta.git\n    $ cd nagios-alerta\n    $ make\n    $ sudo make install\n    $ sudo service nagios restart\n\nInstallation (Nagios 4)\n------------\n\n    $ git clone https://github.com/alerta/nagios-alerta.git\n    $ cd nagios-alerta\n    $ make nagios4\n    $ sudo make install\n    $ sudo service nagios restart\n\nAlerts\n------\n\nTo forward host and service check results to Alerta,\nmodify `/etc/nagios/nagios.cfg` as follows:\n```\nbroker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080\n```\n\nTo specify the environment name:\n```\nbroker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080 env=ENV_NAME_HERE\n```\nTo specify the customer name:\n```\nbroker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080 customer=CUSTOMER_NAME_HERE\n```\nTo provide the API key if authentication is enabled on the alerta server:\n```\nbroker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080 key=INSERT_API_KEY_HERE\n```\n\nTo forward check results in Hard state only:\n```\nbroker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080 hard_only=1\n```\n\nAnd to enable debug mode:\n```\nbroker_module=/usr/lib/nagios/alerta-neb.o http://localhost:8080 debug=1\n```\n\n**Note:** The default `environment` is `Production` and the default `service` is `Platform`.\n\nSetting Environment \u0026 Service Per-Check\n---------------------------------------\n\nUse [custom object variables](https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/customobjectvars.html)\n`_Environment` and `_Service` to set environment and service on a\nper-check basis:\n\n```\ndefine host{\n        use                     generic-host            ; Name of host template to use\n        host_name               localhost\n        alias                   localhost\n        address                 127.0.0.1\n        _Environment            Development\n        _Service                Network\n        }\n```\n\n```\ndefine service{\n        use                             generic-service         ; Name of service template to use\n        host_name                       localhost\n        service_description             Total Processes\n        _Environment                    Production\n        _Service                        Web\n        check_command                   check_procs!250!400\n        }\n```\n\n\nSetting Customer Per-Check\n--------------------------\n\nUse [custom object variables](https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/customobjectvars.html) to set [customer_views](http://alerta.readthedocs.io/en/latest/customer-views.html)\n\n```\ndefine host{\n        use                     generic-host            ; Name of host template to use\n        host_name               localhost\n        alias                   localhost\n        address                 127.0.0.1\n        _Customer               Customer1\n        }\n```\n\n```\ndefine service{\n        use                             generic-service         ; Name of service template to use\n        host_name                       localhost\n        service_description             Total Processes\n        _Customer                       Customer1\n        check_command                   check_procs!250!400\n        }\n```\n\n\nHeartbeats\n----------\n\nTo configure the Nagios server to send regular heartbeats to Alerta to\nensure that Nagios and the event broker are still forwarding alerts\nconfigure a dummy service check as follows:\n\n1. Define a heartbeat command and add it to `/etc/nagios/commands.cfg`:\n```\ndefine command{\n        command_name    check_heartbeat\n        command_line    /usr/lib/nagios/plugins/check_dummy 0\n}\n```\n\n2. Define a hostgroup for the Nagios servers that have the Alerta event\nbroker installed and add it to `/etc/nagios3/conf.d/hostgroups_nagios2.cfg`:\n```\ndefine hostgroup {\n        hostgroup_name  nagios-servers\n        alias           Nagios servers\n        members         localhost\n}\n```\n\n3. Define a Heartbeat service check to execute every minute and add it\nto `/etc/nagios/conf.d/services_nagios2.cfg`:\n```\ndefine service {\n        hostgroup_name                  nagios-servers\n        service_description             Heartbeat\n        check_command                   check_heartbeat\n        use                             generic-service\n        notification_interval           0 ; set \u003e 0 if you want to be renotified\n        normal_check_interval           1\n}\n```\n\nLicense\n-------\n\nCopyright (c) 2013-2019 Nick Satterly. Available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falerta%2Fnagios-alerta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falerta%2Fnagios-alerta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falerta%2Fnagios-alerta/lists"}