ravening opened a new pull request #4366:
URL: https://github.com/apache/cloudstack/pull/4366


   ## Description
   <!--- Describe your changes in detail -->
   If the resource state of hypervisor in "Maintenance" then it
   should be considered as offline even though the agent state
   is "Up". Since its in maintenance mode, it cant be used to
   allocate VM's and hence can't be considered towards resource
   allocation
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the 
boxes that apply: -->
   - [X] Enhancement (improves an existing feature and functionality)
   
   
   ## Screenshots (if appropriate):
   
   ## How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   <!-- see how your change affects other areas of the code, etc. -->
   
   Enable prometheus server
   Add 127.0.0.1 as allowed Ip so that you can fetch metrics from prometheus
   
   Now fetch the endpoint
   
   ```
   # http http://127.0.0.1:9595/metrics | grep cloudstack_hosts_total
   cloudstack_hosts_total{zone="mgt122-10",filter="online"} 3
   cloudstack_hosts_total{zone="mgt122-10",filter="offline"} 0
   cloudstack_hosts_total{zone="mgt122-10",filter="total"} 3
   ```
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md)
 document -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to