Installing Altiris Agent on Ubuntu
DISCLAIMER: Altiris does not warrant that their software will run on Ubuntu using the Unix Agent version 6.2, which as of publication of this article, is the latest release. The methods described in this article are provided as USE AT YOUR OWN RISK. If you should run into issues with the ideas and / or methods mentioned in this article, please do not call Altiris support for assistance, as they will not be able to help you.
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 3 How to install the Altiris Agent on Ubuntu It works, it works!!!, but wait a second, currently Ubuntu is not a supported operating system by Altiris, but it can still be installed and Inventory can function correctly. Note: This procedure is based on my own experience and testing. It s not my intention to describe how it must be done, but only to comment what has worked for me. It s my understanding that the whole process can be simplified and improved. Some basics For those who are used to SuSE and RedHat based distributions, Ubuntu is Debian based. There are some things that are a little bit different. Some remarkable differences we can find in Ubuntu that impact in the Altiris NS Agent installation process are root account is disabled by default SSH service is disabled by default Ubuntu is not a RPM based operating system (Altiris Agent for Linux installer is RPM based). RPM installers are not compatible (I ll explain a trick later) Different runlevel system behavior, /etc/init.d folders structure is different Dealing with the differences The fact that the root account and the SSH service are disabled by default means that installation from the NS console won t work. Ubuntu users are required to use the sudo command in front of any action that requires root access. The sudo command allows a user to execute a command with root privileges. Personally, I prefer to enable the root account (regardless of Security concerns), at least while the installation is being performed. In order to get the installer on the local system, there are several options, enable SSH and use a tool to perform a file copy thru SSH (for Windows only users, Win SCP is the ideal free tool for this action). Having my fingers tired of so much typing I preferred to install Midnight Commander (yes, it s the fantastic Norton Commander, but for Linux), just to make life easier. Other choices, wget, ftp, smb mount, removable storage, or any other way you could imagine to get a file into a Linux system. Besides the problem of getting the NS Agent installer copied to the system, the NS Agent for Linux installer is RPM based. So even if we were allowed to push the installer, it won t work because Ubuntu does not know how to deal with this file type. I had to find a way for extracting the agent files from the rpm file and place them in the correct place. I made use of
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 4 two tools (to make sure that all files got to the right place. Additional testing could confirm if two tools are really needed or if a single command works. The first tool was alien, a special application which allows non-rpm based systems to work with rpm files. It converts between rpm, deb, slp, tgz and pkg file formats. The second tool is a standard command line tool available in most platforms, rpm2cpio, which extracts cpio archive from rpm (cpio is a tool for creating and extracting archives, or copying files from one place to another). In other words, I extracted the contents of the NS Agent for Linux rpm installer and put the files in their default folder. Because Ubuntu uses a different runlevels folder structure (runlevel, for those very new to the Unix/Linux world refers to the set of services/processes enabled at startup. Commonly runlevel 3 is used when no X Windows graphical interface is desired, just console. And runlevel 5 means fully loaded with graphical windows interface. This runlevel is represented by folders and files in those folders which represent services to startup on boot), it was necessary to add some files and links to have the Altiris Agent running on startup automatically. Step-by-Step Note: As I previously mentioned, this document refers to what I did to make it work and not exactly what you must do. In addition, these notes were taken from my first try. I understand the process could be modified, some steps removed or others actions required to make it work for you. My main goal is to provide you with some ideas about what needs to happen, and you could do in case it does not work. Open a console session (CTRL+ALT+F1/F2/F3 ) Remember that the root account in Ubuntu is not enabled by default
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 5 Enable root user I performed this action just because I did not want to use sudo in front of all the commands which required elevated privileges Enter #sudo passwd root and then type the password for your user first and then the password for the root user.
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 6 Login as root Once root account is enabled, exit or open a new console and login as root. Install Midnight Commander Optional, but recommended if you are not comfortable with Linux console. If your system does not have MC installed (by default it does not), you can run apt-get install mc to download and install it automatically. Once you have it downloaded and installed, run mc
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 7 Verify Name Resolution Make sure your NS server name is properly resolved. My server name is testiris.altlab.com.ar, and so ping testiris.altlab.com.ar will let me know if name resolution is working. TIP: NIC interfaces are setup in /etc/network/interfaces (DHCP/Static) If you make a change to this file, restart the network by running /etc/init.d/networking restart
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 8 If you have problems with name resolution, you have two basic options, You can edit the name resolution setup file /etc/resolv.conf to define your domain and dns server if not provided by DHCP and/or customize the hosts file /etc/hosts to force name resolution to your NS server.
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 9 Get Altiris Agent for Linux Create a folder to store the installer mkdir /root/nsclient The Altiris Agent for Linux is located on the Altiris Notification Server, which is available by several different methods as shown below: C:\Program Files\Altiris\Notification Server\NSCap\Bin\Unix\Agent\Linux\x86 \\testiris\nscap\bin\unix\agent\linux\x86 http://testiris.altlab.com.ar/altiris/ns/nscap/bin/unix/agent/linux/x86/ http://testiris/altiris/unixagent/altirisunixagentdownload.aspx?id=56
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 10 Use your preferred method to get the file and copy it to /root/nsclient, using one of the following methods: From the Ubuntu graphical interface, open Firefox and access to the Unix Agent download page on the NS: http://testiris/altiris/unixagent/altirisunixagentdownload.aspx?id=56. At the bottom of the page you will find a link to access the contents of the package directory. From the Ubuntu console, Midnight Commander provides a feature to mount a SMB link (SMB allows access to Windows shares). Select SMB Link, type <server>/nscap, and provide proper credentials. The smbclient command allows ftp style commands. Use the get command to download the file in your present working directory More options (Linux has plenty of options!), use smbfs (smbmount) tools to mount the Windows share. If smbfs is not installed by default, type apt-get install smbfs y (-y means no prompts ) o To mount the nscap share, type smbmount //testiris/nscap /mnt/ -o username=administrator,password=yourpassword o To copy the installer from the mount point to the local folder, type cp /mnt/bin/unix/agent/linux/x86/aex-nsclt-6.2-1378.i386.rpm /root/nsclient/ Here are some screenshots with some of the different ways to copy the installer
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 11
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 12
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 13 Run the installer Now that I have the installer in place, the next thing to do is install it. As I said before, Ubuntu does not know how to handle RPM files. I need to simulate the installation by extracting the contents and going thru the installation scripts. I have found two tools to help me with this procedure, alien (it msut be be installed, more details later, converts between rpm, debian and
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 14 other file formats), and rpm2cpio, which extracts cpio archive from rpm (cpio is a tool for creating and extracting archives, or copying files from one place to another). The goal is to copy all the files in place from the installer into the system folders structure just as the installer would do if rpm were supported. First, let s extract the files from the rpm and copy them in place. The following command will do this rpm2cpio aex-nsclt-6.2-1378.i386.rpm cpio vid We can see that this command extracted the contents of the RPM into the present working directory, so let s move the folder to the root Type mv opt/ / and make sure it has been done properly by listing /opt/ folder Type ls /opt/ you should see an altiris folder beneath it
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 15 Install alien by typing apt-get install alien y (this action asked me for the Ubuntu CD on the cdrom drive) Notes about alien: alien is (and will probably always be) rather experimental software. It has been used by many people for many years, but there are still many bugs and limitations. Installing alien thru apt-get requires the Ubuntu CD in the drive, I ran into an issue here, some contents require access to the Ubuntu CD rather than downloading the files from the Internet.
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 16 The fix is to disable installing updates from the CD-ROM and enabling the installation of updates from all Internet sources. This is done in the Preferences section of Add/Remove Applications. Afterwards, when installing alien, the patch is downloaded from the Internet and the installation is successful. Alternatively, edit /etc/apt/sources.list and put a # in front of the first line which must begin with deb cdrom:[ubuntu-. This will make apt-get to go directly to Internet to look up for sources. Now alien is installed and files have been extracted with rpm2cpio, let s try to mimic the rpm installation scripts with alien and see the results. Type alien -i aex-nsclt-6.2-1378.i386.rpm scripts Disregard the error about being unable to find aex-configure, as it will be solved manually a little later.
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 17 Configuring and Testing the Agent Now I m going to try to configure the Altiris Agent by running aex-configure iconfigure Type cd /opt/altiris/notification/nsagent/bin Type./aex-configure iconfigure It will result in a missed library error This error is thrown as the system is unable to find the Altiris libraries. Let s add the Altiris Agent lib folder to the library path and try again Type export LD_LIBRARY_PATH=/opt/altiris/notification/nsagent/lib/:$LD_LIBRARY_PATH Type./aex-configure.bin iconfigure Now it works!
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 18 This variable will be lost at restart, we need to set it fixed somehow, so that it s present every time Ubuntu starts. There are several ways of doing this (a simple way could be just copying all the lib/* to /lib). I prefer the following method, create a file /etc/ld.so.conf.d/altiris.conf with the following content: # Altiris default configuration /opt/altiris/notification/nsagent/lib Save and run ldconfig. Then restart the system and try again to run aex-configure.bin iconfigure. If aex-configure complains about missing library, something is wrong with your lib path.
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 19 Altiris Agent Configuration Next step is to setup the altiris agent as follows: Type cd /opt/altiris/notification/nsagent/bin Type./aex-configure.bin iconfigure Each configuration item has an example and should not be a problem what the script is asking for. The first item is the most important one. Make sure the correct server name is entered (usually this is the Fully Qualified Domain Name). Then it s all next, next, next. With the only exception being I like to setup the logging (in testing systems) to debug. Say yes to final question if you want to start the agent (I guess you can t wait for!) But I have bad news for you Altiris Agent is not running yet, Type ps ef, you will find that there aren t any Altiris (aex*) processes running. Type /etc/init.d/altiris status, and you will get an error message saying that it can t open /etc/rc.d/init.d/functions Remember I told you Ubuntu has a different runlevel folders structure. This is the problem. The way of solving it is by creating some links, as the folder rc.d and init.d do not exist in Ubuntu. These folders are needed by the agent to run. Type mkdir /etc/rc.d Type mkdir /etc/rc.d/init.d Type ln -s /lib/lsb/init-functions /etc/rc.d/init.d/functions Type ln s /etc/init.d/altiris /etc/rc2.d/s99altiris (This line starts the altiris agent in runlevel 2)
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 20 (My Ubuntu system boots on runlevel 2) Type ln s /etc/init.d/altiris /etc/rc3.d/s99altiris (This line starts the altiris agent in runlevel 3) Type ln s /etc/init.d/altiris /etc/rc5.d/s99altiris (This line starts the altiris agent in runlevel 5) Start the altiris agent Type /etc/init.d/altiris start Do not worry about the message 101: success not found Check to see if the altiris agent is running by typing ps ef grep aex If you have the Inventory Tasks for Linux enabled, the Ubuntu system should run Inventory soon. Requesting Altiris Agent Configuration Type./aex-refreshpolicies while in the nsagent/bin directory
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 21 Send Basic Inventory Type./aex-sendbasicinv from th nsagent/bin directory Show Agent Tasks Type./aex-swdapm from the nsagent/bin directory
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 22 Monitor Agent Log Type tail f /opt/altiris/notification/nsagent/var/aex-client.log
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 23 Resource Manager
H o w t o I n s t a l l t h e A l t i r i s A g e n t o n U b u n t u L i n u x P a g e 24 Note: As Ubuntu does not use the RPM format (and as was mentioned previously Ubuntu is not officially supported by Altiris) some information could not be collected. These issues could be solved by creating custom inventories to collect those special items. DISCLAIMER: Altiris does not warrant that their software will run on Ubuntu using the Unix Agent 6.2, which as of publication is the latest release. The methods described in this article are provided as USE AT YOUR OWN RISK. If you should run into issues with the ideas and / or methods mentioned in this article, please do not call Altiris support for assistance, as they will not be able to help you.