Ad Widget

Collapse

Proxmox VE by HTTP template initial warnings on powered-off VM/CT

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pavels.marhels
    Junior Member
    • Jun 2022
    • 12

    #1

    Proxmox VE by HTTP template initial warnings on powered-off VM/CT

    Just installed fresh Zabbix 7.0 and added Proxmox (3node) cluster.

    After discovering qemu VMs i have list of "Problems" about turned off KVMs, CT. Some of them are even Templates of KVM which cannot be turned on.

    Click image for larger version

Name:	image.png
Views:	601
Size:	160.8 KB
ID:	489939
    I understand that i can Suppress any of those warnings Indefinitely or for some time.
    Click image for larger version

Name:	image.png
Views:	465
Size:	43.6 KB
ID:	489941
    But i would like to have a trigger based on discovery of KVM/LXC. If during discovery it is ON -> then follow it state and trigger when it become OFF state. And NOT trigger initially OFF-state KVMs/LXCs.


    Attached Files
  • pavels.marhels
    Junior Member
    • Jun 2022
    • 12

    #2
    It is possible that i am not aware of correct usage of particular template?

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #3
      Proxmox does not provide an API metric that tells you when the VM/LXC has been manually shut down, only that it is down.
      So, as far as I know, Zabbix has no way of knowing if the VM/LXC is down due to a manual action or not.
      I found a similar situation a while back and reported it to Zabbix support, ZBX-23189, but it was closed.

      What I usually do is disable the "Not running" trigger for the VM/LXC I shut down.

      Comment

      • daBeast
        Junior Member
        • Sep 2024
        • 8

        #4
        I was going to look at a way to include the onboot flag in the trigger - this would prevent any not running alerts if the VM/LXC was not set to start on boot. For me, I also wanted an alert for a VM/LXC to alert if running with this flag not set.

        Since it doesn't appear that the template grabs this information (onboot) I will look on how to incorporate it in the template.

        Here is where I found it in the API guide for VMs - https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/config
        Here is where I found it in the API guide for LXCs - https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc/{vmid}/config
        I noticed it only returns a 1 when it is set to not start on boot - it will not return any value in the response if set to 0 (set to start on boot).

        Comment

        • daBeast
          Junior Member
          • Sep 2024
          • 8

          #5
          Originally posted by daBeast
          I noticed it only returns a 1 when it is set to not start on boot - it will not return any value in the response if set to 0 (set to start on boot).
          I may have this backwards

          Comment

          • daBeast
            Junior Member
            • Sep 2024
            • 8

            #6
            This is what I came up with - https://www.dropbox.com/scl/fi/i7o5d...=exs5dqe9&dl=0

            Added this value mapping:
            Click image for larger version

Name:	image.png
Views:	481
Size:	12.7 KB
ID:	490845

            Created this discovery in QEMU (and a similar one in LXC):
            Click image for larger version

Name:	image.png
Views:	428
Size:	44.3 KB
ID:	490846
            Created this item prototype (and a similar one in LXC):Click image for larger version

Name:	image.png
Views:	437
Size:	34.4 KB
ID:	490847
            with this preprocessing:Click image for larger version

Name:	image.png
Views:	435
Size:	15.5 KB
ID:	490848

            Updated this trigger (and the LXC one) Note the highlighted area in the expression
            Click image for larger version

Name:	image.png
Views:	440
Size:	30.1 KB
ID:	490849



            From my testing, it seems to work as I expected. Ran some backups of powered off (not set to start on boot) VM/LXC systems and they alerted only while they were powered on for the backup. As soon as the backup completed, the alert cleared.

            If you change the start on boot flag, within a min or 2 the alerts will update properly (close out or generate) as expected.​​

            Comment

            • daBeast
              Junior Member
              • Sep 2024
              • 8

              #7
              Due to attachment limits I couldn't include this in the previous post:

              To add my alert when a VM/LXC is running when not set to start on boot I added this trigger too (LXC version also):

              Comment

              • daBeast
                Junior Member
                • Sep 2024
                • 8

                #8
                Ohh...I did update this trigger too (along with the LXC one) as it would keep the alert for VM/LXC started without the start on boot flag.
                Click image for larger version

Name:	image.png
Views:	451
Size:	28.8 KB
ID:	490852

                Comment

                • daBeast
                  Junior Member
                  • Sep 2024
                  • 8

                  #9
                  I have an update but I have 3 replies pending mod approval first....I will post once these are online.

                  Comment

                  • daBeast
                    Junior Member
                    • Sep 2024
                    • 8

                    #10
                    Originally posted by daBeast
                    I have an update but I have 3 replies pending mod approval first....I will post once these are online.
                    This works with templates too as you can change the start at boot flag on templates too.

                    Comment

                    • markfree
                      Senior Member
                      • Apr 2019
                      • 868

                      #11
                      I didn't get it... If you turn off a VM/LXC that was previously on and not set to start on boot, will it trigger the "VM/LXC not running" event?

                      Comment

                      Working...