all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH datacenter-manager] remove visualize_rrd.py helper script
Date: Wed, 25 Mar 2026 13:52:04 +0100	[thread overview]
Message-ID: <20260325125204.245242-1-l.wagner@proxmox.com> (raw)

Mainly useful back when we did not have a working UI that could show
graphs. The script has been broken for a while, since it was never
adapted to use the HTTP-only cookie, so it seems okay to just remove it.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 visualize_rrd.py | 55 ------------------------------------------------
 1 file changed, 55 deletions(-)
 delete mode 100755 visualize_rrd.py

diff --git a/visualize_rrd.py b/visualize_rrd.py
deleted file mode 100755
index 24289a3f..00000000
--- a/visualize_rrd.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python3
-# deps: python3-matplotlib python3-pandas python3-requests
-#
-# Usage example:
-# ```
-# export PDM_USERNAME="root@pam"
-# export PDM_PASSWORD="<password>"
-# export PDM_URL="https://172.30.0.4:8443"
-#
-# ./visualize_rrd.py pve/remotes/<remote>/qemu/100 cpu-current
-# ./visualize_rrd.py pbs/remotes/<remote>/datastore/<store> disk-used
-# ```
-
-import os
-import sys
-
-import pandas as pd
-import matplotlib.pyplot as plt
-import requests
-
-for env_var in ["PDM_URL", "PDM_USERNAME", "PDM_PASSWORD"]:
-    if not os.environ.get(env_var):
-        raise Exception(f"{env_var} not set")
-
-url = os.environ["PDM_URL"]
-user = os.environ["PDM_USERNAME"]
-password = os.environ["PDM_PASSWORD"]
-
-query = sys.argv[1]
-rows = sys.argv[2:]
-
-r = requests.post(
-    f"{url}/api2/json/access/ticket",
-    verify=False,
-    data={
-        "username": user,
-        "password": password
-    }
-)
-
-data = r.json()['data']
-csrf = data['CSRFPreventionToken']
-ticket = data['ticket']
-
-r = requests.get(
-    f"{url}/api2/json/{query}/rrddata",
-    params={"cf": "AVERAGE", "timeframe": "hour"},
-    cookies={"PDMAuthCookie": ticket},
-    verify=False
-)
-
-data = r.json()
-df = pd.DataFrame(data['data'])
-df.plot(x='time', y=rows)
-plt.show()
-- 
2.47.3





             reply	other threads:[~2026-03-25 12:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 12:52 Lukas Wagner [this message]
2026-03-25 16:55 ` applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260325125204.245242-1-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal