August 2007 - Posts

Part II - Randomize Weekly and Monthly Inventories

In Part I we randomized daily inventories so they ran randomly within a 4 hour window rather than all at once to prevent overloading the Notification Server with NSE's.  In Part II we'll take that a step further by randomizing which day Weekly or Monthly inventories run and give them a 4 hour window to run randomly in so these larger inventories are spread out relieving the load on the Notification Server even further.

For our weekly example, we'll choose the Software Inventory.  I want AuditPlus to run once a week on a random day sometime between 9pm and 1am.  My daily job is running between 5pm and 9pm so for this job to run I have to wait for the daily window to close.

  1. Clone the Software Inventory Task and name it Random Software Daily or the like.
  2. Under the new task's General tab, click on the Go To Program link.
  3. The Software definition file program should be showing.  Copy the command line to the clipboard and click New
  4. Paste the command line in the New Program command line
  5. Type Random Software Program or similar on the Name line
  6. Under Description type: Runs Hardware Definition File randomly between 0 and 4 hours after the command is run. Task can only run once per week on a random day.
  7. Edit the command line as such: AeXRuncontrol.exe /rndschedule  "Random Software"  "AeXInvSoln.exe /hidden /s AeXInvSolnAdm2.ini" WEEKLY 1 7 /d:1-14400
    • There are a couple key changes from Part I (Complete Command Line Arguments are available in the Inventory Solution Users Guide )
    • AeXRuncontrol.exe - is the same exe you copied to your Inventory Solution directory in Part I.
    • /rndschedule is the switch that tells the command to randomize the day or the week of the month in which to run.
    • "Random Software" - is the key where AeXRunControl stores the command and parameters.  Notice that each instance of AeXRunControl.exe scheduled on a client needs it's own unique registry key name. 
    • "AeXInvSoln.exe /hidden /s AeXInvSolnAdm2.ini" - is the original command line you copied and pasted into this program.
    • WEEKLY 1 7 This sets up weekly mode and allows the command to be run on any day between Sunday (1) and Saturday (7).
    • /d:1-14400-  Once the inventory is allowed to run, this command tells the client to wait from 1 to 14400 seconds before executing the command.
  8. Rest of program settings are similar to yesterday- Estimate disk space at 3000k, runs in 5 minutes, Terminate after 240 minutes (4 Hours), Run with System Account rights, Whether or not user is logged in, no input required, no network required.
  9. Apply and Update Distribution Points then close the Inventory Agent Package window.
  10. Back on the new Random Hardware Daily screen change the Program name to Random Software (you may need to refresh the screen in order to see the new program.)
  11. Ensure you have the correct Collection selected, Run on a schedule, uncheck the as soon as notified box so program only runs when you want it to. Check Run on a schedule(All machines at the same time), 9pm every day. ASAP.  AeXRuncontrol only check to see if it is okay to run the inventory, so you need to run it every day so it can check.
  12. Check the Enable box and hit apply
  13. Be sure to disable the original Software Inventory.

For the monthly inventory, I chose the Recreate Full Inventory.  Everything is pretty much the same except the program command line contains the MONTHLY switch:

AeXRuncontrol.exe /rndschedule "Recreate Full"  "aexinvsoln.exe /cleanbeforerun /hidden /s AeXInvSolnAdm1.ini" MONTHLY 1 28 /d:1-14400

The MONTHLY 1 28 switch, as you may have guessed, will limit the program to executing once between the 1st and the 28th.  You will need to run the program daily at the beginning of the 4 hour window as above.

In Part III I will discuss ways to make the inventories tighter by inventorying only for what you actually need on a daily basis. hint: How often does a server or desktop change its name?

Again, if you know of a better way of noticed any errors, please contact me or comment below.

Part 1 - Randomizing Daily Inventories

 Depending upon your network infrastructure, how often you collect the various inventories, how many clients you service, and other factors there comes a point when there is more data coming in than the Notification Server can efficiently consume.  With us it happened when we had 6500 clients (all servers) doing a policy check every 4 hours, reporting 15 custom inventories and hardware inventory every day, patch scans every 2 days, server inventory weekly, software inventory weekly, and recreate fulls running monthly.  We don't need the exchange or user inventories in our environment.  All the inventories were set to run overnight so client discomfort would be minimal and we could have fresh data when we arrived every day. 

This caused deadlocks and increased incidents of bad NSE files during peak periods.  I also found out reporting to be nearly impossible during the busiest times. The way scheduling works in Altiris every client in a collection would run inventory at the same time causing a spike inventory data whenever a job was run. If at all possible, we did not want to add another server because we would then be required to duplicate everything we did on server 'a' over to server 'b' since the hierarchy feature is not due until Altiris NS 7.

The first thing I did was reduce the policy checks from every 4 hours to every 8 hours.  Then I split the 4 or so inventory collections into more than a dozen with each one running at different times.  As you can expect, this proved rather unwieldy and tough to maintain as any change to one caused me to have to check all of them. Plus, if there was an error in one it took longer to track down the error. So something else needed to be done.

Enter AeXRuncontrol. Located in your Altiris\Notification Server\NSCap\Bin\Win32\X86 directory, AeXRuncontrol will enable you to get every drop of efficiency you can from an Notification Server in anticipation of NS 7 Hierarchy when we can revert to the clients per child server model. As the daily custom and hardware inventories cause the biggest load, I'll implement it against them first and deal with the weekly and monthly inventories in a later post.

There are two ways to randomize your daily inventories.  First, you can add the AeXRuncontrol.exe to each line of the .ini file you call with aexinvsoln.exe or you can randomize the aexinvsoln.exe command line itself.  As my clients have no trouble running the inventories, but my server has trouble ingesting the flood of NSE's, the second serves my purposes just fine.

  1.  Copy the AeXRuncontrol.exe to the source directory of your inventory package, in most cases Altiris\Notification Server\NSCap\Bin\Win32\X86\Inventory Solution. 
  2. Clone the Hardware Inventory Task and name it Random Hardware Daily or some such. (In the 6.5 Console, Manage, Assets and Inventory, Tasks, Inventory Tasks - Windows, Right click the Hardware Inventory, clone).
  3. Under the new task's General tab, click on the Go To Program link.
  4. The Hardware definition file program should be showing.  Copy the command line to the clipboard and click New
  5. Paste the command line in the New Program command line
  6. Type Random Hardware Program or some such on the Name line
  7. Under Description type: Runs Hardware Definition File randomly between 0 and 4 hours after the command is run. When the job is running, other tasks cannot start, so limit how wide a window you set.
  8. Edit the command line as such: AeXRuncontrol.exe "Random Hardware" 20 "AeXInvSoln.exe /hidden /s AeXInvSolnAdm1.ini" /d:1-14400
    • Let me break that down for you: (Complete Command Line Arguments are available in the Inventory Solution Users Guide )
    • AeXRuncontrol.exe - is the exe you copied to your Inventory Solution directory.
    • "Random Hardware" - is the key where AeXRunControl stores the command and parameters.  Whenever the client runs the new inventory program we are creating it looks here to see when the command can run again.
    • 20 -  is the minimum amount of time in hours before the command referenced in this key can be run again.  Work with the advertisement and delay parameter to set run time.  I set it to 20 to ensure the inventory can run every day. If I set it for 24, there is a possibility the command will not run that day.
    • "AeXInvSoln.exe /hidden /s AeXInvSolnAdm1.ini" - is the original command line you copied and pasted into this program.
    • /d:1-14400- this is it! This command tells the client to run the previous command randomly from 1 to 14400 seconds into the future.  14400 seconds equals 4 hours.
  9. Rest of program settings - Estimate disk space at 3000k, runs in 5 minutes, Terminate after 240 (This value equals the upper bounds of your random window), Run with System Account rights, Whether or not user is logged in, no input requires, no network required.
  10. Apply and Update Distribution Points then close the Inventory Agent Package window.
  11. Back on the new Random Hardware Daily screen change the Program name to Random Hardware (you may need to refresh the screen in order to see the new program.)
  12. Ensure you have the correct Collection selected, Run on a schedule, uncheck the as soon as notified box so program only runs after 5pm, Check Run on a schedule(All machines at the same time), 5pm every day.
  13. Check the Enable box and hit apply
  14. Be sure to disable the original Hardware Inventory.
  15. Now apply the same process to your other daily inventories keeping in mind that only one of these command lines will run at a time..

Now the inventories will be spread out over a defined period greatly alleviating the load on your NS server. Next I'll walk through making some of the larger less frequent inventories random, too.  If you have any thoughts on ways to improve this process, or notice any errors, please let me know!

 

(Updated 8/30/2007 @ 9 am CDT to fix some errors in the process)

PC World has a neat collection of projects for PC's from creating cool videos with photos, to building a media server or making your own business phone system. Excerpt:

Make Your PC a Private Recording Studio

Recording software. Click to view full-size image.

Most systems made in the past few years have the horsepower to serve as a home recording studio, though a dual-core CPU, 1GB of RAM, and a 250GB hard drive will ensure glitch-free performance. Out of the box, however, they lack the inputs needed to record real instruments and voices, so you'll have to upgrade your audio interface.

PC World - 12 Great Do-It-Yourself PC Projects

We've started meeting on the First Thursday each month from 5:00 - 7:00.  Tonight we will hear from Greg Grosser of Managed Planet makers of SMS extending software.

 

Interested in participating in KCRSMUG?  We are free and open to any IT professional who wants to know more about managing computer systems.  Besides the monthly meetings, we maintain an announcement list to disseminate information as well as a web page at MyItForum.

 

The KCRSMUG usually meets the first Thursday of each month from 5:00 - 7:00pm at:

Centriq-Foss University Offices
which are located at:
Leawood Training Center and Offices
8700 State Line Road
Suite 200
Leawood, KS 66206
Tel: 913.322.7000

Click Here For Directions And Accommodations


Join the list!
Email List Instructions

Create a new email.

In the TO: line of the email, input the following email address: command@lists.myitforum.com

Now, in the BODY of the email (NOT the subject line), type the following command: Subscribe KCRSMSUG

Send the email.


 

 Group website and information page:

http://www.myitforum.com/groups/group70/