Skip to content

Commit 80866d6

Browse files
authored
Merge pull request #14 from NETWAYS/release/v0-2-0
Release v0.2.0
2 parents 12ff2e5 + 4dab66c commit 80866d6

File tree

3 files changed

+15
-22
lines changed

3 files changed

+15
-22
lines changed

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,11 @@ Alternatively you can install with pip:
1818

1919
pip3 install -r requirements.txt
2020

21-
Make sure to modify the shebang to your environment, one of the following should be fine.
22-
23-
#!/usr/bin/env python3
24-
#!/usr/bin/python3
25-
26-
Then copy the file to your plugin dir:
27-
28-
cp check_vmware_nsxt.py /usr/lib*/nagios/plugins/check_vmware_nsxt
29-
chmod 755 /usr/lib*/nagios/plugins/check_vmware_nsxt
30-
31-
Also see the [Icinga 2 example command](icinga2/command.conf).
32-
3321
## Usage
3422

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

6352
```
64-
$ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode cluster-status
53+
check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode cluster-status
54+
6555
[OK] control_cluster_status=STABLE - mgmt_cluster_status=STABLE - control_cluster_status=STABLE - nodes_online=3
6656
6757
[OK] DATASTORE: STABLE - 3 members
@@ -80,24 +70,27 @@ $ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password
8070
Mode: alarms
8171

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

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

9789
Mode: capacity-usage
9890

9991
```
100-
$ ./check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode capacity-usage
92+
check_vmware_nsxt.py --api 'https://vmware-nsx.local' -u icinga -p password --mode capacity-usage
93+
10194
[OK] 28 info - no usages - last update: 2021-04-29 19:06:12
10295
10396
[OK] [INFO] System-wide NAT rules: 0 of 25000 (0%)

check_vmware_nsxt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from requests.auth import HTTPBasicAuth
4545

4646

47-
VERSION = '0.1.2'
47+
__version__ = '0.2.0'
4848

4949
OK = 0
5050
WARNING = 1
@@ -465,7 +465,7 @@ def main(args):
465465
urllib3.disable_warnings()
466466

467467
if args.version:
468-
print("check_vmware_nsxt version %s" % VERSION)
468+
print(f"check_vmware_nsxt version {__version__}")
469469
return 3
470470

471471
client = Client(args.api, args.username, args.password, verify=(not args.insecure), max_age=args.max_age)

0 commit comments

Comments
 (0)