guy labs guy labs

Configure a static IP in Ubuntu 13.04

Linux
/by
    Today we want to configure Ubuntu to use a static IP address instead of a dynamic one (from a DHCP server). 1. To do this we first need to switch from the default dhcp mode to the static mode. Open up the /etc/network/interfaces file and remove everything and add the following: Ok lets go through the properties we set here: The first two lines configure the loopback interface. These are default and shouldn't be touched, unless you have a specific purpose. The next two lines configure the eth0, the default wire connected interface. As you see it configures this it as static interface. The properties we set till the dns properties should be self-explanatory. The last the properties are about the DNS server. If you have a locally installed one you can configure it here with the dns-search and the dns-domain property. If you don't have one you can use the ones from Google, namely 8.8.8.8,8.8.4.4 Save the file and exit the editor. 2. Ok now we need to delete the old config which generates the resolv.conf file and we need to remove the DHCP client. Please execute the following commands: 3. Ok no it's time to restart the network interface with the following command: This command executes the two packed command in order, such that we don't get disconnected while executing a ifdown and then we can't start it with the ifup. (In case you are connected via SSH) You can check the result by opening the nohup.out file in the folder where you ran the previous command. 4. Now we...

Monitor S.M.A.R.T. with smartmontools in Ubuntu 13.04

Linux
/by
    Today we want to install and configure smartmontools to monitor the S.M.A.R.T. attributes. Additionally we want to be notified by email if a warning or an error occurred. Install and check hard drives Ok let's start by installing smartmontools with the following command: After that we want to check the hard drives with the following command: Replace the /dev/sda with the hard drive you want to check. If smartctl doesn't succeed you need to add the type of the hard drive interface to the command. To do this add the -d {TYPE} argument to the previous command and subsitute the {TYPE} with ata, scsi or sat (for sata). This command outputs some information about your hard drive. Next we want to enable additional features by executing the following command: This enables the S.M.A.R.T. support (-s on), the offline data collection (-o on) and the autosave of device vendor-specific attributes (-S on). You will find more information about the arguments in the man pages of smartctl. After that we can check the overall health of the hard drive by executing the following command: If the test result isn't PASSED you should backup your data now and exchange the hard drive. We also want to check if your hard drive supports the self checks. To do this execute the following command: Now check the ouput where it says "Offline data collection capabilities" and one of the values should be "Self-test supported". Then your hard drive supports the self tests. What you also see in the output is how long the short...