Friday, February 19, 2010

Simple(er) query to get paged out systems on VMware

Brief Description: On VMware, you want to query for VMs swapping out.

Problem:
I posted a longer script for checking VMware tools and Host build versions when looking for VMs that are swapping out in the last hour. It's maybe a little clunky if you just need to know what machines are swapping right now.

Solution:

Smaller query is below just to get a list of VMs Swapping out right now.


select h.name, MAX(s.sample_time), avg(s.stat_value) from vpx_entity h
join vpxV_hist_stat_daily s on s.entity = ('vm-'+ CONVERT (Varchar, h.ID))
where s.stat_name = 'swapped' and s.stat_value > 1
group by h.name
order by h.name

No comments:

Post a Comment