FreakoutITGeek's Blog

Random IT postings from Freakz

Category Archives: Altiris

Stick to the script

My first taste of real IT was as part of a one weeks high school “works experience” at Strathclyde University’s IT department back in the 90’s (it probably was called data processing or something back then). The systems were all unix and I was used to an Acorn Electron and BBC Master, both running a version of the BASIC programming language, it was a tough learning curve, especially when I was given a manual, pad of paper and asked to write a script. I can’t remember what the script was supposed to do but I remember being lost in this manual, trying to figure out this strange programming language that made no sense to me.

The university IT guys obviously didn’t understand my situation as their experiences were all with Unix shell scripting and possibly some C programming. To them I was a waste of space as ‘all computers worked the same’ and this should be simple for a kid with a home computer.

As I grew up I learnt Pascal, C, COMAL, COBOL at college and tried to teach myself Assembly language and C++ (both with not much luck) at home.

It’s not until recently that my programming skills have come back into use. Not just for my Open University courses on Java / Object Oriented Programming (which would have helped back in the 90s when I was trying to get my head round Objects after 2 years of procedural programming in Pascal and years toying with BBC BASIC) & web design using JavaScript. My programming has come into use more recently as part of my current support role.

The last year (or so) I have written more programs in AutoIT and Batch (DOS) scripting than I have done in a long time.

As with all programming languages, sometimes there are ‘quirks’ that you have to get your head around but it’s amazing what you can do with a bit of creativity.

One of my most recent Batch scripting triumphs was to resolve an issue we have with Altiris.

We have a wide range of sites in one of our sections ( 13 large sites with servers and 51 smaller sites with a Local NAS each), with each site needing support via Altiris. The central Altiris server does not have the spare capacity for all the installs and whilst the network links are sufficient for standard use, pulling multiple installs over the links can bring sites to a crawl.

My aim was to create a script that could be used to determine the site, check the local data store ( NAS or server) for the install and if not present copy the files from the central Altiris server to the local data store, then run the install. This sounds quite simple bit you need some safeguards to prevent multiple PCs from copying the files. some way to check the files copied successfully last time and a check that if the copy was taking too long that another computer would take over (assuming that the original had failed to copy the files – ie powered off or disconnected from the network ).

So what appeared, at first look, to be a simple little script, soon became a challenge.

I’m happy to announce that the script is currently working. So what does the script do?

First it determines the site, originally this was done using the computer name as each site names it’s PCs with a site specific prefix. After a bit of planning it was realised that some support staff take the computers to one of the larger sites when the machines are rebuilt or if there is a large number to be built. So to account for this it was realised that the unique identifier for each site was the IP address, or in our case the gateway address, using a FOR loop it was easy to strip the gateway address from the IPConfig command.
Another FOR loop then striped the IP into the data we needed and then compared it to a CSV file to get the Server / NAS details.

So that was the easy part done, we know the site & local server / NAS ( data store) but what about the rest?

Checking for the files is easy using IF EXIST, but what if it’s not there. It would be easy to just copy the files but what if 20 machines are all trying to copy at the same time? Simple, create a lock file. Each machine ruining the job cheeks for the file, if it exists it loops until the file is deleted. If the lock file doesn’t exist it is created with the name of the creating PC (for manual error checking) before using robocopy to copy the files/ directories over (other tools are available & better but Robocopy comes with Windows 7 and a version exists for Windows XP – so the easy option was taken), once
Robocopy completes the lock file is deleted and all the PCs continue with the install from the local data store.

So what if the files exist but there have been changes ? This was a bit trickier, I used the DIR command to check the number of files in the directory (and sub folders) as well as using DIR to report the size of the directory(s). This should be a simple (but not completely fool proof) way to check for changes and act accordingly.

So what if a PC is powered off and the lock file exists? Well there are two checks, the first is when the script runs – it checks the date of the lock file and if it doesn’t match the current date then it’s deleted (keeping it simple). The second check is if the batch script comes out of the loop and the lock file is still there then it sends an error back.

There are loads of other error checking in the script and there is a heavy use of CALL, IF and FOR commands within the script to do what it does, but it does everything I had planned and more than the original concept.

So, after a lot of testing and a few changes, I’m now off to look at my next challenge.

If this post is of interest please let me know by liking or posting a comment and I may add some more of the same.

Think Different

Many people know the phrase ‘think different’ from Apple’s successful advertising campaign. It’s still something that I associate Apple with today, from their continuous strive to push technology and design forward to things as simple as their Apple Stores.

Apple does what *it* thinks are the best things to do, not what the industry, press or public think and that makes it what it is today.

Now I’ve already gone off on a tangent.

This post is really about something that I’ve felt for a long time. It probably started at the latter stages of primary school, into high school and is a part of my life every day, however I never realised it’s impact until I did my Open University degree.

To me, thinking different is something everyone does whether they realise it or not. Whilst, as a teenager, I decided not to be a sheep and follow what everyone else did and instead decided to do the things I was interested in ( sometimes for the better, or worse) it wasn’t until two of the courses on systems thinking touched on the concept of ‘world view’ that I started seeing the power of not just empathy but in trying to see things from other people’s vantage point.

Now this may sound a bit basic, but consider how a child sees the world, with their basic understanding of their environment learnt from exploration, trial and error, with their environment as their teacher ( and yes that environment includes other people such as friends, family, neighbours, teachers etc.. all with differing views, values, skills, knowledge & dare I say it their hangups, issues and problems). To a child everything is new, an exciting, never ending, constantly changing world of learning. Their view is unlimited but it has some constraints in the form of what they can see (their access to or view of [due to height, locks or physical barriers]), hear and gain access to (sometimes for their own protection).

Now consider an adult in the same situation, they have gone through the education system and been taught the rules of life, what to do, what to say, how to act, warned of the dangers and learnt to be cautious. Their view is restricted by that teaching, their values, their Environment (work, money, education, religion, laws, rules, beliefs)

OK I think I’ve gone too far too fast. Lets bring this back. let’s consider a simple example.

Identical twins are looking at a scenic garden from a terrace. The garden is divided into sections by hedging. If one of those twins is standing on a box or something which makes the whole garden viewable, their view will be more enjoyable (assuming you like gardens) than their twin who can only see a small section, with their view restricted by the hedge(s).

So what I’m saying is that people are affected by their life experiences or ‘world view’ (There is a German word for this but I could never remember it from the courses ).

So everyone lives different lives, have different experiences, see things from different angles and no one can truly share or know what you know, you are unique. And so is everyone else.

I realised this in high school but life got in the way and I think I lost that insight until I studied those OU courses.

So once you know this info, what’s the use?

Well if you realise that your view on something is not the same as someone else, I hope that you would realise that in order to help people you have to realise that you need to try and understand their viewpoint first.

This involves finding out more about them, why they feel the way that they do, what lead them to this feeling and what they need from you in order to satisfy whatever need it is that have come to you to have satisfied.

This may sound a bit weird, but if you think about it everyone needs something from someone else. Whether it be help from a doctor, friend or work colleague. Goods from a shop. A service from a company. Or the other way round a customer, friend, colleague, family member that is looking for something from you: help, a person to talk to, an item, time or something else.

So what I’m saying here is please don’t judge others, learn from them, engage with them, find out their ‘world view’ and your world may just turn out a tiny bit better.

Altiris For Apple Mac systems

I’ve mentioned in other posts that I have previously managed to get Apple systems (most Windows people call them Macs) on Deployment server and I have been asked how I did it…

Firstly look over the Symantec connect article “Installing the DS and NS Agent for Macintosh” which provides a step by step description and a lot of discussion about the process.

From my own experience I was using Altiris Deployment Server 6, the Altiris agent (known as the Dagent on Win 7 or Deployment client/agent) was Altiris-adlagent-2.6-54.Darwin.zip. In order to get it working I also had to disable the auto update feature on the console as it tried to upgrade the agent to the latest version (which in my case didn’t work).

With some basic unix /Command line knowledge, Altiris is quite a handy tool ( it’s not as good as Apple Remote Control, but if you have Altiris and can’t afford ARD it’s a good second choice) which you can use it to image an Apple system if you have an Apple server (or similar) running NetBoot and I’m sure if you have some scripting (AppleScript) skills you will reduce your workload considerably (not to mention allow some standards on the organisation’s Apple systems).

There is a note, that I made when I started testing the Apple client, about an issue (I assume this has been resolved since) where the ADLagent spawned multiple processes.

To uninstall / remove the ADLagent from OSX please look at http://www.symantec.com/business/support/index?page=content@id=HOWTO10704
, basically the (terminal) command appears to be sudo sh /opt/altiris/deployment/adlagent/bin/uninstall.app and after responing to the prompts, the software should be uninstalled. Once uninstalled you can sudo rm -r /opt/altiris and sudo rm -r /etc/altiris to clear out the related folders.

If I can remember anything relevant I’ll add it later, hopefully what is posted here will help, but since the organisation I currently work for no longer support Apple systems (why?) I may struggle with further advice at this point.

Altiris: Part 1

I thought I’d give my insights into what I believe to be best practice when it comes to creating deployment jobs.

Looking back at my early days creating Altiris deployment jobs, most of them appear to be a case of push out the installer and hope for the best (something it appears my colleagues still do !!?). So what do I suggest has to be considered before creating an Altiris deployment job?

Here are my top recommendations.
(more details to follow in further posts)

  • What Operating system is the software compatible with? Are there different installers for different OS ?
  • What software does the installer rely on (ie prerequisites)? Is the required software already installed? Can you check? Can you install it if not?
  • Is there sufficient space on the client to Install the software? (Some jobs may need to copy the install locally before they are run)
  • Are other installs (ie Windows update, previous Altiris jobs) running, which could cause the install to fail?
  • Which type of installer does the application use? Does it support silent / quiet / unattended / admin install? How can you tell?
  • Has the installer really worked and not just returned successfully? How do you check?
  • Have you cleaned up any temporary files and/or folders created during the install?
  • Have you updated the inventory?
  • Has the installer completed before the ‘get Inventory’ task runs?
  • Are there any permissions / access changes required? (registry keys / folders)
  • Are changes needed to the program, config files, shortcuts? Or Is additional software required to check for access (ie to a network share)?
  • Have you tested your install? Is there a standard build / department build you can test it with?

More to follow…