script

  1. P

    [TUTORIAL] CheckMK local check for monitoring backup status

    Hi! I just wanted to share my script to monitor the backup status for the vms in Proxmox. It is written for use in CheckMK. You need to have the CheckMK linux client installed on proxmox. I should be easily adaptable for other systems like zabbix, nagios etc. You need to put the script in...
  2. F

    bash script at Proxmox start-up

    I've put a bash script at /etc/init.d, changed in to executable but Proxmox doesn't execute it when it boots. How can I add a command script to execute when Proxmox boots?
  3. K

    [SOLVED] "qm start 100" from a bash script

    Hello there, I've moved my SR-IOV start-up script out of a systemd unit and into a shell script invoked by a systemd unit after multi-user.target is reached. I did this as, at least on the 5.19 kernel, pve-guests.service seems to reset my NIC, or at least does something that causes SR-IOV to be...
  4. S

    Syncing IP's from fail2ban

    I have been testing my script to copy fail2ban log files to Proxmox firewall and have managed to make it work... one time :) cat /root/bin/banned2proxmox.sh #!/bin/bash # # Sync fail2ban log files from client servers rsync -a root@vm1.ic4.eu:/var/log/fail2ban.log /root/bin/fail2ban-vm1.log...
  5. DynFi User

    Shutting down all VM / CT in parallel

    I would like to know if you know how I can shutdown ALL VM / CT in parallel ? (as in the GUI). I have setup a script to shutdown VM, CT and then set the noout flag on the CEPH Cluster and finally shutdown the server. Problem is that the script iterates with a for loop (which causes VM to be...
  6. U

    Proxmox API file-write special characters in content

    Hi, I-m trying to copy the content of script through the Proxmox guest agent to a windows client in Powershell. However, when I have a curly brackets "{" in the script the file-write will fail with the error {}":"property is not defined in schema and the schema does not allow additional...
  7. D

    APCUPSD

    Hello dear Proxmox team, Dear Proxmox Team, Our server is connected to a UPS. In the event of a power failure, the VMs on the server should shut down cleanly, as should the physical servers. Is there a template for a script that shuts down the individual VMs before the physical server...
  8. S

    execute qm monitor commands in shell script

    If I execute this below lines on proxmox shell to wakeup my mac os it works flawlessly but in shell script (.sh) it doesn't work qm monitor 503 system_wakeup quit I tried this code which is posted as solution in another question but it throws an error "2022/02/19 12:02:58 socat[6449] E...
  9. G

    global proxy settings through snippets?

    Hi, does anybody know how to insert proxy-variables through snippets so my CI-vm can reach out to get it's updates during first boot? I'm looking for some documentation but cannot find it. Thanks in advance.
  10. 8

    [SOLVED] Attach disk from another VM

    Hi Proxmox Users, First of all I would say you thanks to all of you for the support and the help you can provide to everybody :) Today I work on Windows Server VM 904, But I did mistake and my windows server restart in loop... because one script restart computer when it's starting... (local...
  11. B

    [TUTORIAL] After searching for a way to automagically connect to SPICE and coming up empty handed, I've created a script for anyone with the same issue!

    Let me preface this by saying this is specifically for Windows. A large part of my solution actually uses the officially recommended BASH script, and what I've created is essentially a batch file that executes said script on a remote Linux machine and then copies the output to be executed by the...
  12. S

    Edit configuration before starting VM through custom hook script

    First of all I would like to thank the Proxmox team for the great software and the nice community they built. I'm using a custom hook script (hookscript.pl) to manage VMs on a system with various GPUs passed through. The first motivation to do so is to avoid a VM (which requires a GPU) being...
  13. C

    Start VM => run rsync => stop VM

    Hello all I am looking for suggestions or maybe an ready to use script to accomplish this scenario: Start a VM on schedule => run rsync (may take awhile) => stop VM Thx in advance.
  14. T

    [TUTORIAL] Aussperrschutz, wenn man an der Proxmox Firewall (iptables) rumschraubt

    Wer kennt das nicht, man will die PVE Kiste securen und erstellt Rules in den iptables. Plötzlich hat man sich selber ausgesperrt. Ärgerlich und kann dann nur noch mittels Rescuemodus behoben werden. Bei grossen Kisten mit vielen VMs ist das nicht sonderlich toll. Habe mir ein Script...
  15. J

    My `pct create` script: seeking feedback, have questions about `--storage`

    1. can anyone find problems or offer general feedback on the script below? (The IP addresses have been redacted. Said script seems to run fine in initial testing.) 2. I have questions about the --rootfs vs --storage options as noted in my post reply below. 3. Is there a collection of...
  16. G

    [SOLVED] "script":"Only root may set this option."

    In PVE5 we could'n add serial port via user, only via root, in PVE6 it became possible. In PVE6 (6.2-11), method --script in api call "/api2/json/nodes/{node}/vzdump" executed under admin user causes the same error: {"data":null,"errors":{"script":"Only root may set this option."}} Can we expect...
  17. D

    Scripting VM Console (tty access to VM console)

    Hi everyone, Excuse me if this question has already been posted, but I could not find any solution. My question is about to script the console of a VM. I want to start a pre-configured VM with an automatic builded config, and launch some command inside the VM (when the prompt is ready), so it...
  18. J

    Creating a simple bash script menu on reboot

    Hey guys. Apologies in advance for a naive question amidst these deep technical discussions. I run a simple setup. Home lab, virtualised hackintosh, windows 10 PC, ubuntu, that I run generally one VM at a time with GPU PCI passthrough. I generally boot the machine and use my ipad to select the...
  19. J

    vzdump-hook-script not working as expected

    Hi there, We are trying to use a vzdump hook script to do some things. We have a Proxmox cluster setup with several hypervisors. We took a look at /usr/share/doc/pve-manager/examples/vzdump-hook-script.pl and made an adaptation: #!/bin/bash LIST_BORG_BACKUPS=${DUMPDIR}/list_borg_backups...
  20. 5

    Autostart Script

    Hello there, I have recently installed Proxmox on my homeserver and on it I installed nextcloud in a lxc. Due to electricity cost I want to shut my server down when the server is idling and when I want to start it I usually connect to a website hosted on my rpi zero where I click a button...