stuartwhyte is correct; this will be a very expensive report in regards to cycles on your SQL box.
In your other question about this (
) you mentioned you wanted PEAK CPU, This will get you the PEAK CPU load from any one polling cycle out of the last 7 days, along with the AVG Availability from all polling cycles over the same time period:
select n.nodeid ,n.caption as 'DEVICE' ,n.ip_address as 'IP ADDRESS' ,n.lastboot as 'LAST BOOT' ,max(c.maxload) as 'PEAK CPU' ,avg(r.availability) as 'AVG AVAILABILITY' from nodes n join cpuload c on n.nodeid=c.nodeid join responsetime r on n.nodeid=r.nodeid where c.datetime > (getdate() -7) and r.datetime > (getdate() -7) and n.ip_address in ('1.1.1.1','1.1.1.2','1.1.1.3') group by n.nodeid, n.caption, n.ip_address, n.lastboot
I would warn you though, looking at only 8 devices took almost 30 seconds on my lab machine that is a fairly standard SQL build. I wouldn't push this one too hard with more than 15-20 devices if possible. However, you can always cross your fingers and try
If you want the AVG CPU load from all polling cycles and the AVG Availability from all polling cycles over the last 7 days, use this one (which surprisingly took only 1 second more to complete):
select n.nodeid ,n.caption as 'DEVICE' ,n.ip_address as 'IP ADDRESS' ,n.lastboot as 'LAST BOOT' ,avg(c.avgload) as 'AVG CPU' ,avg(r.availability) as 'AVG AVAILABILITY' from nodes n join cpuload c on n.nodeid=c.nodeid join responsetime r on n.nodeid=r.nodeid where c.datetime > (getdate() -7) and r.datetime > (getdate() -7) and n.ip_address in ('1.1.1.1','1.1.1.2','1.1.1.3') group by n.nodeid, n.caption, n.ip_address, n.lastboot
Obviously, for your environment, you would replace the IP Addresses from the line below to the ones you are interested in. The syntax is ('ip address','ip address','etc','etc')
and n.ip_address in ('1.1.1.1','1.1.1.2','1.1.1.3')
Hope this helps, I would be interested to hear how many IP Addresses you run against and how long the report takes to generate.
Loop1 Systems: SolarWinds Training and Professional Services
- LinkedIN: Loop1 Systems
- Facebook: Loop1 Systems
- Twitter: @Loop1Systems