Coder Social home page Coder Social logo

nbuchwitz / check_pve Goto Github PK

View Code? Open in Web Editor NEW
104.0 9.0 33.0 169 KB

Icinga check command for Proxmox VE via API

License: GNU General Public License v2.0

Python 99.52% Dockerfile 0.48%
icinga2 proxmox-ve pve proxmox monitoring hacktoberfest

check_pve's Introduction

check_pve

Icinga check command for Proxmox VE via API

Linter

Setup

Requirements

This check command depends on Python 3 and the following modules:

  • requests
  • argparse
  • packaging

Installation on Debian / Ubuntu

apt install python3 python3-requests python3-packaging

Installation on Rocky / Alma Linux 9

yum install python3 python3-requests python3-packaging

Installation on FreeBSD

pkg install python3 py39-requests py39-packaging

Installation from requirements file

pip3 install -r requirements.txt

Installation as Docker container

docker build -t check_pve .

After this, you can start the container like so:

docker run -d --name check_pve --rm check_pve

The container will keep running without having the need for any of the requirements listed above (for environments that do not support this). Running a check is as simple as:

docker exec check_pve python check_pve.py ....rest of the default arguments listed below....

Create a API user in Proxmox VE

Create a role named Monitoring and assign necessary privileges:

pveum roleadd Monitoring
pveum rolemod Monitoring --privs VM.Monitor,Sys.Audit,Sys.Modify,Datastore.Audit,VM.Audit

Create a user named monitoring and set password:

pveum useradd monitoring@pve --comment "The ICINGA 2 monitoring user"

Use token based authorization (recommended)

Create an API token named monitoring for the user monitoring:

pveum user token add monitoring@pve monitoring

Please save the token secret as there isn't any way to fetch it at a later point.

Assign role monitoring to token monitoring and the user monitoring@pve:

pveum acl modify / --roles Monitoring --user 'monitoring@pve'
pveum acl modify / --roles Monitoring --tokens 'monitoring@pve!monitoring'

Use password based authorization

Set password for the user monitoring:

pveum passwd monitoring@pve

Assign monitoring role to user monitoring

pveum acl modify / --users monitoring@pve --roles Monitoring

For further information about the Proxmox VE privilege system have a look into the documentation.

Usage

The icinga2 folder contains the command definition and service examples for use with Icinga2.

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,io-wait,updates,services,subscription,vm,vm_status,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] [--ignore-pools 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, -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)
  -p API_PASSWORD, --password API_PASSWORD
                        PVE API user password
  -t API_TOKEN, --api-token API_TOKEN
                        PVE API token (format: TOKEN_ID=TOKEN_SECRET
  -k, --insecure        Don't verify HTTPS certificate

Check Options:
  -m {cluster,version,cpu,memory,swap,storage,io_wait,io-wait,updates,services,subscription,vm,vm_status,vm-status,replication,disk-health,ceph-health,zfs-health,zfs-fragmentation,backup}, --mode {cluster,version,cpu,memory,swap,storage,io_wait,io-wait,updates,services,subscription,vm,vm_status,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, 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}
                        Expected VM status
  --ignore-vm-status    Ignore VM status in checks
  --ignore-service NAME
                        Ignore service NAME in checks
  --ignore-disk NAME    Ignore disk NAME in health check
  --ignore-pools NAME   Ignore vms and containers in pool(s) NAME in checks
  -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
  -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

Check cluster health

./check_pve.py -u <API_USER> -t <API_TOKEN> -e <API_ENDPOINT> -m cluster
OK - Cluster 'proxmox1' is healthy'

Check PVE version

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m version -V 5.0.0
OK - Your pve instance version '5.2' (0fcd7879) is up to date

Check CPU load

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m cpu -n node1
OK - CPU usage is 2.4%|usage=2.4%;;

Check memory usage

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m memory -n node1
OK - Memory usage is 37.44%|usage=37.44%;; used=96544.72MB;;;257867.91

Check disk-health

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m disk-health -n node1
OK - All disks are healthy|wearout_sdb=96%;; wearout_sdc=96%;; wearout_sdd=96%;; wearout_sde=96%;;

Check storage usage

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m storage -n node1 --name local
OK - Storage usage is 54.23%|usage=54.23%;; used=128513.11MB;;;236980.36

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m storage -n node1 --name vms-disx
CRITICAL - Storage 'vms-disx' doesn't exist on node 'node01'

Check subscription status

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m subscription -n node1 -w 50 -c 10
OK - Subscription of level 'Community' is valid until 2019-01-09

Check VM status

Without specifying a node name:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm --name test-vm
OK - VM 'test-vm' is running on 'node1'|cpu=1.85%;; memory=8.33%;;

You can also pass a container name for the VM check:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm --name test-lxc
OK - LXC 'test-lxc' on node 'node1' is running|cpu=0.11%;; memory=13.99%;;

With memory thresholds:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm --name test-vm -w 50 -c 80
OK - VM 'test-vm' is running on 'node1'|cpu=1.85%;; memory=40.33%;50.0;80.0

With a specified node name, the check plugin verifies on which node the VM runs.

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm -n node1 --name test-vm
OK - VM 'test-vm' is running on node 'node1'|cpu=1.85%;; memory=8.33%;;

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm -n node1 --name test-vm
WARNING - VM 'test-vm' is running on node 'node2' instead of 'node1'|cpu=1.85%;; memory=8.33%;;

If you only want to gather metrics and don't care about the vm status add the --ignore-vm-status flag:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm --name test-vm --ignore-vm-status
OK - VM 'test-vm' is not running

Specify the expected VM status:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm --name test-vm --expected-vm-status stopped
OK - VM 'test-vm' is not running

For hostalive checks without gathering performance data use vm_status instead of vm. The parameters are the same as with vm.

Check swap usage

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m swap -n pve
OK - Swap usage is 0.0 %|usage=0.0%;; used=0.0MB;;;8192.0

Check storage replication status

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m replication -n node1
OK - No failed replication jobs on node1

Check ceph cluster health

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m ceph-health
WARNING - Ceph Cluster is in warning state

Check ZFS pool health

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m zfs-health -n pve
OK - All ZFS pools are healthy

Check for specific pool:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m zfs-health -n pve --name rpool
OK - ZFS pool 'rpool' is healthy

Check ZFS pool fragmentation

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m zfs-fragmentation -n pve -w 40 -c 60
CRITICAL - 2 of 2 ZFS pools are above fragmentation thresholds:

- rpool (71 %) is CRITICAL
- diskpool (50 %) is WARNING
|fragmentation_diskpool=50%;40.0;60.0 fragmentation_rpool=71%;40.0;60.0

Check for specific pool:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m zfs-fragmentation -n pve --name diskpool -w 40 -c 60
WARNING - Fragmentation of ZFS pool 'diskpool' is above thresholds: 50 %|fragmentation=50%;40.0;60.0

Check VZDump Backups

Check task history on all nodes:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m backup
CRITICAL - 8 backup tasks successful, 3 backup tasks failed

Check for specific node and time frame:

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m backup -n pve -c 86400
OK - 2 backup tasks successful, 0 backup tasks failed within the last 86400.0s

FAQ

Individual thresholds per metric

You can either specify a threshold for warning or critical which is applied to all metrics or define individual thresholds like this (name:value,name:value,...):

./check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m vm --name test-vm -w memory:50 -c cpu:50,memory:80
OK - VM 'test-vm' is running on 'node1'|cpu=1.85%;50.0; memory=40.33%;50.0;80.0

Could not connect to PVE API: Failed to resolve hostname

Verify that your DNS server is working and can resolve your hostname. If everything is fine check for proxyserver environment variables (HTTP_PROXY,HTTPS_PROXY), which maybe not allow communication to port 8006.

Contributors

Thank you to everyone, who is contributing to check_pve: https://github.com/nbuchwitz/check_pve/graphs/contributors.

check_pve's People

Contributors

au-ee avatar cormoran96 avatar crycode-de avatar inmediasit avatar jschanz avatar magenbrot avatar nbuchwitz avatar s3lph avatar sebastianberm avatar taam avatar voileux avatar wopfel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

check_pve's Issues

Adding VM check to sample files?

Thanks for supplying the Icinga2 conf files. Unfortunately, I've spotted your files just a few moments after typing the config by myself... ๐Ÿ˜‰

In my config, there's a (very rudimentary) VM check. Maybe adding that part to your conf file would help other people?

object Host "..." {
  import "proxmox-host"

  vars.virtual_machines["icinga-alt"] = {
  }
  ...
}

apply Service "pve-vm " for (vm => config in host.vars.virtual_machines) {
  import "pve-service"

  vars.pve_mode = "vm"
  vars.pve_resource_name = vm

  assign where host.vars.pve_host
}

Kind regards,
Bernd

Check VM status on specific node

Check for VM status should check if the VM is running on the specified node name, if one is supplied.

Possible check results:

OK:
VM is running on the specified node

WARNING:
VM is running on another node

CRITICAL:
VM is not running.

thresholds with mode subscription

If you add a warning threshold of 60 days (-w60) and a critical threshold of 30 days (-c30) you'll get the following error:
check_pve.py: error: Critical value must be greater than warning value

Performance data/units

There are some issues regarding performance data and units, in particular MB is used with 2^20 as conversion factor, which is wrong (in terms of SI units), the correct unit for this conversion factor would be MiB. If MB is kept, the correct factor of 10^6 should be used.

Performance data currently is technically wrong for the same reason. However, consumers treat MB differently, e.g. Icinga before version 2.13.0 treats MB like MiB, using 2^20 as conversion factor, so it kinda works despite being not really correct. Icinga since version 2.13.0 learned about new units and should now treat them correctly, so MiB could be used, but there are probably other consumers that can't handle MiB. (Also Icingaweb2 seems to do it's own unit/conversion handling and currently messes things up as well.) So the best solution regarding performance data might be to not emit a scaled unit but just bytes with B.

Exception if cluster data doesn't contains key 'name' and not contains key 'vmid'

image

Traceback (most recent call last):
File "/home/nagios/check_pve/check_pve.py", line 819, in
pve.check()
File "/home/nagios/check_pve/check_pve.py", line 678, in check
self.check_vm_status(idx, only_status=only_status)
File "/home/nagios/check_pve/check_pve.py", line 208, in check_vm_status
if vm['name'] == idx or vm['vmid'] == idx:
~~^^^^^^^^
KeyError: 'name'

Line 208
Change:
if vm['name'] == idx or vm['vmid'] == idx:
By:
if ('name' in vm and vm['name'] == idx) or ('vmid' in vm and vm['vmid'] == idx):

Thanks for this good code!!!

Ceph health messages

For the ceph health check it would be nice to see, which checks are failing. Just as an starting idea, locally I hacked in the following lines at the end of the check_ceph_health function (but my python knowledge is rather limited):

        messages = ", ".join(v['summary']['message'] for k, v in ceph_health.get('checks', {}).items())
        if len(messages) > 0:
            self.check_message += ": " + messages

(Technically it would probably be better to put these details in separate lines.)

UNKNOWN - Could not connect to PVE API: Certificate validation failed

Hi,
I just set up my first two proxmox nodes in a cluster and want to monitor health.

When I do the first tests I get the error above.

/check_pve.py -u monitoring -p ------- -e target -m version -V 5.0.0
UNKNOWN - Could not connect to PVE API: Certificate validation failed

passwordless ssh connect between the two nodes is possible, both have the same software level.

root@xen5:/# ssh xen4 uname -a
Linux xen4 4.15.18-18-pve #1 SMP PVE 4.15.18-44 (Wed, 03 Jul 2019 11:19:13 +0200) x86_64 GNU/
Any hint on hotwo proceed ?

Regards
Joachim

VM and LXC status check should also include disk information.

I would like to monitor disk usage for vm and lxc. I did not find a way to monitor disk usage of a vm/lxc with the current implementation. Please guide me in the right direction if I simply missed that functionality while reading through documentation/code.

My first thought was to implement this by adding additional performance data for the disk to check_vm_status(). I am unsure if this should be guarded by an additional parameter, as it would extend the monitoring for current users and might lead to unexpected check results.

Let me know what you think about this. I would gladly create a PR.

Setting of pve_unit useless?

Hi, in the service.conf sample file there are some lines

pve_unit = "%"

But there's no reference to pve_unit in the command.conf file. Should this be related to the -M switch?

Kind regards,
Bernd

README

Hi Nicolai,

  • small typo in README (missing "r")
    pveum user token add monitoing@pve monitoring

  • is "Sys.Modify" really needed ... if yes, why?
    pveum roleadd Monitoring
    pveum rolemod Monitoring --privs Sys.Modify,VM.Monitor,Sys.Audit,Datastore.Audit,VM.Audit

Thanx!

Warning/Critical Thresholds for Mode 'vm'

Hi,
I just noticed that a VM is running high on memory but the check says it's ok.

check_pve.py --vmid X -e X -k -m vm -n X -p X -u X -w 50 -c 60
OK - VM 'X' on node 'X' is running|cpu=3.87%;50.0;60.0 memory=94.5%;50.0;60.0

Might it be possible to differentiate between CPU and memory warning levels?

[BUG] Invalid usernameor password upon connection

I followed the documentation to create a role, a user nagios@pam, a password and a an API token.
When I try the following or similar:
./check_pve.py -u 'nagios@pam' -p "<pass>" -k -e 10.10.7.9:8006/api2/json/ -m version -V 8.0.0
Then I get the error:
UNKNOWN - Could not fetch data from API: Could not connection to PVE API: invalid username or password
The same when using the token.

The user nagios exists in the OS. I can ssh using nagios.
The user exists in the Proxmox GUI. Password was set per command line as described in the guide here as well as using the GUI. Same for the token. The role and privileges are visible in the GUI.
When I follow the PVE documentation by doing:

curl --silent --insecure --data "username=nagios@pam&password=<pass>"  https://10.10.7.9:8006/api2/json/access/ticket| jq --raw-output '.data.ticket' | sed 's/^/PVEAuthCookie=/' > cookie 
curl  --insecure --cookie "$(<cookie)" https://10.10.7.9:8006/api2/json/nodes/$TARGETNODE/status | jq '.'

I get the data and no error.
I suspect the error message of the script is misleading and there is another error underlying.

Steps to reproduce the behavior:

  1. Follow the documentation here.
  2. Try the example.

Expected behavior
Get an icinga compatible result.

Environment (please complete the following information):
Linux 6.2.16-14-pve
PVE 8.0.4
Python 3.11.2

API: Access denied

I ran the following commands:

pveum roleadd Monitoring
pveum rolemod Monitoring --privs Sys.Modify,VM.Monitor,Sys.Audit,Datastore.Audit,VM.Audit
pveum useradd monitoring@pve --comment "The ICINGA 2 monitoring user"
pveum user token add monitoring@pve monitoring # there is a typo in the README.md, this is the correct version
pveum acl modify / --roles Monitoring --tokens 'monitoring@pve!monitoring'

But I can not access the API:

root@proxmox-sgp:~# ./check_pve.py -u monitoring@pve -t monitoring=5e3dd1bd-xxxx-xxxx-xxxx-xxxxxxxxxxxx -e localhost -m cluster -k
UNKNOWN - Could not fetch data from API: Access denied. Please check if API user has sufficient permissions / the role has been assigned.

Any idea what the problem could be?

I pulled the latest master and PVE is 7.0-11.

HTTP error code was 400 if storage name invalid

If the check command tries to fetch information for a storage, which doesn't exist, a http error message is shown. It should return a more clear message instead.

./check_pve.py -e pve-node -u monitor@pve -p DumpPassword -k --node pve01 -m storage --name invalidstoragename
UNKNOWN - Could not fetch data from API: HTTP error code was 400

Error thrown by python: type object 'datetime.datetime' has no attribute 'UTC'

Hi,
I just downloaded your current version of the script since I've spotted the backup check. Very nice!

When running on my system, I get an error:

root@icinga ~ # /usr/local/bin/check_pve-new-github.py -e xxx -m backup -n xxx -p xxx -u monitoring@pve -c 9186400
Traceback (most recent call last):
  File "/usr/local/bin/check_pve-new-github.py", line 1110, in <module>
    pve.check()
  File "/usr/local/bin/check_pve-new-github.py", line 875, in check
    self.check_vzdump_backup(self.options.name)
  File "/usr/local/bin/check_pve-new-github.py", line 680, in check_vzdump_backup
    now = datetime.now(datetime.UTC).timestamp()
AttributeError: type object 'datetime.datetime' has no attribute 'UTC'

Changing line 680 to:
now = datetime.utcnow().timestamp()

the script runs without error. For example:

WARNING - 21 backup tasks successful, 0 backup tasks failed within the last 9186400.0s
There are guests not covered by any backup schedule: 544 547 552 549 117 521 548 545 551 550

Maybe it's specific to my very old Ubuntu installation. But if anyone else faces this error, I'm happy to share my solution.

My system version:

root@icinga ~ # lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal

Regards,
Bernd

Help for VMs Template configuration

I installed the module '' and the script.
I entered the service.conf into /etc/icinga2/conf.d/

After the import, the hosts are displayed with checks, but the VMs are not.
What do I have to configure so that the VMs get the checks?

Thanks

[BUG] readme.md "necessary privileges" changed

according to proxmox api viewer, the endpoint to check updates requires sys.modify permissions now. please update readme.md to make note of that

https://pve:8006/pve-docs/api-viewer/index.html#/nodes/{node}/apt/update

more detail on the vm checks - not every stopped machine is a warning

Hello --

I'd like to be able to configure which vm's should give back warning or critical statuses if not running - some vm's may be ran only sporadically for a reason. I'd like to track them using icinga and grafana, but I am not bothered if they're off. Any way to have a (per vm) variable to describe this?

Thanks

invalid username or password error but curl works

I'm sure I'm doing something wrong, as I'm new to icinga2/nagios, but when I run '/usr/lib/nagios/plugins/check_pve.py -u monitoring@pve -p blablabla -k -e pve1.ncimfg.com -p 8006 -m '$anyCheck' I get 'UNKNOWN - Could not fetch data from API: Could not connection to PVE API: invalid username or password'

FYI, I have very little experience with python.
I had to change
from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
to
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Before that change it would return nothing. So I may have something wrong, but I can curl and get a token using the username and password, then using the token, I can curl and get data from the API. So I'm sure the password is correct.

I have tried to print from inside def get_ticket(self): (not sure if you can do that in python), but I get nothing on the command line. I'm not sure if get_ticket is happening at all now.

Any help would be appreciated.

Swap check

A swap check should be easy to add, basically just copy&paste from the memory check. (Added a check_swap locally some months ago, works well so far.)

backup check for single VM

The overall scan for the backups is very neat since it has this "There are guests not covered by any backup schedule..." feature.
But in some circumstances i don't want to have all VMs backupped (for example if i use external software) and so i always get a "WARNING" in the check.

A Backup check for a single VM would be great.

Include checking for root volume status when checking vm's

When checking a container with the mode equal to "vm", please include also checking the used space in the root volume.

Having free space in the root volume is condition to be able to consider that the container is properly running.

Right now there's no event when the root volume becomes full.

[BUG] Subscription informations are not available

Describe the bug
On the PVE there is a current "Proxmox VE Basic Subscription 1 CPU/year" license installed.
When reading out the subscription infos i only get "OK - ".

To Reproduce
used command:
check_pve.py -u <API_USER> -p <API_PASSWORD> -e <API_ENDPOINT> -m subscription -n node1 -w 50 -c 10

Expected behavior
Should get the license name and license period.

Environment (please complete the following information):

  • Ubuntu 24.04
  • Python 3.12.3
  • PVE 8.2.2

nrpe Could not fetch data from API: HTTP error code was 500

Hi,

We tried to install your plugin. We use proxmox 7.0-11.
Here is our nrpe config

command[check_cpu_pve]=sudo /usr/lib/nagios/plugins/check_pve.py -u monitoring@pve -p <my_secret_pass> -e <api-endpoint> -m cpu -n <node>
command[check_memory_pve]=/usr/lib/nagios/plugins/check_pve.py -u monitoring@pve -p <my_secret_pass> -e <api-endpoint> -m memory -n <node>

When we execute commands in shell we have correct respond.
But when we execute command via nrpe we have this respond:

UNKNOWN - Could not fetch data from API: HTTP error code was 500

and this error in syslog

Sep 21 08:46:48 node-05-cloud pvedaemon[159490]: <root@pam> successful auth for user 'monitoring@pve'
Sep 21 08:46:48 node-05-cloud pveproxy[616954]: Use of uninitialized value $path in hash element at /usr/share/perl5/PVE/RPCEnvironment.pm line 123.
Sep 21 08:46:48 node-05-cloud pveproxy[616954]: Use of uninitialized value $path in string eq at /usr/share/perl5/PVE/AccessControl.pm line 1439.
Sep 21 08:46:48 node-05-cloud pveproxy[616954]: Use of uninitialized value $path in hash element at /usr/share/perl5/PVE/RPCEnvironment.pm line 59.
Sep 21 08:46:48 node-05-cloud pveproxy[616954]: Use of uninitialized value $path in hash element at /usr/share/perl5/PVE/RPCEnvironment.pm line 71.
Sep 21 08:46:48 node-05-cloud pveproxy[616954]: Use of uninitialized value $path in hash element at /usr/share/perl5/PVE/RPCEnvironment.pm line 88.

Could you help me to resolve this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.