How to get a quick count of active machines on a client facing NS?
There is a fuzzy area between the count of managed machines in a Notification Server and the count of active machines.
First when is a managed machine considered as active or inactive? This can be defined and interpreted in many different ways based on the nature of one's business, whether it is fast changing or strictly controlled etc.
The SQL query below is not going to answer this question, but can serve as a starting point (you could add event request on the filter such as last basic inventory received or last client policy request etc):
use altiris select count (*), ((DATENAME(Year,DataLastChangedDate)) + ' ' + (DATENAME(Month,DataLastChangedDate))) as 'Month' from ( select ResourceGuid, Max(DataLastChangedDate) as 'DataLastChangedDate' from ItemResource ir join ResourceUpdateSummary rus on ir.guid = rus.resourceguid where IsManaged = 1 group by resourceguid ) t where datalastchangeddate > DATEADD(Month,- 3,GETDATE()) group by ((DATENAME(Year,DataLastChangedDate)) + ' ' + (DATENAME(Month,DataLastChangedDate)))
Note that we point to the default Altiris notification server database name here (and you have correctly gathered that this is a 6.x implementation).
We pick the managed machines directly from the ItemResource table because it is much more efficient (specially on reporting servers or mid-tier NS's than can aggregate anything above the 45~50,000 machines) than to use vComputer (I was planning to write an article [rant?] about this view, and may be I should still do, but in short I think that abstractions can be very useful in some cases and counter-productive in many others. vComputer is a proof of the later, as it is a view on a view on a view aggregating many tables that is highly inefficient when all you need from that view is the IsManaged field).
Then we join the ItemResource table to the Resource Update Summary (use the top right 'Connect search' field if you need to know more about this table) and pick up the most recent data change (one per resource that is).
This is stored in a data set 't' on which we apply additional filters and grouping to show the count of updated computers per month for the last 3 months (so in most cases you'll see 4 month in the resulting data set).