Add active instances collectd query

This patch adds a collectd query for only active instances.

Co-authored-by: jaison <jraju@redhat.com>
Change-Id: I82a641edf6d2120e316b7f258e39c2895fce9527
This commit is contained in:
Sanjay Chari 2022-01-19 16:02:23 +05:30
parent 675396a930
commit 765bc5e477
2 changed files with 18 additions and 0 deletions

View File

@ -264,6 +264,14 @@ PreCacheChain "PreCache"
ValuesFrom "instances"
</Result>
</Query>
<Query instance_active_count>
Statement "select count(*) as instances from instances where deleted=0 and vm_state = 'active'"
<Result>
Type gauge
InstancePrefix "instances_active"
ValuesFrom "instances"
</Result>
</Query>
<Query instance_faults_count>
Statement "select count(*) as instance_faults from instance_faults"
<Result>
@ -281,6 +289,7 @@ PreCacheChain "PreCache"
DriverOption "mysql_unix_socket" "/var/lib/mysql/mysql.sock"
Query host_vms_count
Query instances_count
Query instance_active_count
Query instances_del_count
Query instance_faults_count
</Database>

View File

@ -181,6 +181,14 @@ PreCacheChain "PreCache"
ValuesFrom "instances"
</Result>
</Query>
<Query instance_active_count>
Statement "select count(*) as instances from instances where deleted=0 and vm_state = 'active'"
<Result>
Type gauge
InstancePrefix "instances_active"
ValuesFrom "instances"
</Result>
</Query>
<Query instance_faults_count>
Statement "select count(*) as instance_faults from instance_faults"
<Result>
@ -198,6 +206,7 @@ PreCacheChain "PreCache"
DriverOption "mysql_unix_socket" "/var/lib/mysql/mysql.sock"
Query host_vms_count
Query instances_count
Query instance_active_count
Query instances_del_count
Query instance_faults_count
</Database>