Giter Club home page Giter Club logo

arguspy's Introduction

image

image

image

image

arguspy

[Deprecated] As nagios is too old, this project is deprecated.

Please Move to another project [super-devops].

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 super_devops
$ 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():
    plugin = Register()
    if plugin.args.option == 'action':
        plugin.action_handle()
    elif ...:
        ...
    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 tests in tests/
  • Write docs in docs/
  • Write examples in examples/
  • Compatible with Python3
  • vSphere monitoring
  • LDAP monitoring
  • SNMP monitoring

Contribution

[Contribution]

Authors

[Authors]

License

[License]

arguspy's People

Contributors

crazy-canux avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

jinmeng260

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.