Skip to content

Commit

Permalink
Merge pull request #52 from nbuchwitz/devel/doc-api-endpoint
Browse files Browse the repository at this point in the history
doc: Describe what an API endpoint is
  • Loading branch information
nbuchwitz authored May 10, 2024
2 parents 42b7c6c + ddcf035 commit 235052f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,18 @@ The ``icinga2`` folder contains the command definition and service examples for

```
usage: check_pve.py [-h] -e API_ENDPOINT [--api-port API_PORT] -u API_USER (-p API_PASSWORD | -t API_TOKEN) [-k] -m
{cluster,version,cpu,memory,swap,storage,io_wait,updates,services,subscription,vm,vm_status,replication,disk-health,ceph-health,zfs-health,zfs-fragmentation,backup} [-n NODE] [--name NAME] [--vmid VMID]
[--expected-vm-status {running,stopped,paused}] [--ignore-vm-status] [--ignore-service NAME] [--ignore-disk NAME] [-w THRESHOLD_WARNING] [-c THRESHOLD_CRITICAL] [-M] [-V MIN_VERSION] [--unit {GB,MB,KB,GiB,MiB,KiB,B}]
{cluster,version,cpu,memory,swap,storage,io_wait,updates,services,subscription,vm,vm_status,replication,disk-health,ceph-health,zfs-health,zfs-fragmentation,backup}
[-n NODE] [--name NAME] [--vmid VMID] [--expected-vm-status {running,stopped,paused}] [--ignore-vm-status] [--ignore-service NAME] [--ignore-disk NAME]
[-w THRESHOLD_WARNING] [-c THRESHOLD_CRITICAL] [-M] [-V MIN_VERSION] [--unit {GB,MB,KB,GiB,MiB,KiB,B}]
Check command for PVE hosts via API
options:
-h, --help show this help message and exit
API Options:
-e API_ENDPOINT, --api-endpoint API_ENDPOINT
PVE api endpoint hostname
-e API_ENDPOINT, -H API_ENDPOINT, --api-endpoint API_ENDPOINT
PVE api endpoint hostname or ip address (no additional data like paths)
--api-port API_PORT PVE api endpoint port
-u API_USER, --username API_USER
PVE api user (e.g. icinga2@pve or icinga2@pam, depending on which backend you have chosen in proxmox)
Expand All @@ -121,9 +122,9 @@ API Options:
-k, --insecure Don't verify HTTPS certificate
Check Options:
-m {cluster,version,cpu,memory,swap,storage,io_wait,updates,services,subscription,vm,vm_status,replication,disk-health,ceph-health,zfs-health,zfs-fragmentation}, --mode {cluster,version,cpu,memory,swap,storage,io_wait,updates,services,subscription,vm,vm_status,replication,disk-health,ceph-health,zfs-health,zfs-fragmentation}
-m {cluster,version,cpu,memory,swap,storage,io_wait,updates,services,subscription,vm,vm_status,replication,disk-health,ceph-health,zfs-health,zfs-fragmentation,backup}, --mode {cluster,version,cpu,memory,swap,storage,io_wait,updates,services,subscription,vm,vm_status,replication,disk-health,ceph-health,zfs-health,zfs-fragmentation,backup}
Mode to use.
-n NODE, --node NODE Node to check (necessary for all modes except cluster and version)
-n NODE, --node NODE Node to check (necessary for all modes except cluster, version and backup)
--name NAME Name of storage, vm, or container
--vmid VMID ID of virtual machine or container
--expected-vm-status {running,stopped,paused}
Expand All @@ -135,14 +136,13 @@ Check Options:
-w THRESHOLD_WARNING, --warning THRESHOLD_WARNING
Warning threshold for check value. Mutiple thresholds with name:value,name:value
-c THRESHOLD_CRITICAL, --critical THRESHOLD_CRITICAL
Critical threshold for check value Mutiple thresholds with name:value,name:value
Critical threshold for check value. Mutiple thresholds with name:value,name:value
-M Values are shown in the unit which is set with --unit (if available). Thresholds are also treated in this unit
-V MIN_VERSION, --min-version MIN_VERSION
The minimal pve version to check for. Any version lower than this will return CRITICAL.
--unit {GB,MB,KB,GiB,MiB,KiB,B}
Unit which is used for performance data and other values
```

## Check examples
Expand Down
4 changes: 3 additions & 1 deletion check_pve.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,9 @@ def parse_args(self):

api_opts = p.add_argument_group('API Options')

api_opts.add_argument("-e", "-H" "--api-endpoint", required=True, help="PVE api endpoint hostname")
api_opts.add_argument("-e", "-H", "--api-endpoint",
required=True,
help="PVE api endpoint hostname or ip address (no additional data like paths)")
api_opts.add_argument("--api-port", required=False, help="PVE api endpoint port")

api_opts.add_argument("-u", "--username", dest='api_user', required=True,
Expand Down

0 comments on commit 235052f

Please sign in to comment.