Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.2.0 #14

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,11 @@ Alternatively you can install with pip:

pip3 install -r requirements.txt

Make sure to modify the shebang to your environment, one of the following should be fine.

#!/usr/bin/env python3
#!/usr/bin/python3

Then copy the file to your plugin dir:

cp check_vmware_nsxt.py /usr/lib*/nagios/plugins/check_vmware_nsxt
chmod 755 /usr/lib*/nagios/plugins/check_vmware_nsxt

Also see the [Icinga 2 example command](icinga2/command.conf).

## Usage

```
$ ./check_vmware_nsxt.py --help
...
check_vmware_nsxt.py --help
optional arguments:
-h, --help show this help message and exit
--api API, -A API VMware NSX-T URL without any sub-path (e.g. https://vmware-nsx.local)
Expand All @@ -44,7 +32,8 @@ optional arguments:
Password for Basic Auth
--mode MODE, -m MODE Check mode
--exclude [EXCLUDE ...]
Exclude alarms or usage from the check results. Can be used multiple times and supports regular expressions.
Exclude alarms or usage from the check results.
Can be used multiple times and supports regular expressions.
--max-age MAX_AGE, -M MAX_AGE
Max age in minutes for capacity usage updates. Defaults to 5
--version, -V Print version
Expand All @@ -61,7 +50,8 @@ The `--exclude` parameter will match against alarms and capacity-usage. It uses
Mode: cluster-status

```
$ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode cluster-status
check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode cluster-status
[OK] control_cluster_status=STABLE - mgmt_cluster_status=STABLE - control_cluster_status=STABLE - nodes_online=3
[OK] DATASTORE: STABLE - 3 members
Expand All @@ -80,24 +70,27 @@ $ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password
Mode: alarms

```
$ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode alarms
check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode alarms
[WARNING] 1 alarms - 1 medium
[MEDIUM] (2021-04-26 17:25:18) (node1) Intelligence Health/Storage Latency High - Intelligence node storage latency is high.
| alarms=1;;;0 alarms.medium=1;;;0
```

```
$ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode alarms --exclude "LOW"
# Excluded alerts will still be counted, but are not factored into the exit code
check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode alarms --exclude "LOW"
# Hint: Excluded alerts will still be counted, but are not factored into the exit code
[OK] 1 alarms
| alarms=1;;;0
```

Mode: capacity-usage

```
$ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode capacity-usage
check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode capacity-usage
[OK] 28 info - no usages - last update: 2021-04-29 19:06:12
[OK] [INFO] System-wide NAT rules: 0 of 25000 (0%)
Expand Down
4 changes: 2 additions & 2 deletions check_vmware_nsxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from requests.auth import HTTPBasicAuth


VERSION = '0.1.2'
__version__ = '0.2.0'

OK = 0
WARNING = 1
Expand Down Expand Up @@ -465,7 +465,7 @@ def main(args):
urllib3.disable_warnings()

if args.version:
print("check_vmware_nsxt version %s" % VERSION)
print(f"check_vmware_nsxt version {__version__}")
return 3

client = Client(args.api, args.username, args.password, verify=(not args.insecure), max_age=args.max_age)
Expand Down
File renamed without changes.