{ "info": { "author": "Pablo Estigarribia", "author_email": "pablodav@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: SQL", "Topic :: Database :: Database Engines/Servers", "Topic :: System :: Monitoring", "Topic :: System :: Systems Administration" ], "description": "Nagios sql\n----------\n\nInstall:\n========\n\nRequires python3, if you are on centos/redhat you can use: https://www.softwarecollections.org/en/ and install python3.\n\nFrom pip::\n\n pip3 install nagios_sql\n\nFrom pip with github::\n\n pip3 install git+https://github.com/pablodav/nagios_sql.git\n\nFor development::\n\n # clone the repository\n pip3 install -r requirements.txt\n python3 setup.py develop\n\nUsage:\n======\n\nGet help and options::\n\n nagios_sql --help\n\n usage: nagios_sql [-h] [-H HOST]\n [--test {db_state,logship_status,mirror_status,replication_status,sql_ping,synchronization_databases_ag}]\n [-U USER] [-P PASSWORD] [-v [VERSION]]\n\n optional arguments:\n -h, --help show this help message and exit\n -H HOST, --host HOST SQL Backup HOST to connect\n --test {db_state,logship_status,mirror_status,replication_status,sql_ping,synchronization_databases_ag}, -t {db_state,logship_status,mirror_status,replication_status,sql_ping,synchronization_databases_ag}\n tests:\n db_state\n logship_status\n mirror_status\n replication_status\n sql_ping\n synchronization_databases_ag\n -U USER, --user USER User to auth to DB\n -P PASSWORD, --password PASSWORD\n Password to auth to DB\n -v [VERSION], --version [VERSION]\n Gets version number\n\n\nCheck replication_status::\n\n nagios_sql -H SERVERNAME -U 'USERNAME' -P 'PASSWORD' -t replication_status -N 'publisher_name'\n\n CRITICAL: Replication CRITICAL\n OK Pub:Test_Replication1 DB:Test_DB1 Status:Idle MaxLatency:31s\n CRITICAL Pub:Test_Replication1_2 DB:Test_DB1 Status:Failed MaxLatency:31s\n CRITICAL Pub:Test_Replication1_3 DB:Test_DB1 Status:Failed MaxLatency:31s\n OK Pub:Test_Replication1_4 DB:Test_DB1 Status:Idle MaxLatency:31s\n OK Pub:Test_Replication1_5 DB:Test_DB1 Status:Idle MaxLatency:31s\n CRITICAL Sub:SERVERNAME DB:Test_DB1_Reporting Status:Failed Latency:?s\n CRITICAL Sub:SERVERNAME DB:Test_DB1_Reporting Status:Failed Latency:?s\n OK Sub:SERVERNAME DB:Test_DB1_Reporting Status:Idle Latency:0s\n OK Sub:SERVERNAME DB:Test_DB1_Reporting Status:Idle Latency:0s\n OK Sub:SERVERNAME DB:Test_DB1_Reporting Status:Idle Latency:0s\n\nCheck availability_group_status:\n\n nagios_sql -H SERVERNAME -U 'USERNAME' -P 'PASSWORD' -t synchronization_databases_ag -N 'publisher_name'\n\n\tOK: Availability Group OK\n\tGroup:Server_AG Primary Replica:Server01 State:HEALTHY\n\nCheck synchronization_databases_ag:\n\n nagios_sql -H SERVERNAME -U 'USERNAME' -P 'PASSWORD' -t synchronization_databases_ag -S 'server_primary'\n\n\tOk: Name:Replication01 State:SYNCHRONIZING Health:HEALTHY\n\tName:Name:Replication02 State:SYNCHRONIZING Health:HEALTHY\n\tName:Name:Replication03 State:SYNCHRONIZING Health:HEALTHY\n\nSetup nagios command:\n=====================\n\nConfigure you own `commands_nagios.cfg`::\n\n # standard way to define a command\n define command{\n command_name\tcheck_nagios_sql\n command_line\tnagios_sql -H $HOSTADDRESS$ -U $ARG1$ -P $ARG2$ -t $ARG3$\n }\n\n # this other custom settings will allow you to parse any argument\n # like:\n # command check_nagios_sql_custom!\"-U 'USERNAME' -P 'PASSWORD' -t replication_status\"\n define command{\n command_name\tcheck_nagios_sql_custom\n command_line\tnagios_sql -H $HOSTADDRESS$ $ARG1$\n }\n\nAutomatic provisioned with ansible by: https://github.com/CoffeeITWorks/ansible_nagios4_server_plugins\n\nSetup nagios service:\n=====================\n\nExample configure your service `sql_replicas.cfg`::\n\n # Nagios checks for SQL replicas\n # group defined on groups.cfg\n # https://github.com/pablodav/nagios_sql\n\n define service {\n hostgroup_name sql_servers_replicas\n service_description sql_replicas_status\n check_command check_nagios_sql!'username'!'password'!replication_status\n notes some useful notes for your monitoring team\n use generic-service\n }\n\n\nOriginal author:\n================\n\noriginal code: http://code.activestate.com/recipes/577599-nagios-plugin-for-monitoring-database-servers/\nNagios_sql.py - Matt Keranen 2011 (mksql@yahoo.com)\n\nAuthor:\n=======\n\nThis script was refactored and also a python package was created by:\n\nPablo Estigarribia 201705 (pablodav at gmail)\n\nCollaborators:\n==============\n\n--- put your name here ---\n\nTroubleshooting replicas\n========================\n\nSome time when you are monitoring replicas, you can see some publication that doesn't exist anymore but they still\nappears in `distribution` database.\n\nThe unique way to fix them is to drop the publication, but as it doesn't exist: SQL will fail trying to drop.\nSo here there are some steps to create and drop the publication:\n\nThis example is only for databases that already have some other publications working, but you need to create and drop\nan missing publication that still appears in `distribution` database.\n\n.. code-block:: sql\n\n -- Adding the transactional publication\n use [databasename]\n exec sp_addpublication @publication = N'MyReplPub',\n @description = N'Transactional publication of database ''databasename'' from Publisher ''servername''.',\n @sync_method = N'concurrent', @retention = 0, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true',\n @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21,\n @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false', @repl_freq = N'continuous',\n @status = N'active', @independent_agent = N'true', @immediate_sync = N'true', @allow_sync_tran = N'false',\n @autogen_sync_procs = N'false', @allow_queued_tran = N'false', @allow_dts = N'false', @replicate_ddl = 1,\n @allow_initialize_from_backup = N'false', @enabled_for_p2p = N'false', @enabled_for_het_sub = N'false'\n GO\n\n\n exec sp_droppublication @publication = N'MyReplPub'\n\nIn some strange case you could have orphaned publication in a database that has no publications, sql will give you error saying the database is not enabled for publications when running the above command. You could try to enable, run the above command and then disable. Use this command to enable with `true` and disable with `false`\n\n.. code-block:: sql\n\n use master\n exec sp_replicationdboption @dbname = N'databasename', @optname = N'publish', @value = N'true'\n GO\n\n\nNice references:\n================\n\nhttps://www.mssqltips.com/sqlservertip/2710/steps-to-clean-up-orphaned-replication-settings-in-sql-server/\n\nOther ways of deployment:\n=========================\n\nThis plugin is already included in ansible role: https://github.com/CoffeeITWorks/ansible_nagios4_server_plugins \n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pablodav/nagios_sql", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "nagios-sql", "package_url": "https://pypi.org/project/nagios-sql/", "platform": "", "project_url": "https://pypi.org/project/nagios-sql/", "project_urls": { "Homepage": "https://github.com/pablodav/nagios_sql" }, "release_url": "https://pypi.org/project/nagios-sql/0.8.0/", "requires_dist": [ "pymssql (>=2.1.3)", "rstcheck (>=3.1)" ], "requires_python": "", "summary": "Nagios plugin with sqlchecks", "version": "0.8.0" }, "last_serial": 4908030, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "4afad77e890d09c32876b8b623a6fb78", "sha256": "6f0b27d749a0415bd91cd69e2bf4e3ac10ec05d3fa8a197a12fa7621fa70ae7d" }, "downloads": -1, "filename": "nagios_sql-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4afad77e890d09c32876b8b623a6fb78", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9650, "upload_time": "2017-05-24T15:30:44", "url": "https://files.pythonhosted.org/packages/ae/fa/9b9fcfad0e82a24c36412e39c7ee05d6f5c200bd30265a26666840440346/nagios_sql-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b1daf0e22e3cda8fcbce228685affa9", "sha256": "df3b4622166eedaeb0d9362904d6bc7588e3fa94b16df0324d4a3c4045bbb2d0" }, "downloads": -1, "filename": "nagios_sql-0.5.0.tar.gz", "has_sig": false, "md5_digest": "3b1daf0e22e3cda8fcbce228685affa9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7014, "upload_time": "2017-05-24T15:30:46", "url": "https://files.pythonhosted.org/packages/a8/ed/856a0ac0e9281c66d6bf7bb939ab325523240fd936c5714e19771eccc1a4/nagios_sql-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "c3cc22de73206803f5a559afc409fe98", "sha256": "1ce694300d63c87057e86bc6d9074bbda2d01db12318d2056926e25d2be16b11" }, "downloads": -1, "filename": "nagios_sql-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c3cc22de73206803f5a559afc409fe98", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9969, "upload_time": "2017-05-24T19:15:26", "url": "https://files.pythonhosted.org/packages/38/33/882431e331e1ec13f274089ef6ef36d93cb080a96991888ac51fc3eb3656/nagios_sql-0.5.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ba2d47d358577033847ff33d35f532d", "sha256": "b350ed2c966500c3e2ea2b9bdb3f22a6963a9a11325459c21e955ca5a70542c4" }, "downloads": -1, "filename": "nagios_sql-0.5.1.tar.gz", "has_sig": false, "md5_digest": "7ba2d47d358577033847ff33d35f532d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8921, "upload_time": "2017-05-24T19:15:27", "url": "https://files.pythonhosted.org/packages/69/dc/10ba9cb9178f59162dc92beb172b1cbb5f68c013c1d8d40ff3f566667d42/nagios_sql-0.5.1.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "baeef23990ebcf315b825cb68f202ccc", "sha256": "26b94ee13d79ca8b2753719fb1fc0dccdd557a6375d457956445420ab4cb5fdf" }, "downloads": -1, "filename": "nagios_sql-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "baeef23990ebcf315b825cb68f202ccc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10907, "upload_time": "2019-02-01T19:50:37", "url": "https://files.pythonhosted.org/packages/58/3e/9892c018d49068d6971e0d6c545b65c4f910015b291265d7d3e047352097/nagios_sql-0.6.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ff96e7b224f014bc5a97f27d88946c6", "sha256": "6361cf774b6f6bcf8444cc1fb9030d264e5f6aecf0e512f9400fbd321c5e721d" }, "downloads": -1, "filename": "nagios_sql-0.6.0.tar.gz", "has_sig": false, "md5_digest": "7ff96e7b224f014bc5a97f27d88946c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8080, "upload_time": "2019-02-01T19:50:39", "url": "https://files.pythonhosted.org/packages/84/50/a24b5d16a7f50d50a1276460a87ddb4080e64ec9035a12eb96cabec35e93/nagios_sql-0.6.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "234513b047fa0536d019bb31c666d37e", "sha256": "47c3ff7b8733ffd230930d7a8983e03b4799dc7ffaaa99891a10c9e87bf4d094" }, "downloads": -1, "filename": "nagios_sql-0.8.0-py3-none-any.whl", "has_sig": false, "md5_digest": "234513b047fa0536d019bb31c666d37e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9018, "upload_time": "2019-03-07T02:15:26", "url": "https://files.pythonhosted.org/packages/9a/25/6ed9434b874deb383499a9912908361deffb0138da719249fcbe443eed52/nagios_sql-0.8.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4be3b42cd383128f1d9225eccc3fe781", "sha256": "d6dfd1fd68ef985d84e147ce4ea44f8c0ee731bd4543616f709f84829d1e81f7" }, "downloads": -1, "filename": "nagios_sql-0.8.0.tar.gz", "has_sig": false, "md5_digest": "4be3b42cd383128f1d9225eccc3fe781", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8579, "upload_time": "2019-03-07T02:15:28", "url": "https://files.pythonhosted.org/packages/26/c7/d5c1890b56e736e41d21d91b93d262bea284a36539d1586666f0018b803a/nagios_sql-0.8.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "234513b047fa0536d019bb31c666d37e", "sha256": "47c3ff7b8733ffd230930d7a8983e03b4799dc7ffaaa99891a10c9e87bf4d094" }, "downloads": -1, "filename": "nagios_sql-0.8.0-py3-none-any.whl", "has_sig": false, "md5_digest": "234513b047fa0536d019bb31c666d37e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9018, "upload_time": "2019-03-07T02:15:26", "url": "https://files.pythonhosted.org/packages/9a/25/6ed9434b874deb383499a9912908361deffb0138da719249fcbe443eed52/nagios_sql-0.8.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4be3b42cd383128f1d9225eccc3fe781", "sha256": "d6dfd1fd68ef985d84e147ce4ea44f8c0ee731bd4543616f709f84829d1e81f7" }, "downloads": -1, "filename": "nagios_sql-0.8.0.tar.gz", "has_sig": false, "md5_digest": "4be3b42cd383128f1d9225eccc3fe781", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8579, "upload_time": "2019-03-07T02:15:28", "url": "https://files.pythonhosted.org/packages/26/c7/d5c1890b56e736e41d21d91b93d262bea284a36539d1586666f0018b803a/nagios_sql-0.8.0.tar.gz" } ] }