Oct 2

I have been fighting with Symantec Altiris Software Delivery Solution licenses for some time now. I have had numerous support calls trying to get Altiris to assist me in tracking down where each of these licenses has went. Today I found what I was looking for after Symantec Altiris support was unable to help me. I was actually told that they would not help me find a list of machines that were taking up licenses. I was pretty unhappy about this and will reconsider my options going forward. I did submit a feature request to them. I just want to be able to prove that each license is being used up by a machine that I approve. In SWD 7.0 they are changing the license model to be based on agent installation. The current version I am using is 6.0 SP3.

Here is a SQL statement I captured using sql profiler that they execute to generate the number of in use Software Delivery Licenses.

exec sp_executesql N'SELECT COUNT(DISTINCT Stat.WrkstaId) FROM AeXEvt_AeX_SWD_Status as Stat, SWDAdvertisement as Advert, SWDOriginator as Orig, SWDProgram as Prog, vItem vI, Wrksta Wr WHERE Stat.AdvertisementId = Advert.AdvertisementId AND Stat.AdvertisementId = vI.Guid AND ( vI.ClassGuid = ''5B91F0BF-899F-49E2-B8E1-67219100BBFA'' OR vI.ClassGuid=''2D39BA40-2A60-42EE-92E0-C11AD2245969'') AND vI.ProductGuid = ''AD3F5980-D9E9-11D3-A318-0008C7A09198'' AND LOWER(Prog.ProgramId) = LOWER(Advert.ProgramId) AND LOWER(Prog.CommandLine) NOT Like ''aexinvsoln.exe%'' AND Orig.OriginatorId = Advert.[_OriginatorId] AND Advert.[_Latest] =1 AND Orig.Type != ''NSInternal'' AND ( Stat.EventType=''New Job'' OR Stat.EventType=''Package To Be Removed'' OR Stat.EventType=''Job Removed'' OR Stat.EventType = ''Job Updated'') AND Stat.WrkstaId = Wr.WrkstaId AND (Wr.SystemType = ''Win32'' OR Wr.SystemType = ''Win64'')',N'@ProductGuid uniqueidentifier',@ProductGuid='AD3F5980-D9E9-11D3-A318-0008C7A09198'

It is counting unique workstation id’s. I change this to look at workstation names and disable the counting. Please keep in mind that this may actually cause you to generate a different number of machines as two machines may have ended up with the same name. For what I was doing this was ok.

Here is the sql statement for a list of machines.

exec sp_executesql N'SELECT Distinct Wr.Name FROM AeXEvt_AeX_SWD_Status as Stat, SWDAdvertisement as Advert, SWDOriginator as Orig, SWDProgram as Prog, vItem vI, Wrksta Wr WHERE Stat.AdvertisementId = Advert.AdvertisementId AND Stat.AdvertisementId = vI.Guid AND ( vI.ClassGuid = ''5B91F0BF-899F-49E2-B8E1-67219100BBFA'' OR vI.ClassGuid=''2D39BA40-2A60-42EE-92E0-C11AD2245969'') AND vI.ProductGuid = ''AD3F5980-D9E9-11D3-A318-0008C7A09198'' AND LOWER(Prog.ProgramId) = LOWER(Advert.ProgramId) AND LOWER(Prog.CommandLine) NOT Like ''aexinvsoln.exe%'' AND Orig.OriginatorId = Advert.[_OriginatorId] AND Advert.[_Latest] =1 AND Orig.Type != ''NSInternal'' AND ( Stat.EventType=''New Job'' OR Stat.EventType=''Package To Be Removed'' OR Stat.EventType=''Job Removed'' OR Stat.EventType = ''Job Updated'') AND Stat.WrkstaId = Wr.WrkstaId AND (Wr.SystemType = ''Win32'' OR Wr.SystemType = ''Win64'')',N'@ProductGuid uniqueidentifier',@ProductGuid='AD3F5980-D9E9-11D3-A318-0008C7A09198'

Finnaly if you would like to list out all of the fields that are pulled use the following statement.

exec sp_executesql N'SELECT * FROM AeXEvt_AeX_SWD_Status as Stat, SWDAdvertisement as Advert, SWDOriginator as Orig, SWDProgram as Prog, vItem vI, Wrksta Wr WHERE Stat.AdvertisementId = Advert.AdvertisementId AND Stat.AdvertisementId = vI.Guid AND ( vI.ClassGuid = ''5B91F0BF-899F-49E2-B8E1-67219100BBFA'' OR vI.ClassGuid=''2D39BA40-2A60-42EE-92E0-C11AD2245969'') AND vI.ProductGuid = ''AD3F5980-D9E9-11D3-A318-0008C7A09198'' AND LOWER(Prog.ProgramId) = LOWER(Advert.ProgramId) AND LOWER(Prog.CommandLine) NOT Like ''aexinvsoln.exe%'' AND Orig.OriginatorId = Advert.[_OriginatorId] AND Advert.[_Latest] =1 AND Orig.Type != ''NSInternal'' AND ( Stat.EventType=''New Job'' OR Stat.EventType=''Package To Be Removed'' OR Stat.EventType=''Job Removed'' OR Stat.EventType = ''Job Updated'') AND Stat.WrkstaId = Wr.WrkstaId AND (Wr.SystemType = ''Win32'' OR Wr.SystemType = ''Win64'')',N'@ProductGuid uniqueidentifier',@ProductGuid='AD3F5980-D9E9-11D3-A318-0008C7A09198'

Now I’m off to clean up my Altiris SWD.


Sep 2


A quick way to find nodes that are not in a collocation group and how much data they are using up. I one onsite stgpool that uses collocation so I specify that I only want to look at data in that stgpool.
select nod.node_name, nod.collocgroup_name, sum(oc.physical_mb/1024) as GB from nodes nod, occupancy oc where nod.node_name=oc.node_name and oc.stgpool_name='MYSTGPOOL' group by nod.node_name, nod.collocgroup_name

This is how I find out what tapes I need to move data off of after running the above query and if I define nodes into a collocation group when they previous where not in one. This was I can reclaim tapes immediatly rather than waiting for data to expire off the tape and space reclaimation to run against the tape.
select distinct volume_name from volumeusage where node_name IN ('NODE1', 'NODE2', 'NODEX') and stgpool_name='MYSTGPOOL'

I hope to update this list as I think of other selects I use often.


May 7

I have been wanting to make a task that would force a notify rule to be enabled on a helpdesk incident. I wrote a set of queries and found what I needed to update. Once I created the taskI stumbled across an issue. It has to do with Altiris HD solution processing the a sql statement before I even run the task.

My task looks a bit like this. It sets the workitem to have a rule ’293′ enabled on it.

Set: HDQUERY[[select workitem_number from dbo.workitem_wuci_join where workitem_wuci_join.wuci_id = '293' and workitem_wuci_join.workitem_number = WORKITEM(workitem_number)]]

The above is just filler really. The code that matters is below. Since Altiris doesn’t provide a way to just update/insert a sql value you hide the sql statement in an HDQUERY macro.

To: HDQUERY[[select NULL insert into dbo.workitem_wuci_join (workitem_number, wuci_id) values (WORKITEM(workitem_number), 293)]]

However each time the rule is displayed it actually updates the database. I think Altiris is processing the to: to get a value which is running the insert.

I also found that the select NULL was needed to supress errors when running the rule. When running this rule I found that it adds a duplicate entry for the 293 rule. This breaks the incident. To fix this use a sql delete in the workitem_wuci_join table of the altiris_incidents database.


delete * where workitem_number = '' and wuci_id = '293'

This will delete all rows (likely only 2) with the rule id and the incident number. Then you can simply edit the incident in helpdesk console and add the proper notify rules.


« Previous Entries