Skip to main content

Common interface of tons protocals, used for monitoring tools, like nagios/icinga...

Project description

https://img.shields.io/pypi/v/arguspy.svg https://img.shields.io/pypi/dm/arguspy.svg https://travis-ci.org/crazy-canux/arguspy.svg?branch=master https://coveralls.io/repos/github/crazy-canux/arguspy/badge.svg?branch=master

arguspy

arguspy is pure python code.

It’s a API packge for monitoring plugins, like Nagios, Icinga, Naemon, Shinken, Centreon, Opsview and Sensu.

[awesome-monitoring].

How to install

Use pip to install:

$ pip install arguspy

How to use

Just import what protocol you need:

from arguspy.ftp_ftplib import Ftp
from arguspy.http_requests import Http
from arguspy.mssql_pymssql import Mssql
from arguspy.mysql_pymysql import Mysql
from arguspy.ssh_paramiko import Ssh
from arguspy.winrm_pywinrm import WinRM
from arguspy.wmi_sh import Wmi
from arguspy.wmi_subprocess import Wmi

Then write your own function monitoring class:

class YourClass(Ftp/Mssql/Ssh/WinRM/Wmi/Http/Snmp/...):
    def __init__(self):
        super(YourClass, self).__init__()
        self.logger.debug("Init YourClass.")

    def define_sub_options(self):
        super(YourClass, self).define_sub_options()
        self.your_parser = self.subparsers.add_parser(...)
        self.your_parser.add_argument(...)
        ...

    def your_handle(self):
        """Put your function monitoring code here."""
        # Default status is ok.
        status = self.ok

        # Call the API and get the monitoring data.
        # Read the document or check the API on python/ipython Interactive console.
        # help(Ftp/...)
        # dir(Ftp/...)
        ...

        #  Compare with the warning and critical value and change the status.
        ...

        self.shortoutput = "..."
        self.longoutput.append(...)
        self.perfdata.append(...)

        self.logger.debug("Return status and output.")
        status(self.output())

If you put more than one function monitoring class in one file(Not recommend):

class Register(YourClass1, YourClass2, ...):
    def __init__(self):
        super(Register, self).__init__()

Last step:

def main():
    # For multiple inherit
    # plugin = Register()
    plugin = YourClass()
    arguments = sys.argv[1:]
    if 'your' in arguments:
        plugin.your_handle()
    elif 'your2' in arguments:
        plugin.your2_handle()
    else:
        plugin.unknown("Unknown actions.")

if __name__ == "__main__":
    main()

How to extends

Check the TODO list, you can give test examples or documents.

Also you can pull request for your code.

TODO

  • Write unit test in tests/

  • Compatible with Python3(2.0.0)

  • vSphere monitoring(1.6.0)

  • LDAP monitoring(1.5.0)

  • SNMP monitoring(1.4.0)

  • Threshold(1.3.0)

Contribution

[Contribution]

Authors

[Authors]

License

[License]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arguspy-1.3.0.tar.gz (501.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arguspy-1.3.0-py2.py3-none-any.whl (19.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file arguspy-1.3.0.tar.gz.

File metadata

  • Download URL: arguspy-1.3.0.tar.gz
  • Upload date:
  • Size: 501.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for arguspy-1.3.0.tar.gz
Algorithm Hash digest
SHA256 d1d2583e9f7288ed40116cdd198df05bbb6234c52333d0f176158eb54f9b5806
MD5 25896f83c21bf2dbf3be3bfbf47c36e9
BLAKE2b-256 ec971dd66ced451bafa77cba5223602691822899f35d60e04b5f07cef970333f

See more details on using hashes here.

File details

Details for the file arguspy-1.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for arguspy-1.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bc596cf3696e87e275a77e287c2d56099d8e7fcf01d763d5ae9213643e680372
MD5 43a3cd4adf588630ef18e2218dedc658
BLAKE2b-256 6e1b20b7f67d57ce8de67da97b036940ec6e3f6291df0882928e3fe52e9dc493

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page