Linux tips : tftpd

When you are trying to analyze/debug tftpd service on your linux boot server , you expect tftpd to return more debug information on the logs. To setup tftp in debug mode, use -v option in "server_args". As many as "-v" option you use , more debug log information you get. Try it.

service tftp
{
        disable = no
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -v -v -s /tftpboot
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

Netapp : Pocket Survival Guide

The url http://www.cs.fiu.edu/~tho01/psg/netapp.html has good information on netapp command set and its usage. A quick reference guide for a netapp admin.

The site also has tips for Solaris, Veritas, EMC, HPUX .... Good & useful one.

Netapp Tips : Changing exports

/etc/exports file controls the nfs exports on a netapp filer. An easy way to edit this file is described below.

From your unix box :
  1. rsh netapp rdfile /etc/exports > /tmp/exports
  2. vi /tmp/exports
  3. rsh netapp wrfile /etc/exports < /tmp/exports
  4. rsh netapp exportfs -a

Perl : Xen API

Xen host can be monitored and controlled via Xen API ( it uses XML-RPC communications). Here is a sample how to program using XenAPI. For XenAPI to work, you should have the below enty in /etc/xen/xend-config.sxp. You can also control which hosts can connect through API. 

-- /etc/xen/xend-config.sxp--
(xen-api-server ((9363 none)
                 (unix none)))

--
Here is a sample perl script which can query and get details from Xen host using Xen API.

x--------------------------------------------x
#!/usr/bin/perl


# Xen API Programming.
# unixfoo - http://unixfoo.blogspot.com/

use Net::Ping;
use RPC::XML;
use RPC::XML::Client;

my $xenhost = $ARGV[0];
my $user = $ARGV[1];
my $passwd = $ARGV[2];

my $xenport = 9363;

my $state = {
            "Running" => "ON",
            "Halted" => "OFF",
            "Suspended" => "SUSPENDED",
            "Paused" => "SUSPENDED",
            "Unknown" => "UNKNOWN"
            };
           

my %hash=();

# Check ping status
my $ping = Net::Ping->new();
if ( $ping->ping($xenhost,2) ne '1' )
{
    print "$xenhost is down\n";
    exit;
}
else
{
    # Establish the XEN API connection
    my $xen = RPC::XML::Client->new("http://$xenhost:$xenport");
    my $session = extractvalue($xen->simple_request("session.login_with_password",
                  $user,$passwd));
   
    if (! $session)
    {
        print "connection failure : $xenhost\n";
        exit;
    }
    my ($host_ref,$domU_ref,$hostname) = ();
   
    $host_ref = extractvalue($xen->simple_request("session.get_this_host",
                $session,$session));
   
    # Get the reference for all the VMs on the xen dom0 host.
    $domU_ref = extractvalue($xen->simple_request("host.get_resident_VMs",
                $session, $host_ref));
   
    my ($vmtype,@domUarr) = ();
   
    print "dom0 host - $xenhost\n";
    foreach (@$domU_ref)
    {
        my $vm_ref = $_;
       
        # General VM info
        my $vmrecord = extractvalue($xen->simple_request("VM.get_record",$session,$vm_ref));  
       
        if ( $vmrecord->{domid} eq 0 ) { next; };        
        my $vmname = $vmrecord->{name_label};   
        my $vmstate = $vmrecord->{power_state};
        $vmstate = $state->{$vmstate};
       
        my $xenmemmax = $vmrecord->{memory_dynamic_max};
        my $xenmemmin = $vmrecord->{memory_dynamic_min};
       
        $xenmemmax = $xenmemmax/1024/1024;
        $xenmemmin = $xenmemmin/1024/1024;
       
        if ( $vmrecord->{HVM_boot_policy} eq '' )
        {
           $vmtype = 'Para-Virt';  
        }
        else
        {
            $vmtype = 'Full-Virt';
        }
        print "$vmname - $vmstate - $xenmemmax - $xenmemmin - $vmtype\n";       
    }     
}
sub extractvalue
{
    my ($val) = @_;
    if ($val->{'Status'} eq "Success")
    {
        return $val->{'Value'};
    }
    else
    {
        return undef;
    }
}
x--------------------------------------------x

Filesystem : noatime

Most file systems store and maintain three separate time stamps per file. They are
  • create time
  • last modified time
  • last accessed time
The last accessed time stamp may have to be updated quite frequently. For example, listing the directory contents will make all the containing files to get a new last accessed time stamps - this causes additional writes and adding to the file system overhead. The filesystem mount option "noatime" can be used to disable the last accessed time stamp updates to the filesystem, resulting in reduced file system overhead. File systems with lot of small files (like file servers, home areas) will experience noticeable improvement in performance.

Netapp : disk zero spares

To clean up the spare disks and zero them, use the below command. Having a zero'd spare disks can reduce time when on volume creation or on volume reconstruction.

filer1> disk zero spares.
filer1> vol status -s

Spare disks

RAID Disk       Device  HA  SHELF BAY CHAN Pool Type  RPM  Used (MB/blks)    Phys (MB/blks)
---------       ------  ------------- ---- ---- ---- ----- --------------    --------------
Spare disks for block or zoned checksum traditional volumes or aggregates
spare           2a.37   2a    4   13  FC:A   -  FCAL 10000 68000/139264000   68444/140174232 (zeroing, 10% done)
spare           3a.56   3a    3   8   FC:A   -  FCAL 10000 68000/139264000   68552/140395088


Please note that, this command only zero's spares that are not already clean
.

Linux VLAN configuration

1. Connect the eth0 interface of your linux machine to the switch.
2. Remove the IP Address information on the eth0 interface

    # ifconfig eth0 0.0.0.0
    # ifconfig eth0 up

3. Configure 2 VLANs on the eth0 interface using vconfig as follows (100,200 are the VLAN id's).
If the 8021q.o module is not loaded, the vconfig command (when invoked first time) will automatically load the module.

    # vconfig add eth0 100
    # vconfig add eth0 200   

4. Configure IP on the VLAN interfaces

    # ifconfig eth0.100 xxx.xxx.xxx.xxx netmask 255.255.252.0 up
    # ifconfig eth0.200 yyy.yyy.yyy.yyy netmask 255.255.255.0 up

5. Preserve the vlan configuration across reboots by adding it to configuration files. Create the appropriate ifcfg files for eth0, eth0.100 and eth0.200 in /etc/sysconfig/network-scripts/

    # cd /etc/sysconfig/network-scripts/
      
    Contents of ifcfg-eth0
        DEVICE=eth0
        ONBOOT=no
        TYPE=Ethernet
   
    Contents of  ifcfg-eth0.100
        DEVICE=eth0.100
        IPADDR=xxx.xxx.xxx.xxx
        NETMASK=255.255.252.0
        VLAN=yes
        ONBOOT=yes
        BOOTPROTO=none
   
    Contents of ifcfg-eth0.200
        DEVICE=eth0.200
        IPADDR=yyy.yyy.yyy.yyy
        NETMASK=255.255.0.0
        VLAN=yes
        ONBOOT=yes
        BOOTPROTO=none
       
    Update /etc/sysconfig/network file to make the GATEWAYDEV use the public vlan interface.
   
    Contents of /etc/sysconfig/network
        NETWORKING=yes
        HOSTNAME=un1xf00
        GATEWAY=xxx.xxx.xxx.1
        DOMAINNAME=dev.un1xf00.com
        GATEWAYDEV=eth0.100
       
       
6. The VLAN configuration on the server can be verified in the file /proc/net/vlan/config. Sample contents are shown below.
   
        VLAN Dev name    | VLAN ID
        Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
        eth0.100       | 100  | eth0
        eth0.200       | 200  | eth0

TopOfBlogs

hit counter
Technology Blogs - Blog Catalog Blog Directory

  © Free Blogger Templates Columnus by Ourblogtemplates.com 2008

Back to TOP