XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    xo-cli - Get alarms

    Scheduled Pinned Locked Moved Solved Xen Orchestra
    8 Posts 2 Posters 490 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      JSenzier
      last edited by

      Hi,

      I tried to get alarms from xen orchesta with xo-cli, as I have some alarms on my hosts :

      013f4238-8147-41a0-8f64-f2d1cbba695d-image.png

      Is it possible to get alarms like xoa with xo-cli, I would like to centralize alarms on our monitoring interface

      Can you help me with xo-cli ?

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Everything you see in the web UI can be fetched by the CLI.

        Feel free to read the guide to find everything you need: https://xcp-ng.org/docs/management.html#xen-orchestra

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          JSenzier @olivierlambert
          last edited by

          @olivierlambert Thanks for the answer

          I tried to get the xo-cli documentation but I found a 404 😢
          https://xen-orchestra.com/docs/xo-cli.html

          Is there any specific section about the CLI and how to get alarms ?

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by olivierlambert

            Hey thanks for spotting a bad link! I'll correct that ASAP.

            Here is the good one: https://xen-orchestra.com/docs/architecture.html#xo-cli-cli

            There's a command to show everything, so you'll find how to access alarms from there. If you can't find it, please reping us, I'll ask someone here.

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              JSenzier @olivierlambert
              last edited by

              @olivierlambert Thanks for the link 😉

              I've executed the command "xo-cli --list-objects" to show all objects xoa can find, but did not found any alarm or event occurence, I don't find what I can see in "Dashboard > Health" web page, and I don't know how xoa get those alarms (as I saw in the properties of my xen hypervisors that a control domain memory usage alarm is set by default to 95% of memory usage during 1 minute).

              Could you ask to someone who can help me please ?

              1 Reply Last reply Reply Quote 0
              • olivierlambertO Offline
                olivierlambert Vates 🪐 Co-Founder CEO
                last edited by

                IIRC, it might be "messages" or something like that.

                J 1 Reply Last reply Reply Quote 0
                • J Offline
                  JSenzier @olivierlambert
                  last edited by

                  @olivierlambert Yees I got it !

                  # xo-cli --list-objects type=message name=ALARM
                  [
                  {
                    "body": "value: 0.950419\nconfig:\n<variable>\n\t<name value=\"mem_usage\"/>\n\t<alarm_trigger_level value=\"0.95\"/>\n\t<alarm_trigger_period value=\"60\"/>\n\t<alarm_auto_inhibit_period value=\"3600\"/>\n</variable>\n",
                    "name": "ALARM",
                    "time": 1611562060,
                    "$object": "xxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx",
                    "id": "xxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx",
                    "type": "message",
                    "uuid": "xxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx",
                    "$pool": "xxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx",
                    "$poolId": "xxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx"
                  
                  

                  And I found another method to get this, on our monitoring server we can use XE command to get alarms :

                  # xe message-list name=ALARM |head -n +20
                  uuid ( RO)         : xxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx
                       name ( RO): ALARM
                       priority ( RO): 3
                       class ( RO): VM
                       obj-uuid ( RO): xxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx
                       timestamp ( RO): 20210210T10:28:47Z
                       body ( RO): value: 1.027494
                  config:
                  <variable>
                          <name value="mem_usage"/>
                          <alarm_trigger_level value="0.95"/>
                          <alarm_trigger_period value="60"/>
                          <alarm_auto_inhibit_period value="3600"/>
                  </variable>
                  

                  Thank you for your help Olivier 😉

                  1 Reply Last reply Reply Quote 1
                  • olivierlambertO Offline
                    olivierlambert Vates 🪐 Co-Founder CEO
                    last edited by

                    You are welcome 🙂 Enjoy! (great thing about xo cli is that you can get alarms of all your hosts from a single endpoint)

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post