Thursday, August 19, 2010

100 linux administration interview questions


  1. You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this? Choose one: a. The login command is missing. b. The username is too long. c. The password field is blank. d. The password field is prefaced by an asterick.
  2. You create a new user account by adding the following line to your /etc/passwd file. bobm:baddog:501:501:Bob Morris:/home/bobm:/bin/bash Bob calls you and tells you that he cannot logon. You verify that he is using the correct username and password. What is the problem? Choose one: a. The UID and GID cannot be identical. b. You cannot have spaces in the line unless they are surrounded with double quotes. c. You cannot directly enter the password; rather you have to use the passwd command to assign a password to the user. d. The username is too short, it must be at least six characters long.
  3. Which of the following tasks is not necessary when creating a new user by editing the /etc/passwd file? Choose one: a. Create a link from the user’s home directory to the shell the user will use. b. Create the user’s home directory c. Use the passwd command to assign a password to the account. d. Add the user to the specified group.
  4. You create a new user by adding the following line to the /etc/passwd file bobm::501:501:Bob Morris:/home/bobm:/bin/bash You then create the user’s home directory and use the passwd command to set his password. However, the user calls you and says that he cannot log on. What is the problem? Choose one: a. The user did not change his password. b. bobm does not have permission to /home/bobm. c. The user did not type his username in all caps. d. You cannot leave the password field blank when creating a new user.
  5. When using useradd to create a new user account, which of the following tasks is not done automatically. Choose one: a. Assign a UID. b. Assign a default shell. c. Create the user’s home directory. d. Define the user’s home directory.
  6. You issue the following command useradd -m bobm But the user cannot logon. What is the problem? Choose one: a. You need to assign a password to bobm’s account using the passwd command. b. You need to create bobm’s home directory and set the appropriate permissions. c. You need to edit the /etc/passwd file and assign a shell for bobm’s account. d. The username must be at least five characters long.
  7. You have created special configuration files that you want copied to each user’s home directories when creating new user accounts. You copy the files to /etc/skel. Which of the following commands will make this happen? Choose one: a. useradd -m username b. useradd -mk username c. useradd -k username d. useradd -Dk username
  8. Mary has recently gotten married and wants to change her username from mstone to mknight. Which of the following commands should you run to accomplish this? Choose one: a. usermod -l mknight mstone b. usermod -l mstone mknight c. usermod -u mknight mstone d. usermod -u mstone mknight
  9. After bob leaves the company you issue the command userdel bob. Although his entry in the /etc/passwd file has been deleted, his home directory is still there. What command could you have used to make sure that his home directory was also deleted? Choose one: a. userdel -m bob b. userdel -u bob c. userdel -l bob d. userdel -r bob
  10. All groups are defined in the /etc/group file. Each entry contains four fields in the following order. Choose one: a. groupname, password, GID, member list b. GID, groupname, password, member list c. groupname, GID, password, member list d. GID, member list, groupname, password
  11. You need to create a new group called sales with Bob, Mary and Joe as members. Which of the following would accomplish this? Choose one: a. Add the following line to the /etc/group file: sales:44:bob,mary,joe b. Issue the command groupadd sales. c. Issue the command groupadd -a sales bob,mary,joe d. Add the following line to the /etc/group file: sales::44:bob,mary,joe
  12. What command is used to remove the password assigned to a group?
  13. You changed the GID of the sales group by editing the /etc/group file. All of the members can change to the group without any problem except for Joe. He cannot even login to the system. What is the problem? Choose one: a. Joe forgot the password for the group. b. You need to add Joe to the group again. c. Joe had the original GID specified as his default group in the /etc/passwd file. d. You need to delete Joe’s account and recreate it.
  14. You need to delete the group dataproject. Which two of the following tasks should you do first before deleting the group? A. Check the /etc/passwd file to make sure no one has this group as his default group. B. Change the members of the dataproject group to another group besides users. C. Make sure that the members listed in the /etc/group file are given new login names. D. Verify that no file or directory has this group listed as its owner. Choose one: a. A and C b. A and D c. B and C d. B and D
  15. When you look at the /etc/group file you see the group kmem listed. Since it does not own any files and no one is using it as a default group, can you delete this group?
  16. When looking at the /etc/passwd file, you notice that all the password fields contain ‘x’. What does this mean? Choose one: a. That the password is encrypted. b. That you are using shadow passwords. c. That all passwords are blank. d. That all passwords have expired.
  17. In order to improve your system’s security you decide to implement shadow passwords. What command should you use?
  18. What file contains the default environment variables when using the bash shell? Choose one: a. ~/.profile b. /bash c. /etc/profile d. ~/bash
  19. You have created a subdirectory of your home directory containing your scripts. Since you use the bash shell, what file would you edit to put this directory on your path? Choose one: a. ~/.profile b. /etc/profile c. /etc/bash d. ~/.bash
  20. Which of the following interprets your actions when typing at the command line for the operating system? Choose One a. Utility b. Application c. Shell d. Command
  21. What can you type at a command line to determine which shell you are using?
  22. You want to enter a series of commands from the command-line. What would be the quickest way to do this? Choose One a. Press enter after entering each command and its arguments b. Put them in a script and execute the script c. Separate each command with a semi-colon (;) and press enter after the last command d. Separate each command with a / and press enter after the last command
  23. You are entering a long, complex command line and you reach the right side of your screen before you have finished typing. You want to finish typing the necessary commands but have the display wrap around to the left. Which of the following key combinations would achieve this? Choose One a. Esc, /, Enter b. /, Enter c. ctrl-d, enter d. esc, /, ctrl-d
  24. After typing in a new command and pressing enter, you receive an error message indicating incorrect syntax. This error message originated from.. Choose one a. The shell b. The operating system c. The command d. The kernel
  25. When typing at the command line, the default editor is the _____________ library.
  26. You typed the following at the command line ls -al /home/ hadden. What key strokes would you enter to remove the space between the ‘/’ and ‘hadden’ without having to retype the entire line? Choose one a. Ctrl-B, Del b. Esc-b, Del c. Esc-Del, Del d. Ctrl-b, Del
  27. You would like to temporarily change your command line editor to be vi. What command should you type to change it?
  28. After experimenting with vi as your command line editor, you decide that you want to have vi your default editor every time you log in. What would be the appropriate way to do this? Choose one a. Change the /etc/inputrc file b. Change the /etc/profile file c. Change the ~/.inputrc file d. Change the ~/.profile file
  29. You have to type your name and title frequently throughout the day and would like to decrease the number of key strokes you use to type this. Which one of your configuration files would you edit to bind this information to one of the function keys?
  30. In your present working directory, you have the files maryletter memo1 MyTelephoneandAddressBook What is the fewest number of keys you can type to open the file MyTelephoneandAddressBook with vi? Choose one a. 6 b. 28 c. 25 d. 4
  31. A variable that you can name and assign a value to is called a _____________ variable.
  32. You have installed a new application but when you type in the command to start it you get the error message Command not found. What do you need to do to fix this problem? Choose one a. Add the directory containing the application to your path b. Specify the directory’s name whenever you run the application c. Verify that the execute permission has been applied to the command. d. Give everyone read, write and execute permission to the application’s directory.
  33. You telnet into several of your servers simultaneously. During the day, you sometimes get confused as to which telnet session is connected to which server. Which of the following commands in your .profile file would make it obvious to which server you are attached? Choose one a. PS1=’\h: \w>’ b. PS1=’\s: \W>’ c. PS1=’\!: \t>’ d. PS1=’\a: \n>’
  34. Which of the following environment variables determines your working directory at the completion of a successful login? Choose one a. HOME b. BASH_ENV c. PWD d. BLENDERDIR
  35. Every time you attempt to delete a file using the rm utility, the operating system prompts you for confirmation. You know that this is not the customary behavior for the rm command. What is wrong? Choose one a. rm has been aliased as rm -i b. The version of rm installed on your system is incorrect. c. This is the normal behavior of the newest version of rm. d. There is an incorrect link on your system.
  36. You are running out of space in your home directory. While looking for files to delete or compress you find a large file called .bash_history and delete it. A few days later, it is back and as large as before. What do you need to do to ensure that its size is smaller? Choose one a. Set the HISTFILESIZE variable to a smaller number. b. Set the HISTSIZE to a smaller number. c. Set the NOHISTFILE variable to true. d. Set the HISTAPPEND variable to true.
  37. In order to display the last five commands you have entered using the history command, you would type ___________.
  38. In order to display the last five commands you have entered using the fc command, you would type ___________.
  39. You previously ran the find command to locate a particular file. You want to run that command again. What would be the quickest way to do this? Choose one a. fc -l find fc n b. history -l find history n c. Retype the command d. fc -n find
  40. Using command substitution, how would you display the value of the present working directory? Choose one a. echo $(pwd) b. echo pwd c. $pwd d. pwd | echo
  41. You need to search the entire directory structure to locate a specific file. How could you do this and still be able to run other commands while the find command is still searching for your file? Choose one a. find / -name filename & b. find / -name filename c. bg find / -name filename d. &find / -name filename &
  42. In order to create a file called DirContents containing the contents of the /etc directory you would type ____________.
  43. What would be displayed as the result of issuing the command ps ef? Choose one a. A listing of the user’s running processes formatted as a tree. b. A listing of the stopped processes c. A listing of all the running processes formatted as a tree. d. A listing of all system processes formatted as a tree.
  44. What utility can you use to show a dynamic listing of running processes? __________
  45. The top utility can be used to change the priority of a running process? Another utility that can also be used to change priority is ___________?
  46. What key combination can you press to suspend a running job and place it in the background?
  47. You issue the command jobs and receive the following output: [1]- Stopped (tty output) pine [2]+ Stopped (tty output) MyScript How would you bring the MyScript process to the foreground? Choose one: a. fg %2 b. ctrl-c c. fg MyScript d. ctrl-z
  48. You enter the command cat MyFile | sort > DirList & and the operating system displays [4] 3499 What does this mean? Choose one a. This is job number 4 and the PID of the sort command is 3499. b. This is job number 4 and the PID of the job is 3499. c. This is job number 3499 and the PID of the cat command is 4. d. This is job number 4 and the PID of the cat command is 3499.
  49. You attempt to log out but receive an error message that you cannot. When you issue the jobs command, you see a process that is running in the background. How can you fix this so that you can logout? Choose one a. Issue the kill command with the PID of each running command of the pipeline as an argument. b. Issue the kill command with the job number as an argument. c. Issue the kill command with the PID of the last command as an argument. d. Issue the kill command without any arguments.
  50. You have been given the job of administering a new server. It houses a database used by the sales people. This information is changed frequently and is not duplicated anywhere else. What should you do to ensure that this information is not lost? Choose one a. Create a backup strategy that includes backing up this information at least daily. b. Prepare a proposal to purchase a backup server c. Recommend that the server be made part of a cluster. d. Install an additional hard drive in the server.
  51. When planning your backup strategy you need to consider how often you will perform a backup, how much time the backup takes and what media you will use. What other factor must you consider when planning your backup strategy? _________
  52. Many factors are taken into account when planning a backup strategy. The one most important one is how often does the file ____________.
  53. Which one of the following factors does not play a role in choosing the type of backup media to use? Choose one: a. How frequently a file changes b. How long you need to retain the backup c. How much data needs to be backed up d. How frequently the backed up data needs to be accessed
  54. When you only back up one partition, this is called a ______ backup. Choose one a. Differential b. Full c. Partial d. Copy
  55. When you back up only the files that have changed since the last backup, this is called a ______ backup. Choose one a. Partial b. Differential c. Full d. Copy
  56. The easiest, most basic form of backing up a file is to _____ it to another location.
  57. When is the most important time to restore a file from your backup? Choose one a. On a regular scheduled basis to verify that the data is available. b. When the system crashes. c. When a user inadvertently loses a file. d. When your boss asks to see how restoring a file works.
  58. As a system administrator, you are instructed to backup all the users’ home directories. Which of the following commands would accomplish this? Choose one a. tar rf usersbkup home/* b. tar cf usersbkup home/* c. tar cbf usersbkup home/* d. tar rvf usersbkup home/*
  59. What is wrong with the following command? tar cvfb / /dev/tape 20 Choose one a. You cannot use the c option with the b option. b. The correct line should be tar -cvfb / /dev/tape20. c. The arguments are not in the same order as the corresponding modifiers. d. The files to be backed up have not been specified.
  60. You need to view the contents of the tarfile called MyBackup.tar. What command would you use? __________
  61. After creating a backup of the users’ home directories called backup.cpio you are asked to restore a file called memo.ben. What command should you type?
  62. You want to create a compressed backup of the users’ home directories so you issue the command gzip /home/* backup.gz but it fails. The reason that it failed is that gzip will only compress one _______ at a time.
  63. You want to create a compressed backup of the users’ home directories. What utility should you use?
  64. You routinely compress old log files. You now need to examine a log from two months ago. In order to view its contents without first having to decompress it, use the _________ utility.
  65. Which two utilities can you use to set up a job to run at a specified time? Choose one: a. at and crond b. atrun and crontab c. at and crontab d. atd and crond
  66. You have written a script called usrs to parse the passwd file and create a list of usernames. You want to have this run at 5 am tomorrow so you can see the results when you get to work. Which of the following commands will work? Choose one: a. at 5:00 wed usrs b. at 5:00 wed -b usrs c. at 5:00 wed -l usrs d. at 5:00 wed -d usrs
  67. Several of your users have been scheduling large at jobs to run during peak load times. How can you prevent anyone from scheduling an at job? Choose one: a. delete the file /etc/at.deny b. create an empty file called /etc/at.deny c. create two empty files: /etc/at.deny and /etc/at.allow file d. create an empty file called /etc/at.allow
  68. How can you determine who has scheduled at jobs? Choose one: a. at -l b. at -q c. at -d d. atwho
  69. When defining a cronjob, there are five fields used to specify when the job will run. What are these fields and what is the correct order? Choose one: a. minute, hour, day of week, day of month, month b. minute, hour, month, day of month, day of week c. minute, hour, day of month, month, day of week d. hour, minute, day of month, month, day of week
  70. You have entered the following cronjob. When will it run? 15 * * * 1,3,5 myscript Choose one: a. at 15 minutes after every hour on the 1st, 3rd and 5th of each month. b. at 1:15 am, 3:15 am, and 5:15 am every day c. at 3:00 pm on the 1st, 3rd, and 5th of each month d. at 15 minutes after every hour every Monday, Wednesday, and Friday
  71. As the system administrator you need to review Bob’s cronjobs. What command would you use? Choose one: a. crontab -lu bob b. crontab -u bob c. crontab -l d. cronq -lu bob
  72. In order to schedule a cronjob, the first task is to create a text file containing the jobs to be run along with the time they are to run. Which of the following commands will run the script MyScript every day at 11:45 pm? Choose one: a. * 23 45 * * MyScript b. 23 45 * * * MyScript c. 45 23 * * * MyScript d. * * * 23 45 MyScript
  73. Which daemon must be running in order to have any scheduled jobs run as scheduled? Choose one: a. crond b. atd c. atrun d. crontab
  74. You want to ensure that your system is not overloaded with users running multiple scheduled jobs. A policy has been established that only the system administrators can create any scheduled jobs. It is your job to implement this policy. How are you going to do this? Choose one: a. create an empty file called /etc/cron.deny b. create a file called /etc/cron.allow which contains the names of those allowed to schedule jobs. c. create a file called /etc/cron.deny containing all regular usernames. d. create two empty files called /etc/cron.allow and /etc/cron.deny
  75. You notice that your server load is exceptionally high during the hours of 10 am to 2 noon. When investigating the cause, you suspect that it may be a cron job scheduled by one of your users. What command can you use to determine if your suspicions are correct? Choose one: a. crontab -u b. crond -u c. crontab -l d. crond -l
  76. One of your users, Bob, has created a script to reindex his database. Now he has it scheduled to run every day at 10:30 am. What command should you use to delete this job. Choose one: a. crontab -ru bob b. crontab -u bob c. crontab -du bob d. crontab -lu bob
  77. What daemon is responsible for tracking events on your system?
  78. What is the name and path of the default configuration file used by the syslogd daemon?
  79. You have made changes to the /etc/syslog.conf file. Which of the following commands will cause these changes to be implemented without having to reboot your computer? Choose one: a. kill SIGHINT `cat /var/run/syslogd.pid` b. kill SIGHUP `cat /var/run/syslogd.pid` c. kill SIGHUP syslogd d. kill SIGHINT syslogd
  80. Which of the following lines in your /etc/syslog.conf file will cause all critical messages to be logged to the file /var/log/critmessages? Choose one: a. *.=crit /var/log/critmessages b. *crit /var/log/critmessages c. *=crit /var/log/critmessages d. *.crit /var/log/critmessages
  81. You wish to have all mail messages except those of type info to the /var/log/mailmessages file. Which of the following lines in your /etc/syslogd.conf file would accomplish this? Choose one: a. mail.*;mail!=info /var/log/mailmessages b. mail.*;mail.=info /var/log/mailmessages c. mail.*;mail.info /var/log/mailmessages d. mail.*;mail.!=info /var/log/mailmessages
  82. What is the name and path of the main system log?
  83. Which log contains information on currently logged in users? Choose one: a. /var/log/utmp b. /var/log/wtmp c. /var/log/lastlog d. /var/log/messages
  84. You have been assigned the task of determining if there are any user accounts defined on your system that have not been used during the last three months. Which log file should you examine to determine this information? Choose one: a. /var/log/wtmp b. /var/log/lastlog c. /var/log/utmp d. /var/log/messages
  85. You have been told to configure a method of rotating log files on your system. Which of the following factors do you not need to consider? Choose one: a. date and time of messages b. log size c. frequency of rotation d. amount of available disk space
  86. What utility can you use to automate rotation of logs?
  87. You wish to rotate all your logs weekly except for the /var/log/wtmp log which you wish to rotate monthly. How could you accomplish this. Choose one: a. Assign a global option to rotate all logs weekly and a local option to rotate the /var/log/wtmp log monthly. b. Assign a local option to rotate all logs weekly and a global option to rotate the /var/log/wtmp log monthly. c. Move the /var/log/wtmp log to a different directory. Run logrotate against the new location. d. Configure logrotate to not rotate the /var/log/wtmp log. Rotate it manually every month.
  88. You have configured logrotate to rotate your logs weekly and keep them for eight weeks. You are running our of disk space. What should you do? Choose one: a. Quit using logrotate and manually save old logs to another location. b. Reconfigure logrotate to only save logs for four weeks. c. Configure logrotate to save old files to another location. d. Use the prerotate command to run a script to move the older logs to another location.
  89. What command can you use to review boot messages?
  90. What file defines the levels of messages written to system log files?
  91. What account is created when you install Linux?
  92. While logged on as a regular user, your boss calls up and wants you to create a new user account immediately. How can you do this without first having to close your work, log off and logon as root? Choose one: a. Issue the command rootlog. b. Issue the command su and type exit when finished. c. Issue the command su and type logoff when finished. d. Issue the command logon root and type exit when finished.
  93. Which file defines all users on your system? Choose one: a. /etc/passwd b. /etc/users c. /etc/password d. /etc/user.conf
  94. There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order? Choose one: a. username, UID, GID, home directory, command, comment b. username, UID, GID, comment, home directory, command c. UID, username, GID, home directory, comment, command d. username, UID, group name, GID, home directory, comment
  95. Which of the following user names is invalid? Choose one: a. Theresa Hadden b. thadden c. TheresaH d. T.H.
  96. In order to prevent a user from logging in, you can add a(n) ________at the beginning of the password field.
  97. The beginning user identifier is defined in the _________ file.
  98. Which field is used to define the user’s default shell?
  99. Bob Armstrong, who has a username of boba, calls to tell you he forgot his password. What command should you use to reset his command?
  100. Your company has implemented a policy that users’ passwords must be reset every ninety days. Since you have over 100 users you created a file with each username and the new password. How are you going to change the old passwords to the new ones? Choose one: a. Use the chpasswd command along with the name of the file containing the new passwords. b. Use the passwd command with the -f option and the name of the file containing the new passwords. c. Open the /etc/passwd file in a text editor and manually change each password. d. Use the passwd command with the -u option.

How does DNS work step by step



ZoneEdit.Com : Simplified example of how DNS works
 Client enters a domain name (www.domainname.com) into his browser
The browser contacts the Client's ISP for the IP address of the domain name
The ISP first tries to answer by itself using "cached" data.
If
the answer is found it is returned. Since the ISP isn't in charge of the DNS, and is just acting as a "dns relay", the answer is marked "non-authoritative"
If the answer isn't found, or it's too old (past the TTL), then the ISP DNS contacts the nameservers for the domain directly for the answer.
If the nameservers are not known, the ISP's looks for the information at the 'root servers', or 'registry servers'. For com/net/org, these start with a.gtld-servers.net.
NOTE: The 'whois' information is never used for DNS, and is often misleading and inaccurate

Installing and Configuring Monit Step by Stepm


install and configure monit

apt-get install monit

Monit Configuration file is  /etc/monit/monitrc

Now make the list of services you want to monitor 


for example sshd,apache,Mysql 


Now for monit web interface the default port number is 2812

Now let us configure the monit 


vi /etc/monit/monitrc
-------------------------------------------------------------------------------------------------------------------- 
 
set daemon  60    // time interval of the daemon
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: monit@server1.example.com }
set alert root@localhost // mail id to send email alerts
set httpd port 2812 and  // If you want to chang port number change here better leave it default
     SSL ENABLE          // for SSL
     PEMFILE  /var/certs/monit.pem   // SSL certificate location
     allow admin:test                // user name and password Basic Auth

// monitoring sshd

check process sshd with pidfile /var/run/sshd.pid
   start program  "/etc/init.d/ssh start"
   stop program  "/etc/init.d/ssh stop"
   if failed port 22 protocol ssh then restart
   if 5 restarts within 5 cycles then timeout
// monitoring mysql

check process mysql with pidfile /var/run/mysqld/mysqld.pid
   group database
   start program = "/etc/init.d/mysql start"
   stop program = "/etc/init.d/mysql stop"
   if failed host 127.0.0.1 port 3306 then restart
   if 5 restarts within 5 cycles then timeout
// monitoring apache

check process apache with pidfile /var/run/apache2.pid
   group www
   start program = "/etc/init.d/apache2 start"
   stop program  = "/etc/init.d/apache2 stop"

   if failed host www.example.com port 80 protocol http
      and request "/monit/token" then restart
here monit tries to connect www.example.com on port 80 and tries to access a file
/monit/token
 
the actual location of /monit/token is 
 
/var/www/www.example.com/web/monit/token
 
as our website document root is   
 
/var/www/www.example.com/web 
 
if monit cannot access this file it means apache is not runnig so it will
restart apache.
 
Creation of token is given below  
   if cpu is greater than 60% for 2 cycles then alert
   if cpu > 80% for 5 cycles then restart
   if totalmem > 500 MB for 5 cycles then restart
   if children > 250 then restart
   if loadavg(5min) greater than 10 for 8 cycles then stop
   if 3 restarts within 5 cycles then timeout

you can add your custom process for 
monitoring here

---------------------------------------------------------------------------------------------------------------- 


Creation of token
<a href="http://a.collective-media.net/jump/idgt.howtoforge.en/article_below;sec=article;fold=below;tile=3;sz=300x250;ord=123456789?" target="_blank"><img src="http://a.collective-media.net/ad/idgt.howtoforge.en/article_below;sec=article;fold=below;tile=3;sz=300x250;ord=123456789?" width="300" height="250" border="0" alt=""></a>
 ---------------------

mkdir /var/www/www.example.com/web/monit

echo "hello" > /var/www/www.example.com/web/monit/token 


Creation of SSL-encrypted monit web interface

-----------------------------------------------------------------
(  /var/certs/monit.pem  )


openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem
openssl gendh 512 >> /var/certs/monit.pem
openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem
chmod 700 /var/certs/monit.pem 



then we need to configure OpenSSL configuration file to create our certificate 
vi /var/certs/monit.cnf

example file is  
-------------------------------------------------------------------------------------------
# create RSA certs - Server

RANDFILE = ./openssl.rnd

[ req ]
default_bits = 1024
encrypt_key = yes
distinguished_name = req_dn
x509_extensions = cert_type

[ req_dn ]
countryName = Country Name (2 letter code)
countryName_default = MO

stateOrProvinceName             = State or Province Name (full name)
stateOrProvinceName_default     = Monitoria

localityName                    = Locality Name (eg, city)
localityName_default            = Monittown

organizationName                = Organization Name (eg, company)
organizationName_default        = Monit Inc.

organizationalUnitName          = Organizational Unit Name (eg, section)
organizationalUnitName_default  = Dept. of Monitoring Technologies

commonName                      = Common Name (FQDN of your server)
commonName_default              = server.monit.mo

emailAddress                    = Email Address
emailAddress_default            = root@monit.mo

[ cert_type ]
nsCertType = server
------------------------------------------------------------------------------ 
enable monit daemon now
/etc/default/monit 
 
in this file set startup =1 and interval for running the monit daemon
example file is below 
--------------------------------------------------------------
# Defaults for monit initscript
# sourced by /etc/init.d/monit
# installed at /etc/default/monit by maintainer scripts
# Fredrik Steen 

# You must set this variable to for monit to start
startup=1

# To change the intervals which monit should run uncomment
# and change this variable.
CHECK_INTERVALS=60
--------------------------------------------------------------- 
now let us start monit
/etc/init.d/monit start  
 
 
Now point your browser to https://www.example.com:2812/
 (make sure port 2812 is not blocked by your firewall), log in with admin and test 
as specified in /etc/monit/monitrc

Overview of OpenNebula Step by Step Guide

( Ref : OpenNubula.org  )


OpenNebula can be primarily used as a virtualization tool to manage your virtual infrastructure in the data-center or cluster.

  • OpenNebula is a toolkit for building Clouds ( public cloud,private cloud )
  •  It Supports KVM , Xen , Vmware Server , VirtualBox (planned from 1.4.2)
  •  It consists of  Front End , Node
    Front End installation

    $ sudo apt-get install opennebula
          Reading package lists... Done 
          Building dependency tree 
          Reading state information... Done 
          The following extra packages will be installed: 
            opennebula-common 
          The following NEW packages will be installed: 
            opennebula opennebula-common 
          0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. 
          Need to get 280kB of archives. 
          After this operation, 1352kB of additional disk space will be used. 
          Do you want to continue [Y/n]? 
          … 
          Setting up opennebula-common (1.2-0ubuntu1~intrepid1) … 
          … 
          Adding system user `oneadmin’ (UID 107) … 
          Adding new user `oneadmin’ (UID 107) with group `nogroup’ … 
          Generating public/private rsa key pair. 
          … 
          Setting up opennebula (1.2-0ubuntu1~intrepid1) …
          oned and scheduler started 


    Node Installation

    $ sudo apt-get install opennebula-node 
        Reading package lists... Done 
        Building dependency tree 
        Reading state information... Done 
        The following extra packages will be installed: 
          opennebula-common 
        The following NEW packages will be installed: 
          opennebula-common opennebula-node 
        ... 
        Setting up opennebula-node (1.2-0ubuntu1~intrepid1) ...
        Adding user `oneadmin' to group `libvirtd' ... 
        Adding user oneadmin to group libvirtd 
        Done. 

     OpenNebula Core
    ----------------------
        *      Request Manager, to handle client requests
        *      Virtual Machine Manager, to manage and monitor of VMs
        *      Transfer Manager, to manage VM images
        *      Virtual Network Manager, to manage virtual networks
        *      Host Manager, to manage and monitor physical resources
        *      Database, persistent storage for ONE data structures

    OpenNebula does the following:
    ------------------------------------
        *      Manages Virtual Networks. Virtual networks interconnect VMs. Each Virtual Networks includes a description.
        *      Creates VMs. The VM description is added to the database.
        *      Deploys VMs. According to the allocation policy, the scheduler decides where to execute the VMs.
        *      Manages VM Images. Before execution, VM images are transferred to the host and swap disk images are created. After execution, VM images may be copied back to the repository.
        *      Manages Running VMs. VM are started, periodically polled to get their consumption and state, and can be shutdown, suspended, stopped or migrated.

    The main functional components of an OpenNebula Private Cloud are the following:
    -------------------------------------------------------------------------------------
        *      Hypervisor: Virtualization manager installed in the resources of the cluster that OpenNebula leverages for the management of the VMs within each host.
        *      Virtual Infrastructure Manager: Centralized manager of VMs and resources, providing virtual network management, VM life-cycle management, VM image management and fault tolerance.
        *      Scheduler: VM placement policies for balance of workload, server consolidation, placement constraints, affinity, advance reservation of capacity and SLA commitment.



    Daemon Configuration Attributes
    -------------------------------------

        *      HOST_MONITORING_INTERVAL : Time in seconds between host monitorization
        *      VM_POLLING_INTERVAL : Time in seconds between virtual machine monitorization
        *      VM_DIR : Remote path to store the VM images, it should be shared between all the cluster nodes to perform live migrations. This path will be used for all the cluster nodes.
        *      MAC_PREFIX: Default MAC prefix to generate virtual network MAC addresses
        *      NETWORK_SIZE: Default size for virtual networks
        *      PORT : Port where oned will listen for xml-rpc calls
        *      DEBUG_LEVEL : Sets the level of verbosity of $ONE_LOCATION/var/oned.log log file. Possible values are:

    DEBUG_LEVEL    Meaning
    ---------------------------------
    0                               ERROR
    1                               WARNING
    2                               INFO
    3                               DEBUG



    Command line interface
    --------------------------------

        *      onevm: to submit, control and monitor virtual machines
        *      onehost: to add, delete and monitor hosts


    $ onehost list
     HID NAME                      RVM   TCPU   FCPU   ACPU    TMEM        FMEM       STAT
       0 host01                      0         800     800     800      8194468    7867604   on
       1 host02                      0         800      797    800      8387584    1438720   on

    $ onevm list
     ID     USER     NAME         STAT  CPU     MEM            HOSTNAME        TIME
     1001 oneadmin  fc11AOS   dele      0          512000           node2                02 22:10:56

    OpenNebula

    What is OpenNebula ?
    •It is an open source toolkit for building clouds.
    •The latest release has built-in support for KVM, Xen Kernel and VmWare Server.

    How OpenNebula works ?
    OpenNebula is a distributed application containing two components 

    The first component referred to as OpenNebula front-end runs on VX64 server. 

    sudo apt-get install opennebula 

    The second component referred to as OpenNebula Node should be installed on all hosts part of the compute cluster. This package prepares the machine for being a node in an OpenNebula cloud. It in turn configures the following dependent packages: 

    1) KVM 
    2) libvirt 
    3) oneadmin user creation 
    4) ruby 

    sudo apt-get install opennebula-node


    What are the components of opennebula front-end ?


    OpenNebula front-end spawns the following processes when it starts: ( Note that front-end should always be started as oneadmin user using the command sudo -u oneadmin one start ) 

    1) OpenNebula Daemon ( oned ) - Responsible for handling all incoming requests ( either from CLI or from API ). Talks to other processes whenever required. 

    2) Scheduler ( mm_sched ) - It does match making to find a suitable host ( amongst the hosts part of compute cluster ) for bringing up virtual machines. 

    3) Information Manager ( one_im_ssh.rb ) - Collects resource availability/utilization information for hosts/VMs respectively. ( Resources include CPU and Memory) 

    4) Transfer Manager ( one_tm.rb ) - Responsbile for Image Managemnt ( Clone Image, Delete Image, etc. ) 

    5) Virtual Machine Manager ( one_vmm_kvm.rb )- Acts as interface to the underlying Hypervisor. ( All operations to be performed on Virtual Machines go through this interface ) 

    6) Hook Manager ( one_hm.rb ) - Responsible for executing Virtual Machine Hooks. ( Hooks are programs which are automatically triggered on VM state changes. They must be configured prior to starting front-end ) 

    OpenNebula front-end can be configured to a great extent by modifying the contents of file /etc/one/oned.conf. Consider a sample configuration below: 

    ################################################################################
    HOST_MONITORING_INTERVAL=10 # Used by Information manager to decide the frequency at which resource availability details have to be collected for hosts 

    VM_POLLING_INTERVAL=10 # Used by Information manager to decide the frequency at which resource utilization details have to be collected for VMs 

    VM_DIR=/mnt/onenfs/ # Should be shared across all hosts in compute cluster. Contains Disk Images required for booting VMs 

    PORT=2633 # All supported API calls are converted to XML-RPC calls. front-end runs an XML-RPC Server on this port to handle these calls 

    DEBUG_LEVEL=3 # DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG 

    NETWORK_SIZE = 254 # Default size for Virtual Networks ( applicable while using onevnet ) 

    MAC_PREFIX = "00:03" # Default MAC prefix to use while generating MAC Address from IP Address ( applicable while using onevnet ) 

    # The following configuration supports KVM hypervisor. Note that the executables one_im_ssh one_vmm_kvm one_tm and one_hm can be found in /usr/lib/one/mads/ 

    IM_MAD = [ 
    name = "im_kvm", 
    executable = "one_im_ssh", 
    arguments = "im_kvm/im_kvm.conf" ] 

    VM_MAD = [ 
    name = "vmm_kvm", 
    executable = "one_vmm_kvm", 
    default = "vmm_kvm/vmm_kvm.conf", 
    type = "kvm" ] 

    TM_MAD = [ 
    name = "tm_nfs", 
    executable = "one_tm", 
    arguments = "tm_nfs/tm_nfs.conf" ] 

    HM_MAD = [ 
    executable = "one_hm" ]



    Working with OpenNebula CLI ( OpenNebula CLI is available only on front-end ) ?

    1) Adding a new Host to compute cluster 

    onehost create

    Note that im_mad, vmm_mad, tm_mad in our case should be im_kvm, vmm_kvm and tm_nfs respectively as we have configured them in /etc/one/oned.conf

    Also note that Information manager needs to collect resource availability ( CPU and Memory ) information for the host we have added. This requires:

    • oneadmin user on front-end should be able to ssh to host without entering password ( test this using sudo -u oneadmin ssh oneadmin@ on front-end )
    • Inorder for this to work copy the contents of /var/lib/one/.ssh/id_rsa.pub on front-end to /var/lib/one/.ssh/authorized_keys on host

    Type onehost list to check the status:

    Notice the value of STAT attribute. If the attribute has a value of 'on' then the host has been successfully added to compute cluster:

    ID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT
    0 192.168.155.127 0 200 198 198 1800340 1341620 on


    Look into /var/log/one/oned.log on front-end for debugging
    Once a host has been successfully added use onehost disable/enable to toggle its status.


    2) Submitting a new Virtual Machine job 

    In order to provision a Virtual Machine in the compute cluster we need to construct a template and submit it using

    onevm create

    The following is a sample template:
    ################################################################################
    NAME = Ubuntu
    CPU = 0.5
    MEMORY = 150
    DISK = [clone=no, type="disk",source="/mnt/onenfs/ubuntu.img", target="hda"]
    GRAPHICS = [
    type = "vnc",
    listen = "0.0.0.0",
    port = "10"]

    ################################################################################

    Note that all Virtual Machines will use the default properties present in /etc/one/vmm_kvm/vmm_kvm.conf unless they are overriden in the template.

    The following is a sample /etc/one/vmm_kvm/vmm_kvm.conf which enables ACPI for all VMs and configures boot from hard disk.

    ###############################################################################
    OS = [ boot = "hd" ]

    FEATURES = [
    PAE=no,
    ACPI=yes
    ]
    ################################################################################

    Issues with VM coming up will be captured either in /var/log/one/oned.log in front-end or /var/log/libvirt/qemu/one-.log on host where VM job has been scheduled.


    4) Creating Virtual Networks 

    ( Note that onevnet does not create bridge or vlan. We should use brctl and vconfig respectively )

    Create a VLAN ( creating VLAN 12 here )

    sudo vconfig add eth0 12

    Create a bridge and encapsulate the above VLAN

    sudo brctl addbr br12

    sudo brctl addif br12 eth0.12

    Bring up the VLAN

    ip link set eth0.12 up

    Create a file named "vlan12.one" containing the following content:

    BRIDGE=br12
    NAME=VLAN12
    NETWORK_ADDRESS=192.168.12.0
    NETWORK_SIZE=B
    TYPE=RANGED

    Create a Virtual Network using the following command:
    onevnet create vlan12.one

    View the list of created Virtual Networks

    # COMMAND #
    onevnet list

    # OUTPUT #
    ID USER NAME TYPE BRIDGE #LEASES
    0 shashank VLAN12 Ranged br12 0

    View the configuration of a specific Virtual Network

    # COMMAND #
    onevnet show 0

    # OUTPUT #
    VIRTUAL NETWORK 0 INFORMATION
    ID: : 0
    UID: : 0

    VIRTUAL NETWORK TEMPLATE
    BRIDGE=br12
    NAME=VLAN12
    NETWORK_ADDRESS=192.168.12.0
    NETWORK_SIZE=B
    TYPE=RANGED

    To Bring up a Virtual Machine in above created Virtual Network, add the following to VM template:

    NIC=[NETWORK="VLAN12",IP=192.168.12.4]

    ( Note that MAC address for this VM is dynamically generated based on the IP specified )

    To view the list of IP addresses currently allocated in the above created virtual network, issue the following command

    # COMMAND #
    onevnet show 0

    VIRTUAL NETWORK 0 INFORMATION
    ID: : 0
    UID: : 0

    VIRTUAL NETWORK TEMPLATE
    BRIDGE=br12
    NAME=VLAN12
    NETWORK_ADDRESS=192.168.12.0
    NETWORK_SIZE=B
    TYPE=RANGED

    LEASES INFORMATION
    LEASE=[ IP=192.168.12.4, MAC=00:03:c0:a8:0c:04, USED=1, VID=12 ]


    5) Disadvantages of using onevnet 

    1) An additional script is required inside the VM which does MAC -> IP conversion and configures the network device on boot.

    2) onevnet does not create bridge or vlan.

    3) Virtual Machine job will not be submitted if the specified IP is not available.

    4) There seems to be no way to specify the IP lease time. DHCP server is highly customizable.

    5) If we plan to give hostnames to Virtual Machines in future we might retain DHCP server and configure DDNS updates which may not be possible while using onevnet leases.


    3) Enabling additional debugging 

    Edit /etc/one/defaultrc file to add the following:

    ONE_MAD_DEBUG=1

    The above setting will create the following log files in /var/log/one/

    im_kvm.log
    one_vmm_kvm.log
    tm_nfs.log
    one_hm.log


    6) Viewing and Modifying OpenNebula backend database 

    If requried we can use sqlitebrowser to open and edit /var/lib/one/one.db ( sudo apt-get install sqlitebrowser )


    How to Configure Local Apt-Cacher-Server for Intranet U

    Server Installation:

    1. Install apt-cacher and apache2 webserver

    #apt-get install apt-cacher apache2

    2.Enable apt-cacher

    Edit /etc/default/apt-cacher and change autostart to 1. (This will automatically start
    cache server).

    #vi /etc/default/apt-cacher

    autostart=1

    3.Restart the apache server

    #/etc/init.d/apache2 restart

    4.Restart the apt-cacher server

    #/etc/init.d/apt-cacher restart

    Now test your apt-cacher server.Go to remote machine in your network.open your
    browser type the hostname or IP address of your apt-cacher
    server.

    #firefox http:///apt-cacher  [ hostname / ip ]

     
    sometimes it won't work. Then try

    #firefox http://hostname/ip :3142";

    save and quit

    [OR]

    Create a small script.

    #vi check-apt-cacher.sh
    ---------------------------------------------------------------------------------------------------

    . /lib/lsb/init-functions
    log_daemon_msg "Configuring APT cache proxy" "(based on SERVER_NAME_HERE's
    presence...)"
    ping -c 1 SERVER_NAME_HERE &> /dev/null
    if [ $? = "0" ]; then
    echo "Acquire::http::Proxy \"http://SERVER_NAME_HERE:3142\";" > /etc/apt/
    apt.conf.d/01SERVER_NAME_HEREproxy
    else
    rm /etc/apt/apt.conf.d/01SERVER_NAME_HEREproxy &> /dev/null
    fi
    log_end_msg 0

    ---------------------------------------------------------------------------------------------------

    (Note: Replace SERVER_NAME_HERE with the ipaddress of apt-cacher server).
    save and quit
    #chmod +x /root/check-apt-cacher
    #crontab -e
    */1 * * * * /bin/bash /root/check-apt-cacher
    save and quit
    This script will run each minute (*/1) you can change it as you see fit.
    You're done.
    ---------------------------------------------------------------------------------------------------
    ---------------------------------------------------------------------------------------------
    How It Works?
     
    In each and every client machine in our network, we are going to mention the apt-
    cacher server as a proxy server in the /etc/apt/apt.conf.d/ directory. So in our network,
    If anyone Downloads packages using apt-get command. First, it checks in the cache
    folder of apt-cacher server i.e.., /var/cache/apt-cacher/packages. If it doesn't find any
    packages, it downloads from the internet and keeps in its cache folder and as well as
    installs on the client machines(regardless of what version of ubuntu they are using). So
    that if any other people tries to install the same package,they can directly install it from
    the cache instead of hitting internet all the time,which saves bandwidth.
    ---------------------------------------------------------------------------------------------------
    (Note : I have installed apt-cacher server on ubuntu 9.04 and i tried to access from
    client side which is of ubuntu 9.04 and ubuntu 10.04. i installed few packages on the
    client side, which client and as well as server doesn't have. The new package is fetched
    form the internet and is kept in the apt-cacher cache directory.)

    Centralized Log Management with RSyslog

    Why Rsyslog?

    For Centralized logging.Having a centralized logging is a prerequisite if you want to have your logs intacts. But having the events recorded in plain files is virtually impossible for queries.Because of this, we can configure rsyslog to write events in MySQL DB and a web interface for queries with filters to facilitate viewing of the logs without have to access the console for such task.

    Rsyslog Installation

    Installing rsyslog on Ubuntu is easy:

     #aptitude install rsyslog
     #aptitude install rsyslog-doc
    All configuration is placed in the /etc/rsyslog.conf file or in files found under the /etc/rsyslog.d directory.
    • Configuration structure :Configuration files are structured in the following manner:



      • Modules
      • Global directives
      • Filter rules
    • Rsyslog Server configuration: 
     #vim /etc/rsyslog.conf
    Local logging functionality is provided by the imuxsock plug-in (also 
    enabled by default).

    $ModLoad imuxsock
     $ModLoad imklog
    On the server, assuming you are running rsyslog, you do this by enabling the appropriate input module, as well as specifying the port to be used:
    UDP:
     
    $ModLoad imudp
    $UDPServerRun 514
    TCP:

    $ModLoad imtcp 
    $InputTCPServerRun 514 

    Rsyslog provides a flexible system to specify the output formats. It is template-based. A template with the traditional syslog format looks as follows:



    $template TraditionalFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n"


     Now we have the right template - but how to write it to a file? You probably have a line like this in your rsyslog.conf:

    *.* -/var/log/messages.log;TraditionalFormat

    -------------------------------------------------------------------------

    Writing syslog messages to MySQL

    --------------------------------------------------------------------------

     rsyslog-mysql mysql-server php-mysql

    while installing you will be prompted for mysql rsyslog user password.Enter the details and remember them.Next, the server should load the output module ommysql and be configured to connect to the database. Its configuration should be similar to the following:

    #vim /etc/rsyslog.conf
    # service mysqld start
    # mysql -uroot -predhat
    mysql> GRANT SELECT, UPDATE, INSERT ON Syslog.* TO rsyslog@localhost IDENTIFIED BY 'password'; 
    mysql> \q 
    #vim /etc/rsyslog.conf 
    $ModLoad ommysql 
    *.* :ommysql:127.0.0.1,Syslog,rsyslog,rsyslog 
    [*.*  :ommysql:database-server,database-name,database-userid,database-password]
    #restart mysql 
    #restart rsyslog 

    Now check your database:

    #mysql -uroot -predhat 
    #show databases; 
    #USE Syslog;
    #show tables;
    #DESCRIBE SystemEvents; 
    #select * from SystemEvents; 

    you can see all your log messages here,if you have properly configured.Generate few log messages with logger command, then open three terminals.

    #tail -f /var/log/messages
    #logger system rebooted 
    #mysql 


    check the timestamps of the logs and whether they are being logged into database or not.
    • Clients Setup:
    #apt-get install rsyslog


    First, you need to create a working directory for rsyslog. This is where it stores its queue files (should need arise). You may use any location on your local system. There is nothing else to do. With the following simple config file, you forward anything you receive to a remote server and have buffering applied automatically when it goes down. This must be done on the client machine.

    #vim /etc/syslog.conf
    $ModLoad imuxsock    # local message reception 
    $WorkDirectory /rsyslog/work       # default location for work (spool) files 
    $ActionQueueType LinkedList       # use asynchronous processing
    $ActionQueueFileName srvrfwd    # set file name, also enables disk mode 
    $ActionResumeRetryCount -1       # infinite retries on insert failure 
    $ActionQueueSaveOnShutdown on  # save in-memory data if rsyslog shuts down. 

    *.* @@server:port 
    *.* @172.168.155.75:514      #forward all its logs via UDP 
    *.* @@172.168.155.75:514  #forward all its logs via TCP. 

    -----------------------------------------------------------

    LogAnalyzer - WebUI

    ------------------------------------------------------------

    The LogAnalyzer project provides an easy to use but powerful frontend for searching, reviewing and analyzing syslog, event log and many other event sources.
    • HOWTO install LogAnalyzer
    To install LogAnalyzer, you need:

    * Apache
    * PHP5

    #apt-get install apache2
    #apt-get install php5
    #apt-get install libapache2-mod-php5
    #/etc/init.d/apache2 restart 

    Now install Loganalyzer. It's pretty easy.
    #wget http://download.adiscon.com/loganalyzer/loganalyzer-3.0.1.tar.gz 
    #tar -xvzf loganalyzer-3.0.1.tar.gz 
    #mkdir -p /var/www/loganalyzer 

    Upload all files from the loganalyzer/src/ folder to you webserver. The other files are not needed on the webserver.

    #cp -R loganalyser-v3.0.1/src/* /var/www/loganalyzer 


    Upload the scripts configure.sh and secure.sh from the contrib folder to your webserver, into the same folder where you uploaded the other LogAnalyzer files into. Then set the execution flag to them (chmod +x configure.sh secure.sh).Now run ./configure.sh, this will create a blank config.php, and will also set write access to everyone to it.You can of course do this manually if you want.

    #chmod +x configure.sh secure.sh 
    #./configure.sh 

    Now open your LogAnalyzer installation in your favourite webbrowser, you will see an error, and you will be pointed to the installation script. The install script will guide you through the LogAnalyzer installation, just follow the instructions.



     

     

     

     

     

     

     

     Some Related Links for more information

    http://www.ubuntu.com/system/files/CentralLogging-v4-20090901-03.pdf

    ShellScripts

    Bash Script to find CPU type or model?

    #!/bin/sh

    if [ -f /proc/cpuinfo ]; then

        echo -n "MODELNAME=\""
        grep -m 1 "model name" /proc/cpuinfo | cut -d: -f2 | sed -e 's/^ *//' | sed -e 's/$/"/'
       
    fi



    OUTPUT:
    MODELNAME="Intel(R) Core(TM)2 Duo CPU     E8200  @ 2.66GHz"




    Useful Tips & Tricks

    View Config Files Without Comments
    grep ^[^#] /etc/apache2/apache2.conf
    grep ^[^#] /etc/httpd/conf/httpd.conf

    Restore data from amanda backup server

    Continution to my post install and configure amanda backup server i am posting step by step process of
    recovering data from the backup server.

    Our Current Scenario is : 

    1. My daily backup profile is DailySet1

    2. The data backup is in /data/amanda/vtape/DailySet1 on amanda server.

    3. We will recover data on client system to /tmp/amanda  directory

    -----------------------------------------------------------------------------------------------
    Do this on Amanda Client System
    -----------------------------------------------------------------------------------------------

    Switch user to root

    # sudo su
     Then as a root user do amrecover

    # amrecover DailySet1

     then use  listdisk command to see the list of  backups

    # listdisk 

      it shows the client names and the directories we are taking backup on that client
    Then use setdisk command to set the directory which we want to recover data from


    # setdisk /data/backup


    then add the files you want to recover for example if you want to recover file1
    use

    # add file1


    In my case i have give only one file to take backup so i will use '*' to  recover all files in that
    direcory.


    # add *


    Then finally use extract command to recover all files.


    The output of all these commands can be seen here :




    After giving extract command it will gives the list of data extracting location , tapes needed and the location of backup directory and it will ask for confirmation


    Continue [ ?/Y/n/s/d]?


    i am showing the rest of the flow in screen shots have a look at them



    we can see from the above screenshot that amanda-backup-client debian package has been recovered .


    we can see that file below in the temp directory.


    Install and configure Amanda Backup Server

    Amanda is one of the complex installation as it has got many features and one can be easily be confused when
    installing it for first time. So i have thought of  sharing minimal installation steps to jump start your backup

    First download Server and Client packages of  amanda depending on operating system you use from below
    location

    http://www.zmanda.com/downloads/community/Amanda/

    I have taken 2 ubuntu machines 9.04

    Server -- 192.168.155.108  - amanda-backup-server_3.1.0-1Ubuntu904_i386.deb
    Client  -- 192.168.155.109 - amanda-backup-client_3.1.0-1Ubuntu904_i386.deb

    after installation just update your repository
    ------------------------------------------------------------------------------------------------
    On Server do this 
    -----------------------------------------------------------------------------------------------


    #apt-get update

    then install all build essentials required for a package to install

    #apt-get install build-essential

    afther that install debian package

    #dpkg -i  amanda-backup-server_3.1.0-1Ubuntu904_i386.deb

    I've noticed that if I try to install this package it doesn't seem to work because of missing dependent librararies typing


    #apt-get -f install

    will solve dependency problem

    After installation of that package

    User amandabackup
    group disk
     will be created.

    add password for the user amandabackup

    # passwd amandabackup

    after adding user we need to create directory where our backup has to be stored.

    # mkdir -p /data/amanda/vtape/DailySet1 
    # chown amandabackup:disk /data/amanda/vtape/DailySet1
    # chmod -R 750 /data/amanda/vtape/DailySet1



    ------------------------------------------------------------------------------------------------
    On Client do this 
    -----------------------------------------------------------------------------------------------
     Install client package same as you installed on server

    here also user amandabackup will get created

    change password for user amandabackup 

    #passwd amandabackup

    The client configuration file of amanda is

    /etc/amanda/amanda-client.conf

    Change this line:

    tapedev    "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device
    to this:

    tapedev    "file://data/amanda/vtape/DailySet1" # your tape device

    this is the location where we are taking backup.

    after configuring  go to server again.

    ------------------------------------------------------------------------------------------------
    On Server do this 
    -----------------------------------------------------------------------------------------------

    We have created a backup directory and created user amandabackup and set its password on Server
    now switch user to amandabackup

    # su – amandabackup

    then enter this command to configure server configuration file for DailySet1

    # amserverconfig DailySet1 --template harddisk --tapedev /data/amanda/vtape/DailySet1 --mailto root@localhost --dumpcycle 1week --runspercycle 5 --tapecycle 12 --runtapes 1 

    the output will be:



















    Now adding Client 192.168.155.109 on server give second command

    Explaining:
    amserverconfig : command that creates the initial Amanda configuration
    daily : the name of this backup set
    template disk : this backup is written to disk (or “virtual” tape -vtape-)
    tapedev /var/lib/amanda/vtapes/daily : this is the path of the vtapes
    mailto me@mydomain.com : Amanda emails the backup report to this address
    dumpcycle 5 : This backup cycle has 5 days (lets say ... Mon to Fri)
    runspercycle 1 : This backup runs only once per day
    tapecycle 20 : 20 vtapes (4 weeks) on the cycle
    runtapes 1 : The maximum number of tapes (in this case “vtapes”) used in a single run


    # amaddclient --config DailySet1 --client 192.168.155.109 --diskdev /data/backupme --dumptype  comp-user-tar 


    /data/backupme  is the directory on the client you want to take backup

    output will be :

























    after adding client now everything is ready we should test its working or not
    we can test it using amcheck command

    # amcheck DailySet1


    the output will be:













    Now checking is successful if you see 0 problems found in the output as shown above.
    now we are ready to take first backup with the command amdump

    # amdump DailySet1

    This command will take backup and the status is emailed to root@localhost of server as we have configured above.

    the mail will be like this :


    From amandabackup@amandaserver  Tue Jul 20 15:19:10 2010
    Return-Path:
    X-Original-To: root@localhost
    Delivered-To: root@localhost
    Received: by amandaserver (Postfix, from userid 1001)
        id 98122602ED; Tue, 20 Jul 2010 15:19:10 -0400 (EDT)
    To: root@localhost
    Subject: DailySet1 AMANDA MAIL REPORT FOR July 20, 2010
    Message-Id: <20100720191910.98122602ED@amandaserver>
    Date: Tue, 20 Jul 2010 15:19:10 -0400 (EDT)
    From: amandabackup@amandaserver (Amanda)

    Hostname: amandaserver
    Org     : DailySet1
    Config  : DailySet1
    Date    : July 20, 2010

    These dumps were to tape DailySet1-1.
    The next tape Amanda expects to use is: 1 new tape.
    The next new tape already labelled is: DailySet1-2.


    STATISTICS:
                                            Total       Full      Incr.
                                            --------   --------   --------
    Estimate Time (hrs:min)  0:00
    Run Time (hrs:min)         0:00
    Dump Time (hrs:min)      0:00       0:00       0:00
    Output Size (meg)            1.6        1.6        0.0
    Original Size (meg)          1.6        1.6        0.0
    Avg Compressed Size (%) 98.8       98.8        --
    Filesystems Dumped         1          1          0
    Avg Dump Rate (k/s)        163.1      163.1        --

    Tape Time (hrs:min)          0:00       0:00       0:00
    Tape Size (meg)                1.6        1.6        0.0
    Tape Used (%)                  0.0        0.0        0.0
    Filesystems Taped              1          1          0
    Parts Taped                        1          1          0
    Avg Tp Write Rate (k/s)    160.1      160.1        --

    USAGE BY TAPE:
      Label               Time         Size      %    Nb    Nc
      DailySet1-1         0:00           0G    0.0     1     1

    NOTES:
      planner: Adding new disk 192.168.155.109:/home/vxadmin.
      taper: tape DailySet1-1 kb 1601 fm 1 [OK]


    DUMP SUMMARY:
                                                 DUMPER STATS               TAPER STATS
    HOSTNAME     DISK        L ORIG-GB  OUT-GB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
    -------------------------- ------------------------------------- -------------
    192.168.155. -me/vxadmin 0       0       0   98.8    0:10  163.2   0:10  160.1

    (brought to you by Amanda version 3.1.0)


    So you have succesfully taken backup of your first client

    Is Virtualization the Same as Cloud Computing?




    Turning to that modern oracle, Wikipedia, is helpful. Wikipedia doesn't provide a single definition for virtualization; instead, it defines (if you can call it that) various types of virtualization, e.g. hardware virtualization, virtual memory, storage virtualization, operating system-level virtualization, etc. Clicking through to Wiktionary for "virtualization" doesn't shed any additional light. But a careful reading of Wikipedia's coverage turns up two concepts repeatedly: simulation and abstraction.

    Wikipedia does provide a definition for cloud computing: "Cloud computing is Internet-based computing, whereby shared resources, software, and information are provided to computers and other devices on demand, like the electricity grid." Not entirely adequate, but not bad.

    The fact is, virtualization and cloud computing are related but entirely different concepts. Virtualization is simulation; the request fulfillment is in terms of a simulation -- make-believe that behaves like real. Several "make-believes" can be produced from one "real" -- often without significant impact in terms of performance, and at far lesser cost, hence the attraction of virtualization. Loosely speaking, anything can be virtualized -- memory, storage, operating system services, etc. The primary objective (and hence benefit) of virtualization is to "do more with less" and save on costs.

    Cloud computing is something else entirely -- it is, literally, computing in the (Internet) cloud. Components that make up the application -- for example, application components, databases, external/real-time data feeds, etc. -- are typically dispersed across the Internet and made available in the form of services. A "cloud app" is then in effect an assembly of such cloud-based services. In turn these services may use virtualization, but that's only incidental. Internal clouds -- which are seeing in increasing prevalence -- are just that; mostly internal services, hosted internally within the organization. In that sense, internal clouds are an extension of classic SOA architecture. By "merely" dispersing these services across the internet, we begin to truly realize the benefits of SOA. Cloud computing allows us to not just "do more with less" -- it enables us to "do more," period.
    Virtualization and cloud computing make a good team, but they complement rather than supplant each other. And they are not identical.

    Important Linux Port Numbers

    21 => FTP
    22 => SSH
    23 => Telnet
    25 => SMTP Mail Transfer
    43 => WHOIS service
    53 => name server (DNS)
    80 => HTTP (Web server)
    110 => POP protocol (for email)
    995 => POP over SSL
    3306 => MysQL Server
    111 => rpcbind
    953 => rndc
    143 => IMAP Protocol (for email)
    993 => IMAP Secure
    443 => HTTP Secure 
    3128 => Squid Proxy
    3306 => MysQL Server
    3636 => Piranha
    4643 => Virtuosso Power Panel
    10000 => Webmin


    For more port numbers Click Here 
    and Click Here