{"id":15292753,"url":"https://github.com/thecodeteam/nagios-unity","last_synced_at":"2025-04-13T11:33:47.808Z","repository":{"id":57444694,"uuid":"111695380","full_name":"thecodeteam/nagios-unity","owner":"thecodeteam","description":"Nagios plugin for monitoring Unity system","archived":false,"fork":false,"pushed_at":"2017-12-04T02:45:08.000Z","size":49,"stargazers_count":7,"open_issues_count":3,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T02:43:33.685Z","etag":null,"topics":["nagios","nagios-plugin","python","unity"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodeteam.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-22T14:37:27.000Z","updated_at":"2023-10-27T07:35:31.000Z","dependencies_parsed_at":"2022-09-05T09:40:19.491Z","dependency_job_id":null,"html_url":"https://github.com/thecodeteam/nagios-unity","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeteam%2Fnagios-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeteam%2Fnagios-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeteam%2Fnagios-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeteam%2Fnagios-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodeteam","download_url":"https://codeload.github.com/thecodeteam/nagios-unity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252676,"owners_count":21072699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nagios","nagios-plugin","python","unity"],"created_at":"2024-09-30T16:26:31.641Z","updated_at":"2025-04-13T11:33:47.773Z","avatar_url":"https://github.com/thecodeteam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"nagios-unity\n============\n\nNagios plugin for monitoring Unity system\n\n``nagios-unity`` is built on top of ``storops``, which interacts with Unity storage via RESTful API. ``nagios-unity`` provides\nan easy-to-use command line interface for invocation of nagios servers. ``nagios-unity`` follows the output rules defined\nby `Print only one line of text \u003chttps://nagios-plugins.org/doc/guidelines.html#AEN33\u003e`_\n\n\nInstallation\n------------\n\nFrom Pypi\n^^^^^^^^^\n\nThe ``nagios-unity`` can be install via pypi.\n\n.. code-block:: bash\n\n    $ pip install nagios-unity\n\nFrom source\n^^^^^^^^^^^\n\nAlternatively, clone this repo via git and:\n\n.. code-block:: bash\n\n    $ cd nagios-unity\n    $ sudo python setup.py install\n\nOnce installed, a ``nagios-unity`` (on \\*nux) or ``nagios-unity.exe`` (on Windows) command will be available for use.\n\nCommand line usage\n------------------\n\nUser can invoke the command line ``nagios-unity`` in bash or CMD/PowerShell. To get the help, type ``nagios-unity --help``.\n\nHere is the example:\n\n.. code-block:: bash\n\n    $ nagios-unity --help\n    Unity plugin for Nagios.\n\n    Usage:\n        nagios-unity -H \u003cHOST\u003e -u \u003cUSERNAME\u003e -p \u003cPASSWORD\u003e [--cacert \u003cCACERT\u003e]  \u003cOBJECT\u003e\n        nagios-unity -h | --help\n        nagios-unity --version\n\n    Arguments:\n        OBJECT  One of below values:\n            battery, dae, disk, dpe,\n            ethernet_port fan, fc_port,\n            io_module, lcc, lun, memory_module,\n            pool, power_supply, sas_port,\n            sp, ssc, ssd, system, array_hardware\n\n    Options:\n        -h --help                         Show this screen.\n        -V --version                      Show version.\n        -C --cacert \u003cCACERT\u003e              Unity CA certificates.\n        -H --host \u003cHOST\u003e                  Unity IP address.\n        -u --username \u003cUSERNAME\u003e          Unity User login.\n        -p --password \u003cPASSWORD\u003e          Unity password.\n        -v --verbose                      show verbose logs.\n\n    Examples:\n      nagios-unity -H 10.245.101.39 -u admin -p Password123! ssc\n\n\nAvailable monitoring commands\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n- **battery**\n- **dae**\n- **disk**\n- **dpe**\n- **ethernet_port**\n- **fan**\n- **fc_port**\n- **io_module**\n- **lcc**\n- **lun**\n- **memory_module**\n- **pool**\n- **power_supply**\n- **sas_port**\n- **sp**\n- **ssc**\n- **ssd**\n- **system**\n- **array_hardware**\n\n\n**array_hardware** is a virtual command which combines a serial of hardware components of Unity.\n\nArray health enum mapping\n-------------------------\n\nThe nagios requires plugins to provide defined return codes for each periodic check, see `Plugin Return Codes \u003chttps://nagios-plugins.org/doc/guidelines.html#AEN78\u003e`_ for more details.\n\nThis plugin will perform following mapping between the Unity health enum and nagios return codes:\n\n\n+-------------------+--------------------+-----------------------+\n| Unity Health Enum | Nagios Return Code | Nagios Service Status |\n+-------------------+--------------------+-----------------------+\n| OK                | 0                  | OK                    |\n+-------------------+--------------------+-----------------------+\n| OK_BUT            | 0                  | OK                    |\n+-------------------+--------------------+-----------------------+\n| DEGRADED          | 1                  | WARNING               |\n+-------------------+--------------------+-----------------------+\n| MINOR             | 1                  | WARNING               |\n+-------------------+--------------------+-----------------------+\n| MAJOR             | 1                  | WARNING               |\n+-------------------+--------------------+-----------------------+\n| CRITICAL          | 2                  | CRITICAL              |\n+-------------------+--------------------+-----------------------+\n| NON_RECOVERABLE   | 2                  | CRITICAL              |\n+-------------------+--------------------+-----------------------+\n| UNKNOWN           | 3                  | UNKNOWN               |\n+-------------------+--------------------+-----------------------+\n\n\nConfiguration\n-------------\n\n.. caution::\n\n    Before proceeding, make sure the nagios and its components are corrected configured.\n    It is also suggested to try out the ``nagios-unity`` command line.\n\n\n\n- Create a template ``storage-array`` in ``templates.cfg``.\n\n.. code-block:: ini\n\n    # Define a template for storage that we can reuse\n    define host{\n            name                    storage-array      ; The name of this host template\n            use                     generic-host       ; Inherit default values from the generic-host template\n            hostgroups              storage-arrays     ; Host groups that storage arrays should be a member of\n            check_period            24x7               ; By default, storage arrays are monitored round the clock\n            check_interval          5                  ; Arrays are checked every 5 minutes\n            retry_interval          1                  ; Schedule array check retries at 1 minute intervals\n            max_check_attempts      10                 ; Check each array 10 times (max)\n            check_command           check-host-alive   ; Default command to check if arrays are \"alive\"\n            notification_period     24x7               ; Send notifications at any time\n            notification_interval   30                 ; Resend notifications every 30 minutes\n            notification_options    d,r                ; Only send notifications for specific array states\n            contact_groups          admins             ; Notifications get sent to the admins by default\n            register                0                  ; DONT REGISTER THIS - ITS JUST A TEMPLATE\n            }\n\n\n\n- Create a dedicated ``storage.cfg`` for storing all storage arrays.\n\n.. code-block:: ini\n\n    $ touch storage.cfg\n\n\n- Add groups for grouping all storage devices in ``storage.cfg``\n\n.. code-block:: ini\n\n    define hostgroup{\n        hostgroup_name  storage-arrays\n        alias           External Storage\n    }\n\n- Add array for nagios management.\n\n.. code-block:: ini\n\n    define host{\n        use         storage-array\n        host_name   OB_H1132        ; The name we're giving to this array\n        alias       My Nagios Unity ; A longer name associated with the array\n        address     10.245.101.35   ; IP address of the Unity array\n        _user_name  admin           ; Customer variable for Unity user name\n        _password   password        ; Customer variable for Unity password\n    }\n\n- Add command for nagios use in ``commands.cfg``.\n\n.. code-block:: ini\n\n    # for unity\n\n    define command{\n        command_name    nagios-unity\n        command_line    /usr/local/bin/nagios-unity -H $HOSTADDRESS$ -u $_HOSTUSER_NAME$ -p $_HOSTPASSWORD$ $ARG1$\n        }\n\n\n\n\nNote: ``_HOST`` prefix is prepended by nagios, see `custom object vars \u003chttps://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/customobjectvars.html\u003e`_.\n\n\n\n- Add services for managed arrays.\n\n.. code-block:: ini\n\n    define service{\n        use                 generic-service\n        host_name           OB_H1132\n        service_description Ethernet Ports\n        check_command       nagios-unity!ethernet_port\n        }\n\n    define service{\n        use                 generic-service\n        host_name           OB_H1132\n        service_description FC Ports\n        check_command       nagios-unity!fc_port\n        }\n\n    define service{\n        use                 generic-service\n        host_name           OB_H1132\n        service_description SAS Ports\n        check_command       nagios-unity!sas_port\n        }\n\n\nFor a full list of available commands, check it out `Available monitoring commands`_\n\n- Restart nagios to reflect the changes.\n\n.. code-block:: ini\n\n    $ sudo service nagios restart\n\n\nSSL consideration\n^^^^^^^^^^^^^^^^^\n\nUnity supports SSL via RESTful API, administartor can setup their own CA for SSL verification.\n\n``nagios-unity`` also leverages the capability of RESTful API, and provides a ``-C`` option for SSL verification.\n\nTo do this:\n\n- First add the ``-C \u003cpath/file to CA\u003e`` to the ``commands.cfg``\n\n.. code-block:: ini\n\n    # for unity\n\n    define command{\n        command_name    nagios-unity\n        command_line    /usr/local/bin/nagios-unity -H $HOSTADDRESS$ -u $_HOSTUSER_NAME$ -p $_HOSTPASSWORD$ -C $_HOSTCACERT $ARG1$\n        }\n\n\n- Then supply ``_cacert`` option in the ``storage.cfg``.\n\n\n.. code-block:: ini\n\n    define host{\n        use         storage-array\n        host_name   OB_H1132        ; The name we're giving to this array\n        alias       My Nagios Unity ; A longer name associated with the array\n        address     10.245.101.35   ; IP address of the Unity array\n        _user_name  admin           ; Customer variable for Unity user name\n        _password   password        ; Customer variable for Unity password\n        _cacert     /path/to/CA     ; Customer variable for Unity CA certificate\n    }\n\n- Restart nagios service to reflect the changes.\n\n\nContributions\n-------------\n\nSimply fork this repo and send PR for your code change(also tests to cover your change),\nremember to give a title and description of your PR. We are willing to enhance this project with you :).\n\n\nLicense\n-------\n\n`Apache license version 2 \u003cLICENSE\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodeteam%2Fnagios-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodeteam%2Fnagios-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodeteam%2Fnagios-unity/lists"}