Added cluster mode metric
This commit is contained in:
@@ -486,6 +486,15 @@ func (r *PveQemuStatus) IsRunning() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// GetClusterModeNumeric returns whether the PVE installation is configured as a cluster.
|
||||
// The cluster status API includes an object with type "cluster" only in cluster mode.
|
||||
func (r *PveClusterStatus) GetClusterModeNumeric() float64 {
|
||||
if r.Type == "cluster" {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetClusterName returns name of cluster for labeling purposes.
|
||||
// If there is no cluster then return standalone node with node name. Otherwise, it returns cluster name.
|
||||
func (r *PveClusterStatus) GetClusterName() string {
|
||||
|
||||
Reference in New Issue
Block a user