{"_id":"56312e4024014b0d00bd9a48","user":"55c50f4a7c199a2f00665cbf","category":{"_id":"55d3b645f77e6d0d00b1b27c","__v":4,"pages":["55d3b647f77e6d0d00b1b286","55d3b647f77e6d0d00b1b287","55d3b647f77e6d0d00b1b288","55d3b647f77e6d0d00b1b289","55d3b647f77e6d0d00b1b28a","55d3b647f77e6d0d00b1b28b","55d3b647f77e6d0d00b1b28c","55d3b647f77e6d0d00b1b28d","55d3b647f77e6d0d00b1b28e","55d3b647f77e6d0d00b1b28f","55d3b647f77e6d0d00b1b290","55d3b647f77e6d0d00b1b291","562ea6c53b2af20d006ad03d","56312e4024014b0d00bd9a48","564e4d122b223c2b00496a27"],"project":"55c505b41469ad2500fa2ab7","version":"55d3b644f77e6d0d00b1b273","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-10T18:45:23.276Z","from_sync":false,"order":9,"slug":"integration-guides","title":"Integration Guides"},"project":"55c505b41469ad2500fa2ab7","parentDoc":null,"__v":8,"version":{"_id":"55d3b644f77e6d0d00b1b273","project":"55c505b41469ad2500fa2ab7","__v":6,"createdAt":"2015-08-18T22:48:36.632Z","releaseDate":"2015-08-18T22:48:36.632Z","categories":["55d3b645f77e6d0d00b1b274","55d3b645f77e6d0d00b1b275","55d3b645f77e6d0d00b1b276","55d3b645f77e6d0d00b1b277","55d3b645f77e6d0d00b1b278","55d3b645f77e6d0d00b1b279","55d3b645f77e6d0d00b1b27a","55d3b645f77e6d0d00b1b27b","55d3b645f77e6d0d00b1b27c","55d3b645f77e6d0d00b1b27d","55d7c2939510f00d007ec6fe","56fac9925df15a20002972a2","56fb2f7668e1d30e00a0b672","583498d411e8af2500f6b334","58e52a180ab7b03b00f4a97a"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-28T20:21:20.583Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":12,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"For PagerDuty + Nagios users\",\n  \"body\": \"If you are pushing your Nagios alerts to PagerDuty, Neptune.io will receive from PagerDuty so directly go to PagerDuty integration.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"For Nagios users who can manually modify the config directly\",\n  \"body\": \"Please see [Nagios Integration Guide](http://docs.neptune.io/docs/nagios-integration) instead\"\n}\n[/block]\nThese are the steps for integrating Nagios and Neptune.io using Centreon web UI instead of changing Nagios config manually.\n\n## Step 1: Download `notify_neptuneio_centreon.py` to /usr/local/bin. \n\nThis might need sudo permissions. Also, make sure the file is executable.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"wget https://raw.githubusercontent.com/neptuneio/nagios-integration/master/notify_neptuneio_centreon.py\\nchmod 755 notify_neptuneio_centreon.py\\ncp notify_neptuneio_centreon.py /usr/local/bin\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n## Step 2:  Install required python modules on the Nagios server\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"sudo pip install simplejson\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n## Step 3: Add notification actions from Centreon which invoke this script\n\nFrom the Centreon web UI, go to `Configuration -> Commands -> Notifications` and add the following two actions by adding the following content for command line.\n\n**Notification action for Hosts:**\n\nCopy this text and put it in command line.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"/usr/local/bin/notify_neptuneio_centreon.py --api_key $CONTACTPAGER$ --type host --event '{\\\"HOSTDISPLAYNAME\\\":\\\"$HOSTDISPLAYNAME$\\\",\\\"HOSTSTATEID\\\":\\\"$HOSTSTATEID$\\\",\\\"HOSTSTATETYPE\\\":\\\"$HOSTSTATETYPE$\\\",\\\"HOSTPROBLEMID\\\":\\\"$HOSTPROBLEMID$\\\",\\\"LASTHOSTPROBLEMID\\\":\\\"$LASTHOSTPROBLEMID$\\\",\\\"HOSTOUTPUT\\\":\\\"$HOSTOUTPUT$\\\",\\\"HOSTCHECKCOMMAND\\\":\\\"$HOSTCHECKCOMMAND$\\\",\\\"HOSTGROUPNAME\\\":\\\"$HOSTGROUPNAME$\\\",\\\"SERVICEDISPLAYNAME\\\":\\\"$SERVICEDISPLAYNAME$\\\",\\\"SERVICESTATEID\\\":\\\"$SERVICESTATEID$\\\",\\\"SERVICESTATETYPE\\\":\\\"$SERVICESTATETYPE$\\\",\\\"SERVICEPROBLEMID\\\":\\\"$SERVICEPROBLEMID$\\\",\\\"LASTSERVICEPROBLEMID\\\":\\\"$LASTSERVICEPROBLEMID$\\\",\\\"SERVICEOUTPUT\\\":\\\"$SERVICEOUTPUT$\\\",\\\"LONGDATETIME\\\":\\\"$LONGDATETIME$\\\"}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nFinish the remaining steps and add the host notification command as described below.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/toWSybJqQXusupgazYM4_Centreon-Host.png\",\n        \"Centreon-Host.png\",\n        \"1919\",\n        \"660\",\n        \"#5e5ab1\",\n        \"\"\n      ],\n      \"caption\": \"Centreon Host notification command\"\n    }\n  ]\n}\n[/block]\n**Notification action for Services:**\n\nCopy this text and put it in command line.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"/usr/local/bin/notify_neptuneio_centreon.py --api_key $CONTACTPAGER$ --type service --event '{\\\"HOSTDISPLAYNAME\\\":\\\"$HOSTDISPLAYNAME$\\\",\\\"HOSTSTATEID\\\":\\\"$HOSTSTATEID$\\\",\\\"HOSTSTATETYPE\\\":\\\"$HOSTSTATETYPE$\\\",\\\"HOSTPROBLEMID\\\":\\\"$HOSTPROBLEMID$\\\",\\\"LASTHOSTPROBLEMID\\\":\\\"$LASTHOSTPROBLEMID$\\\",\\\"HOSTOUTPUT\\\":\\\"$HOSTOUTPUT$\\\",\\\"HOSTCHECKCOMMAND\\\":\\\"$HOSTCHECKCOMMAND$\\\",\\\"HOSTGROUPNAME\\\":\\\"$HOSTGROUPNAME$\\\",\\\"SERVICEDISPLAYNAME\\\":\\\"$SERVICEDISPLAYNAME$\\\",\\\"SERVICESTATEID\\\":\\\"$SERVICESTATEID$\\\",\\\"SERVICESTATETYPE\\\":\\\"$SERVICESTATETYPE$\\\",\\\"SERVICEPROBLEMID\\\":\\\"$SERVICEPROBLEMID$\\\",\\\"LASTSERVICEPROBLEMID\\\":\\\"$LASTSERVICEPROBLEMID$\\\",\\\"SERVICEOUTPUT\\\":\\\"$SERVICEOUTPUT$\\\",\\\"LONGDATETIME\\\":\\\"$LONGDATETIME$\\\"}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nFinish the remaining steps and add the service notification command as described below.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/pKxQ4J1HQBmGobylLh9w_Centreon-Service.png\",\n        \"Centreon-Service.png\",\n        \"1916\",\n        \"616\",\n        \"#615fdb\",\n        \"\"\n      ],\n      \"caption\": \"Centreon service notification command.\"\n    }\n  ]\n}\n[/block]\n## Step 4: Create neptuneio user and attach the notification commands to user.\n\nFollow the steps outlined in the below images and add a new user as `neptuneio` and add both the host and service notification commands to the user.\n\nIf you would like to reuse an existing user, you just need to add the notification commands and Neptune API key as the PAGER.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/OZdWOInzQaSSqhvJiDvt_Centreon-AddUser.png\",\n        \"Centreon-AddUser.png\",\n        \"1904\",\n        \"949\",\n        \"#5e5c9f\",\n        \"\"\n      ],\n      \"caption\": \"Add new user in Centreon and attach notification actions.\"\n    }\n  ]\n}\n[/block]\n## Step 4: Modify all the host and service configurations to notify the new user for different notifications.\n\nYou can skip this if you have added the notification commands to an existing user or group, which is already getting all the notifications.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/qzMedGhPRemDrJdpSwwa_Centreon-ServiceConfig.png\",\n        \"Centreon-ServiceConfig.png\",\n        \"1909\",\n        \"943\",\n        \"#5d5da2\",\n        \"\"\n      ],\n      \"caption\": \"Change Centreon service/host config to notify Neptune.\"\n    }\n  ]\n}\n[/block]\nYou might have to restart Nagios server after this configuration changes to get Nagios alerts into Neptune. Grep for \"neptune\" in nagios logs to debug issues of whether the notification commands are being executed or not.","excerpt":"","slug":"nagios-centreon","type":"basic","title":"Nagios + Centreon"}
[block:callout] { "type": "info", "title": "For PagerDuty + Nagios users", "body": "If you are pushing your Nagios alerts to PagerDuty, Neptune.io will receive from PagerDuty so directly go to PagerDuty integration." } [/block] [block:callout] { "type": "info", "title": "For Nagios users who can manually modify the config directly", "body": "Please see [Nagios Integration Guide](http://docs.neptune.io/docs/nagios-integration) instead" } [/block] These are the steps for integrating Nagios and Neptune.io using Centreon web UI instead of changing Nagios config manually. ## Step 1: Download `notify_neptuneio_centreon.py` to /usr/local/bin. This might need sudo permissions. Also, make sure the file is executable. [block:code] { "codes": [ { "code": "wget https://raw.githubusercontent.com/neptuneio/nagios-integration/master/notify_neptuneio_centreon.py\nchmod 755 notify_neptuneio_centreon.py\ncp notify_neptuneio_centreon.py /usr/local/bin", "language": "shell" } ] } [/block] ## Step 2: Install required python modules on the Nagios server [block:code] { "codes": [ { "code": "sudo pip install simplejson", "language": "shell" } ] } [/block] ## Step 3: Add notification actions from Centreon which invoke this script From the Centreon web UI, go to `Configuration -> Commands -> Notifications` and add the following two actions by adding the following content for command line. **Notification action for Hosts:** Copy this text and put it in command line. [block:code] { "codes": [ { "code": "/usr/local/bin/notify_neptuneio_centreon.py --api_key $CONTACTPAGER$ --type host --event '{\"HOSTDISPLAYNAME\":\"$HOSTDISPLAYNAME$\",\"HOSTSTATEID\":\"$HOSTSTATEID$\",\"HOSTSTATETYPE\":\"$HOSTSTATETYPE$\",\"HOSTPROBLEMID\":\"$HOSTPROBLEMID$\",\"LASTHOSTPROBLEMID\":\"$LASTHOSTPROBLEMID$\",\"HOSTOUTPUT\":\"$HOSTOUTPUT$\",\"HOSTCHECKCOMMAND\":\"$HOSTCHECKCOMMAND$\",\"HOSTGROUPNAME\":\"$HOSTGROUPNAME$\",\"SERVICEDISPLAYNAME\":\"$SERVICEDISPLAYNAME$\",\"SERVICESTATEID\":\"$SERVICESTATEID$\",\"SERVICESTATETYPE\":\"$SERVICESTATETYPE$\",\"SERVICEPROBLEMID\":\"$SERVICEPROBLEMID$\",\"LASTSERVICEPROBLEMID\":\"$LASTSERVICEPROBLEMID$\",\"SERVICEOUTPUT\":\"$SERVICEOUTPUT$\",\"LONGDATETIME\":\"$LONGDATETIME$\"}'", "language": "shell" } ] } [/block] Finish the remaining steps and add the host notification command as described below. [block:image] { "images": [ { "image": [ "https://files.readme.io/toWSybJqQXusupgazYM4_Centreon-Host.png", "Centreon-Host.png", "1919", "660", "#5e5ab1", "" ], "caption": "Centreon Host notification command" } ] } [/block] **Notification action for Services:** Copy this text and put it in command line. [block:code] { "codes": [ { "code": "/usr/local/bin/notify_neptuneio_centreon.py --api_key $CONTACTPAGER$ --type service --event '{\"HOSTDISPLAYNAME\":\"$HOSTDISPLAYNAME$\",\"HOSTSTATEID\":\"$HOSTSTATEID$\",\"HOSTSTATETYPE\":\"$HOSTSTATETYPE$\",\"HOSTPROBLEMID\":\"$HOSTPROBLEMID$\",\"LASTHOSTPROBLEMID\":\"$LASTHOSTPROBLEMID$\",\"HOSTOUTPUT\":\"$HOSTOUTPUT$\",\"HOSTCHECKCOMMAND\":\"$HOSTCHECKCOMMAND$\",\"HOSTGROUPNAME\":\"$HOSTGROUPNAME$\",\"SERVICEDISPLAYNAME\":\"$SERVICEDISPLAYNAME$\",\"SERVICESTATEID\":\"$SERVICESTATEID$\",\"SERVICESTATETYPE\":\"$SERVICESTATETYPE$\",\"SERVICEPROBLEMID\":\"$SERVICEPROBLEMID$\",\"LASTSERVICEPROBLEMID\":\"$LASTSERVICEPROBLEMID$\",\"SERVICEOUTPUT\":\"$SERVICEOUTPUT$\",\"LONGDATETIME\":\"$LONGDATETIME$\"}'", "language": "shell" } ] } [/block] Finish the remaining steps and add the service notification command as described below. [block:image] { "images": [ { "image": [ "https://files.readme.io/pKxQ4J1HQBmGobylLh9w_Centreon-Service.png", "Centreon-Service.png", "1916", "616", "#615fdb", "" ], "caption": "Centreon service notification command." } ] } [/block] ## Step 4: Create neptuneio user and attach the notification commands to user. Follow the steps outlined in the below images and add a new user as `neptuneio` and add both the host and service notification commands to the user. If you would like to reuse an existing user, you just need to add the notification commands and Neptune API key as the PAGER. [block:image] { "images": [ { "image": [ "https://files.readme.io/OZdWOInzQaSSqhvJiDvt_Centreon-AddUser.png", "Centreon-AddUser.png", "1904", "949", "#5e5c9f", "" ], "caption": "Add new user in Centreon and attach notification actions." } ] } [/block] ## Step 4: Modify all the host and service configurations to notify the new user for different notifications. You can skip this if you have added the notification commands to an existing user or group, which is already getting all the notifications. [block:image] { "images": [ { "image": [ "https://files.readme.io/qzMedGhPRemDrJdpSwwa_Centreon-ServiceConfig.png", "Centreon-ServiceConfig.png", "1909", "943", "#5d5da2", "" ], "caption": "Change Centreon service/host config to notify Neptune." } ] } [/block] You might have to restart Nagios server after this configuration changes to get Nagios alerts into Neptune. Grep for "neptune" in nagios logs to debug issues of whether the notification commands are being executed or not.