{ "info": { "author": "Jelle Smet", "author_email": "development@smetj.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "NSCAweb\n=======\n\nWhat?\n-----\n\nNSCAweb is a Nagios core based monitoring solution addon which allows you to\neasily submit (passive) host and service checks over http(s) to the Nagios\nexternal command file. It aims to be a better,more feature rich alternative\nthan the classic NSCA daemon.\n\nNSCAweb has following features:\n\n- http(s) as transport makes it more friendly in a firewalled environment.\n- SSL encryption when desired.\n- Supports multiline plugin & performance output.\n- Accepts data coming over http or from local named pipes.\n- Submit data to many types of destinations: named pipes (nagios.cmd), NSCAweb, NRDP or a file.\n- Loadbalance and failover between multiple urls per destination.\n- Duplicate and forward passive check results to an \"unlimited\" amount of destinations.\n- Submit messages to 1 destination or all destinations depending on the url messages are send to.\n- Simultaneous local and remote delivery.\n- Each destination has an independent, dedicated thread and queue.\n- Buffering of unavailable destinations and resubmitting when destination comes available to prevent data loss.\n- Builtin, multiuser authentication.\n- Trivial to submit check results using http post.\n- Submit check results in bulk or one by one.\n- Use curl as a client from the command line.\n\n\nSupport\n-------\n\nPost a message in Google groups: https://groups.google.com/forum/#!forum/nscaweb\n\nSubmit bugreports to: https://github.com/smetj/nscaweb/issues\n\n\nInstallation\n------------\n\nYou can install NSCAweb from https://pypi.python.org/pypi by executing:\n\n\n $ easy_install nscaweb\n\n\nOr you can install NSCAweb directly from source when desired:\n\n $ git clone https://github.com/smetj/nscaweb.git\n $ cd nscaweb\n $ sudo python setup.py install\n\n\nAny Python related dependencies should be resolved and installed\nautomatically.\n\n\nUsage\n-----\n\nAfter installing the package you should have the `nscaweb` command available.\n\nStarting in foreground. Press ctrl+c to exit:\n\n $ nscaweb debug --config /etc/nscaweb.conf\n\nStarting in background.\n\n $ nscaweb start --config /etc/nscaweb.conf\n\nStop a background process:\n\n $ nscaweb stop --config /etc/nscaweb.conf\n\n\n\nConfiguration\n-------------\n\nThe configuration file is in ini style and has 4 sections:\n\napplication\n~~~~~~~~~~~\n\nThe application section controls the behaviour of the daemon itself.\n\n.. code-block:: ini\n\n [ \"application\" ]\n host = \"0.0.0.0\"\n port = \"5668\"\n pidfile = \"/opt/nscaweb/var/nscaweb.pid\"\n sslengine = \"off\"\n sslcertificate = \"\"\n sslprivatekey = \"\"\n queue_quota = \"104857600\"\n\n\n* host\n\n The IP address NSCAweb should bind to and listen on. By default NSCAweb\n listens on all interfaces it can find on the machine. This behavior is\n reached by using the \"0.0.0.0\" which effectively means listen on all\n interfaces. If you want to have NSCAweb to listen on a certain ip address,\n then you can define it here. If you want NSCAweb only to listen on the\n localhost you can define \"127.0.0.1\".\n\n* port\n\n The port on which NSCAweb should listen. By default NSCAweb listens on port\n 12345. It can be changed to what makes most sense to your environment.\n\n* pidfile\n\n The location of the pidfile. The pidfile holds the process number of the\n NSCAweb daemon when it has been started in background mode. It's not created\n when NSCAweb is started in debug mode. The pidfile is used by NSCAweb itself\n for server control. Do not delete this file while NSCAweb is running in\n background mode.\n\n* sslengine\n\n Makes NSCAweb listen to https instead of standard http and encrypt all\n traffic. The allowed values are \"on\" and \"off\". If you have defined on you\n need to define the sslcertificate and the sslprivatekey parameters. If you\n choose off, the sslcertificate and sslprivatekey parameters are ignored.\n\n* sslcertificate\n\n Defines the place of the sslcertificate. You can create and use self-signed\n certificates or an official one. You can basically follow any Apache/ssl\n certificate creation guide to create one.\n\n* sslprivatekey\n\n Defines the place of the ssl private key. When you're in the process of\n creating your certificate you will also have your private key. This is a quite\n sensitive piece of information. Make sure it's on a safe place.\n\n* queue_quota\n\n The value in bytes a queue is allowed to contain before refusing data.\n\nlogging\n~~~~~~~\n\nLogging related options\n\n.. code-block:: ini\n\n [ \"logging\" ]\n logfile = \"/var/log/nagios/nscaweb.log\"\n enable_syslog = \"1\"\n enable_http_logging = \"0\"\n\n* logfile\n\n The location of the logfile. If commented, no logfile is created.\n\n* enable_syslog\n\n If enabled, writes logs to syslog.\n\n* enable_http_logging\n\n If enabled, includes any http request related logging to the log destination.\n\npipes\n~~~~~\n\nNSCAweb can accept data over named pipe.\n\n.. code-block:: ini\n\n [ \"pipes\" ]\n enable = \"1\"\n directory = \"/var/tmp/\"\n\n* enable\n\n When enabled, creates the named pipes.\n\n* directory\n\n The location of the named pipes.\n\n\nFor each defined destination a corresponding named pipe is created.\nSubmitting data to a named pipe results in that data being send to the\ncorresponding destination. A special \"broadcast\" named pipe is also created\nwhich submits incoming data to all defined destinations.\n\ndestinations\n~~~~~~~~~~~~\n\nA destination is an entry point into NCSAweb and data submitted into it leads\nto the type and location associated with it.\nMultiple NSCAweb destinations can be defined.\nEach destination should have a unique name. The name identifies the\ndestination when submitting data. A destination name is free to choose.\n\n4 different destination types are available:\n\n* local\n Writes data to a local named pipe.\n\n* nscaweb\n Writes data to another NSCAweb instance.\n\n* nrdp\n Writes data to a NRDP receiver\n\n* file\n Writes data into a file\n\n\n.. code-block:: ini\n\n [ \"destinations\" ]\n\n [[ \"local\" ]]\n enable = \"0\"\n type = \"local\"\n locations = \"/opt/nagios/var/rw/nagios.cmd\"\n\n [[ \"master\" ]]\n enable = \"0\"\n type = \"nscaweb\"\n locations = \"http://server_23.company.local:15668/queue/local\"\n username = \"default\"\n password = \"changeme\"\n\n [[ \"nagiosWithNrdp\" ]]\n enable = \"0\"\n type = \"nrdp\"\n locations = \"http://nagios/nrdp/\"\n username = \"default\"\n password = \"changeme\"\n token = \"mysecrettoken\"\n\n [[ \"debugging\" ]]\n enable = \"0\"\n type = \"file\"\n locations = \"/tmp/external_commands.log\"\n\nDestination types\n#################\n\nlocal\n*****\n\n* locations\n\n A comma delimited list of named pipe locations.\n\nnscaweb\n*******\n\n* locations\n\n A comma delimited list of urls\n\n* username\n\n The username to authenticate to the remote NSCAweb instance\n\n* password\n\n The password to authenticate to the remote NSCAweb instance\n\nnrdp\n****\n\n* locations\n\n A comma delimited list of urls.\n\n* username\n\n The username to authenticate to the remote NRDP instance\n\n* password\n\n The password to authenticate to the remote NRDP instance\n\n* token\n\n The token used to authenticate to the remote NRDP instance\n\nauthentication\n~~~~~~~~~~~~~~\n\nThe authentication section contains the usernames and passwords used to\nauthenticate to NSCAweb in order to dump data.\n\n.. code-block:: ini\n\n [ \"authentication\" ]\n default = \"6ac371cc3dc9d38cf33e5c146617df75\"\n\n\nThis contains a list of username and corresponding password hashes. In this\ncase there's only 1 user defined with the login name \"default\" and password\n\"changeme\".\n\nThe password is a md5sum. To generate a hash value out of a string you can\nexecute the following:\n\n $ echo changeme|md5sum\n\n**Warning**: Each NSCAweb installation comes with the default username \"default\"\nand password \"changeme\". CHANGE IT!.\n\n\nNSCAweb transport scenario's\n----------------------------\n\nA typical NSCAweb setup looks like this:\n\n.. image:: docs/nscaweb.png\n\n\nFrom command line to NSCAweb\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSometimes you have to submit a check result (or other command) into Nagios\nfrom a remote host. You can do that by simply using curl or wget from command\nline. In the above diagram, we have server_3 sending check updates to\nserver_4. Server_4 then writes the incoming check results into the Nagios\nexternal command pipe.\n\nFollowing example command does that:\n\n printf \"[%lu] PROCESS_SERVICE_CHECK_RESULT;localhost;True 1;2;CRITICAL- Whatever\\n\" $(date +%s) | \\\n curl -d username=\"default\" -d password=\"changeme\" --data-urlencode input=@- http://localhost:5668/queue\n\nWhen posting data to the NSCAweb webserver you have to keep 3 fields into\naccount:\n\n* username\n* password\n* input\n\nThe input field should contain 1 or more entries with the same syntax as\ndescribed below. When you use multiple lines as plugin output then use \"\\\\\\n\"\nto separate those multiple lines. NSCAweb considers each *newline* as a new\ncommand.\n\n**Note**: Keep in mind that all data you send to NSCAweb needs to be URL\nencoded. Submit 1 check result to NSCAweb using curl.\n\n**Note**: Make sure to use a version of curl which supports the '--data-\nurlencode' parameter.\n\n**Note**: Make sure that newlines in multiline output are replaced by litteral\n\"\\n\" prior to sending over to NSCAweb.\n\nFrom NSCAweb to NSCAweb\n~~~~~~~~~~~~~~~~~~~~~~~\n\nLet's say you have 2 Nagios slave machines (diagram server_1 and server_2)\nwhich have to forward their results to a central Nagios machine (diagram\nserver_3) you will have to configure following items:\n\nInstall NCSAweb on all 3 servers\n--------------------------------\n\nNagios on the saves will submit check results to a local NSCAWeb instance,\nwhich takes care of transporting the results to the remote NSCAweb instance.\n\nConfigure OCHP and OHSP on slaves\n---------------------------------\n\nSee:\n\n- http://nagios.sourceforge.net/docs/3_0/configmain.html#ochp_command\n- http://nagios.sourceforge.net/docs/3_0/configmain.html#ocsp_command\n\n\n**Note**: Nagios treats everything coming after a \";\" as comment.\nUnfortunately we need the \";\" character to compose the check result data we\nwant to forward. Therefor we we have to assign the \";\" to a $USER$\nvalue in the `resource`_ file. In the below example we havve assigned the \";\"\nvalue to $USER9$\n\n::\n\n define command {\n command_name submit_service_check_result_nscaweb\n command_line echo \"[$TIMET$] PROCESS_SERVICE_CHECK_RESULT$USER9$$HOSTNAME$$USER9$$SERVICEDESC$$USER9$$SERVICESTATEID$$USER9$$SERVICEOUTPUT$|$SERVICEPERFDATA$\" >> /var/tmp/server_4\n }\n\n define command {\n command_name submit_host_check_result_nscaweb\n command_line echo \"[$TIMET$] PROCESS_HOST_CHECK_RESULT$USER9$$HOSTNAME$$USER9$$HOSTSTATEID$$USER9$$HOSTOUTPUT$|$HOSTPERFDATA$\" >> /var/tmp/server_4\n }\n\n\nConfigure NSCAweb on the slave (sender)\n---------------------------------------\n\nIn the above example commands we submit the check results into a named pipe called /var/tmp/server_4.\nTherefor we need the following section in the sending NSCAweb configuration:\n\n .. code-block:: ini\n\n [ \"destinations\" ]\n\n [[ \"server_4\" ]]\n enable = \"0\"\n type = \"nscaweb\"\n locations = \"http://server_4:15668/queue/local\"\n username = \"default\"\n password = \"changeme\"\n\n\n\nConfigure NSCAweb on the master (receiver)\n------------------------------------------\n\nOn the receiving end (server_4) we have NSCAweb writing incoming data into the\n`nagios external command file`_\n\n.. code-block:: ini\n\n [[ \"local\" ]]\n enable = \"1\"\n type = \"local\"\n locations = \"/usr/local/nagios/var/rw/nagios.cmd\"\n\n\n.. _resource: http://nagios.sourceforge.net/docs/3_0/configmain.html#resource_file\n.. _nagios external command file: http://nagios.sourceforge.net/docs/3_0/extcommands.html", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/smetj/nscaweb/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/smetj/nscaweb", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "nscaweb", "package_url": "https://pypi.org/project/nscaweb/", "platform": "Linux", "project_url": "https://pypi.org/project/nscaweb/", "project_urls": { "Download": "https://github.com/smetj/nscaweb/tarball/master", "Homepage": "https://github.com/smetj/nscaweb" }, "release_url": "https://pypi.org/project/nscaweb/0.1.20/", "requires_dist": null, "requires_python": null, "summary": "A more feature rich alternative than the classic NSCA daemon.", "version": "0.1.20" }, "last_serial": 951808, "releases": { "0.1.20": [ { "comment_text": "", "digests": { "md5": "5ba29e43b6dc5466a1896d7568557ad7", "sha256": "4c011c56a07c6a3747850a21c6016cdfa127670ec0fdb6fcfa7948be1e557b43" }, "downloads": -1, "filename": "nscaweb-0.1.20.tar.gz", "has_sig": false, "md5_digest": "5ba29e43b6dc5466a1896d7568557ad7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20990, "upload_time": "2013-12-22T15:17:44", "url": "https://files.pythonhosted.org/packages/4a/73/bf9cfbfd1635841c49a1fc2f3b1ab15dfd15f47dab61a784000c0e5eae9b/nscaweb-0.1.20.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5ba29e43b6dc5466a1896d7568557ad7", "sha256": "4c011c56a07c6a3747850a21c6016cdfa127670ec0fdb6fcfa7948be1e557b43" }, "downloads": -1, "filename": "nscaweb-0.1.20.tar.gz", "has_sig": false, "md5_digest": "5ba29e43b6dc5466a1896d7568557ad7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20990, "upload_time": "2013-12-22T15:17:44", "url": "https://files.pythonhosted.org/packages/4a/73/bf9cfbfd1635841c49a1fc2f3b1ab15dfd15f47dab61a784000c0e5eae9b/nscaweb-0.1.20.tar.gz" } ] }