{"id":23835,"date":"2021-01-22T13:30:10","date_gmt":"2021-01-22T12:30:10","guid":{"rendered":"https:\/\/www.sms77.io\/?post_type=docs&#038;p=23835"},"modified":"2021-12-10T11:00:34","modified_gmt":"2021-12-10T10:00:34","slug":"nagios","status":"publish","type":"docs","link":"https:\/\/www.seven.io\/en\/docs\/third-party-solutions\/nagios\/","title":{"rendered":"Nagios"},"content":{"rendered":"<p><script async defer src=\"https:\/\/buttons.github.io\/buttons.js\"><\/script><br \/>\n<span id='github_buttons' style='display: flex'><br \/>\n<a class=\"github-button\" href=\"https:\/\/github.com\/sms77io\/nagios\" data-icon=\"octicon-star\" aria-label=\"Star sms77io\/nagios on GitHub\" rel=\"noopener\"><\/a><br \/>\n<a class=\"github-button\" href=\"https:\/\/github.com\/sms77io\/nagios\/fork\" data-icon=\"octicon-repo-forked\" aria-label=\"Fork sms77io\/nagios on GitHub\" rel=\"noopener\"><\/a><br \/>\n<a class=\"github-button\" href=\"https:\/\/github.com\/sms77io\/nagios\/subscription\" data-icon=\"octicon-eye\" aria-label=\"Watch sms77io\/nagios on GitHub\" rel=\"noopener\"><\/a><br \/>\n<\/span><br \/>\n<script>\nconst fragment = document.createDocumentFragment();\nfragment.appendChild(document.getElementById('github_buttons'));\nconst dest = document.querySelector(\"article > header.entry-header\");\ndest.style.display = 'flex';\ndest.style['justify-content'] = 'space-between';\ndest.style['margin-right'] = '20px';\ndest.style['margin-bottom'] = '-100px';\ndest.appendChild(fragment);\n<\/script><\/p>\n<h2>What is Nagios?<\/h2>\n<p>Nagios is a monitoring system for complex networks.<\/p>\n<h3>Functionality<\/h3>\n<h4>Send SMS<\/h4>\n<p>Have <a href=\"https:\/\/staging.seven.io\/en\/solutions\/integrations\/nagios\/\" rel=\"noopener\">Nagios<\/a> send SMS alarms via our Gateway by integrating sms77.<\/p>\n<h3>Installation<\/h3>\n<ol>\n<li>Make sure Python 2+ is installed on the system.<\/li>\n<li>Copy <a href=\"https:\/\/github.com\/sms77io\/nagios\/blob\/master\/sms77.py\" rel=\"noopener\">sms77.py<\/a> to the Nagios plugins directory usually in \/usr\/local\/nagios\/libexec.<\/li>\n<\/ol>\n<h3><a id=\"user-content-usage\" class=\"anchor\" href=\"https:\/\/github.com\/sms77io\/nagios#usage\" aria-hidden=\"true\" rel=\"noopener\"><\/a>Usage<\/h3>\n<p>Modify \/usr\/local\/nagios\/etc\/objects\/contacts.cfg:<\/p>\n<pre><code>define contact {\r\n    #...\r\n    pager                         +491234567890\r\n    host_notification_commands    notify-host-by-sms\r\n    service_notification_commands notify-service-by-sms\r\n}\r\n<\/code><\/pre>\n<p>Append to \/usr\/local\/nagios\/etc\/objects\/commands.cfg:<\/p>\n<pre><code># Results in a SMS like:\r\n# RECOVERY: SMS on 127.0.0.1@localhost, State: OK, Output: 100, Date: 01-15-2021 12:30:28\r\ndefine command {\r\n command_name notify-service-by-sms\r\n command_line $USER1$\/sms77.py MY_SMS77_API_KEY $CONTACTPAGER$ \"$NOTIFICATIONTYPE$:$SERVICEDESC$ on $HOSTADDRESS$@$HOSTNAME$, State $SERVICESTATE$, Output: $SERVICEOUTPUT$, Date: $SHORTDATETIME$\" --from=Nagios\r\n}\r\n\r\n# Results in a SMS like:\r\n# CUSTOM on 127.0.0.1@localhost, State: OK, Output: 100, Date: 01-15-2021 12:30:28\r\ndefine command {\r\n command_name notify-host-by-sms\r\n command_line $USER1$\/sms77.py MY_SMS77_API_KEY $CONTACTPAGER$ \"$NOTIFICATIONTYPE$ on $HOSTADDRESS$@$HOSTNAME$, State: $HOSTSTATE$, Output: $HOSTOUTPUT$, Date: $SHORTDATETIME$\" --from=Nagios\r\n}\r\n<\/code><\/pre>\n<p>Optionally add a local service for a quick test. Append in \/usr\/local\/nagios\/etc\/objects\/localhost.cfg:<\/p>\n<pre><code>define service {\r\n use                   local-service\r\n host_name             localhost\r\n service_description   SMS\r\n check_command         notify-host-by-sms\r\n}\r\n<\/code><\/pre>\n<p>Available options:<\/p>\n<pre><code>sms77.py \r\n[-h] \r\n[--debug]\r\n[--delay DELAY]\r\n[--details]\r\n[--flash]\r\n[--foreign_id FOREIGN_ID] \r\n[--from FROM] \r\n[--json] \r\n[--label LABEL] \r\n[--no_reload] \r\n[--performance_tracking] \r\n[--return_msg_id] \r\n[--ttl TTL] \r\n[--udh UDH] \r\n[--unicode]\r\n[--utf8]\r\napi_key to text<\/code><\/pre>\n<h4 id=\"via-composer\"><span style=\"font-size: 28px; letter-spacing: 0em;\">Support<\/span><\/h4>\n<p>Please <a href=\"mailto:support@sms77.io\">send us an Email<\/a> if you have further questions about the integration of sms77 in Nagios.<\/p>\n","protected":false},"featured_media":0,"parent":17826,"menu_order":37,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-23835","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/docs\/23835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/comments?post=23835"}],"version-history":[{"count":6,"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/docs\/23835\/revisions"}],"predecessor-version":[{"id":27182,"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/docs\/23835\/revisions\/27182"}],"up":[{"embeddable":true,"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/docs\/17826"}],"next":[{"title":"Streamsheets","link":"https:\/\/www.seven.io\/en\/docs\/third-party-solutions\/streamsheets\/","href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/docs\/29275"}],"prev":[{"title":"n8n","link":"https:\/\/www.seven.io\/en\/docs\/third-party-solutions\/n8n\/","href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/docs\/22788"}],"wp:attachment":[{"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/media?parent=23835"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.seven.io\/en\/wp-json\/wp\/v2\/doc_tag?post=23835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}