nsgcli


Namensgcli JSON
Version 2.2.8 PyPI version JSON
download
home_pagehttps://github.com/happygears/nsgcli
SummaryNetSpyGlass CLI
upload_time2025-01-14 21:59:20
maintainerNone
docs_urlNone
authorHappy Gears, Inc
requires_python>=3.6
licenseApache
keywords network monitoring nms netspyglass
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NetSpyGlass Command Line Tools

this package installs Python module `nsgcli` and two command line scripts: `nsgcli` and `nsgql` that
use it

Use script `tools/build.sh` to build and `tools/upload.sh` to push to pypi

Example of API call made by `nsgcli` to nsg-api service:

* System status

  ```bash
  curl -H "X-NSG-Auth-API-Token:$NSG_API_TOKEN" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/status
  ```

* NSGQL

  ```bash
  curl -d '{"targets": [{"format":"table", "nsgql":"select count(key) from alerts"}]}' -X POST -H "X-NSG-Auth-API-Token:$NSG_API_TOKEN" $NSG_SERVICE_URL/v2/query/net/1/data/
  ```
  
* NSGGROK
  
  Parse text with custom pattern
  ```bash
  nsggrok --pattern "hello world of %{WORD:world_name}" text "hello world of Grok"
  {
  "world_name": "Grok"
  }
  ```
  
  Parse syslog message with built-in patterns
  ```bash
  nsggrok log "<13>May 18 11:22:43 carrier sshd: SSHD_LOGIN_FAILED: Login failed for user 'root' from host '10.1.1.1'"
  {
  "sshUser": "root",
  "index": "labdcdev-syslog-short",
  "sshSrcIp": "10.1.1.1",
  "logText": "SSHD_LOGIN_FAILED: Login failed for user 'root' from host '10.1.1.1'",
  "prio": "13",
  "logSyslogSeverityName": "notice",
  "logSource": "carrier",
  "logSyslogText": "<13>May 18 11:22:43 carrier sshd: SSHD_LOGIN_FAILED: Login failed for user 'root' from host '10.1.1.1'",
  "logSyslogFacilityName": "user",
  "logTimestamp": "2021-05-18T11:22:43.000Z",
  "program": "sshd",
  "logSyslogPriority": 13,
  "timestamp": "May 18 11:22:43",
  "logSyslogFacilityCode": 1,
  "logSyslogSeverityCode": 5
  }
  ```
  
* Meraki API call
```bash
curl -G -H "X-NSG-Auth-API-Token:$NSG_API_TOKEN" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/exec/api --data-urlencode 'region=world' --data-urlencode 'url=https://api.meraki.com/api/v1/organizations/626563298157920259/devices' --data-urlencode 'method=GET' --data-urlencode 'args=gap-meraki'
```

* Test connection to remote server
```bash
curl -G -H "X-NSG-Auth-API-Token:$NSG_API_TOKEN" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/exec/connect --data-urlencode 'region=world' --data-urlencode 'args=10.210.24.112 9339 1000'
```

* Set log level
```bash
curl -G -H "X-NSG-Auth-API-Token:$NSG_API_TOKEN" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/exec/set_log_level --data-urlencode 'region=world' --data-urlencode 'args=tme-server-15v io.grpc DEBUG'
```

* Send PING command to an agent
```bash
curl -L -H "X-NSG-Auth-API-Token:$NSG_API_TOKEN" $NSG_SERVICE_URL/apiv3/net/1/exec/ping/agent/vkhome?address=127.0.0.1
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/happygears/nsgcli",
    "name": "nsgcli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "network monitoring NMS netspyglass",
    "author": "Happy Gears, Inc",
    "author_email": "vadim@happygears.net",
    "download_url": "https://files.pythonhosted.org/packages/5d/d6/ce83f475c70d1d5e9a57d70f10e0c2e317aa1b9d03242f761bcd84fb7abe/nsgcli-2.2.8.tar.gz",
    "platform": null,
    "description": "# NetSpyGlass Command Line Tools\n\nthis package installs Python module `nsgcli` and two command line scripts: `nsgcli` and `nsgql` that\nuse it\n\nUse script `tools/build.sh` to build and `tools/upload.sh` to push to pypi\n\nExample of API call made by `nsgcli` to nsg-api service:\n\n* System status\n\n  ```bash\n  curl -H \"X-NSG-Auth-API-Token:$NSG_API_TOKEN\" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/status\n  ```\n\n* NSGQL\n\n  ```bash\n  curl -d '{\"targets\": [{\"format\":\"table\", \"nsgql\":\"select count(key) from alerts\"}]}' -X POST -H \"X-NSG-Auth-API-Token:$NSG_API_TOKEN\" $NSG_SERVICE_URL/v2/query/net/1/data/\n  ```\n  \n* NSGGROK\n  \n  Parse text with custom pattern\n  ```bash\n  nsggrok --pattern \"hello world of %{WORD:world_name}\" text \"hello world of Grok\"\n  {\n  \"world_name\": \"Grok\"\n  }\n  ```\n  \n  Parse syslog message with built-in patterns\n  ```bash\n  nsggrok log \"<13>May 18 11:22:43 carrier sshd: SSHD_LOGIN_FAILED: Login failed for user 'root' from host '10.1.1.1'\"\n  {\n  \"sshUser\": \"root\",\n  \"index\": \"labdcdev-syslog-short\",\n  \"sshSrcIp\": \"10.1.1.1\",\n  \"logText\": \"SSHD_LOGIN_FAILED: Login failed for user 'root' from host '10.1.1.1'\",\n  \"prio\": \"13\",\n  \"logSyslogSeverityName\": \"notice\",\n  \"logSource\": \"carrier\",\n  \"logSyslogText\": \"<13>May 18 11:22:43 carrier sshd: SSHD_LOGIN_FAILED: Login failed for user 'root' from host '10.1.1.1'\",\n  \"logSyslogFacilityName\": \"user\",\n  \"logTimestamp\": \"2021-05-18T11:22:43.000Z\",\n  \"program\": \"sshd\",\n  \"logSyslogPriority\": 13,\n  \"timestamp\": \"May 18 11:22:43\",\n  \"logSyslogFacilityCode\": 1,\n  \"logSyslogSeverityCode\": 5\n  }\n  ```\n  \n* Meraki API call\n```bash\ncurl -G -H \"X-NSG-Auth-API-Token:$NSG_API_TOKEN\" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/exec/api --data-urlencode 'region=world' --data-urlencode 'url=https://api.meraki.com/api/v1/organizations/626563298157920259/devices' --data-urlencode 'method=GET' --data-urlencode 'args=gap-meraki'\n```\n\n* Test connection to remote server\n```bash\ncurl -G -H \"X-NSG-Auth-API-Token:$NSG_API_TOKEN\" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/exec/connect --data-urlencode 'region=world' --data-urlencode 'args=10.210.24.112 9339 1000'\n```\n\n* Set log level\n```bash\ncurl -G -H \"X-NSG-Auth-API-Token:$NSG_API_TOKEN\" $NSG_SERVICE_URL/v2/nsg/cluster/net/1/exec/set_log_level --data-urlencode 'region=world' --data-urlencode 'args=tme-server-15v io.grpc DEBUG'\n```\n\n* Send PING command to an agent\n```bash\ncurl -L -H \"X-NSG-Auth-API-Token:$NSG_API_TOKEN\" $NSG_SERVICE_URL/apiv3/net/1/exec/ping/agent/vkhome?address=127.0.0.1\n```\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "NetSpyGlass CLI",
    "version": "2.2.8",
    "project_urls": {
        "Homepage": "https://github.com/happygears/nsgcli"
    },
    "split_keywords": [
        "network",
        "monitoring",
        "nms",
        "netspyglass"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17f51377a3ce0cf6c4345af3a2a2aaf0444ce3c01710d25d29477e833725958f",
                "md5": "867bb9b4f58a541cf5b6309b20ada3aa",
                "sha256": "2eefdf6acb1b56513f45fd9fc2d6e83ed07b5e86d8885532be2086f160315639"
            },
            "downloads": -1,
            "filename": "nsgcli-2.2.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "867bb9b4f58a541cf5b6309b20ada3aa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 47831,
            "upload_time": "2025-01-14T21:59:17",
            "upload_time_iso_8601": "2025-01-14T21:59:17.690750Z",
            "url": "https://files.pythonhosted.org/packages/17/f5/1377a3ce0cf6c4345af3a2a2aaf0444ce3c01710d25d29477e833725958f/nsgcli-2.2.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5dd6ce83f475c70d1d5e9a57d70f10e0c2e317aa1b9d03242f761bcd84fb7abe",
                "md5": "c8801c38e2f9393f35602b2a3e7d28c4",
                "sha256": "10d20eb1e52d74b1e0d524b70ce25d34dee13c354ff3abb3013a9ada3bc7bf0d"
            },
            "downloads": -1,
            "filename": "nsgcli-2.2.8.tar.gz",
            "has_sig": false,
            "md5_digest": "c8801c38e2f9393f35602b2a3e7d28c4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 35681,
            "upload_time": "2025-01-14T21:59:20",
            "upload_time_iso_8601": "2025-01-14T21:59:20.008749Z",
            "url": "https://files.pythonhosted.org/packages/5d/d6/ce83f475c70d1d5e9a57d70f10e0c2e317aa1b9d03242f761bcd84fb7abe/nsgcli-2.2.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-14 21:59:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "happygears",
    "github_project": "nsgcli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nsgcli"
}
        
Elapsed time: 0.49250s