ba6.us - Dave's Database Related Stuff

  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !
Home › Blogs › dmann's blog

Tag Cloud

apex Application Express Auditing data dbi development export funnies HTML Java linux monitoring oem oracle performance perl rman scripting sql SQL Developer sqlplus tuning unix windows
more tags

Search

RSS Feed

Blog Posts :

Navigation

  • Feed aggregator

User login

  • Request new password

Solaris Zones & finding machine name

dmann — Thu, 05/14/2009 - 23:34

If you use Solaris Zones sometimes it is nice to be able to know the name of the global/parent machine the zone is running on. Using 'arp -a' you can get information about network interfaces shared by the hosts on 1 machine. I'm not going to give a whole full blown script to do this as our naming standards are probably different than yours but you can see the steps you may need to follow below to get the info: Here is how to see all the network interfaces for you current host:
HOSTNAME=`hostname`
/u01/app/oracle >arp -a | grep $HOSTNAME
ce0    amr-dbzone04c.mycompany.com 255.255.255.255 SPLA     aa:01:bb:02:cc:03
The important part here is the mac address, you can extract it like this:
HOSTNAME=`hostname`
MYMAC=`arp -a | grep $HOSTNAME | awk '{print $NF}'`
echo $MYMAC
aa:01:bb:02:cc:03
Now check arp again for other hosts that share this mac address:
/u01/app/oracle/david >arp -a | grep $MYMAC
ce0    amr-dbserv04.mycompany.com  255.255.255.255 SPLA     aa:01:bb:02:cc:03
ce0    amr-dbzone04a.mycompany.com 255.255.255.255 SPLA     aa:01:bb:02:cc:03
ce0    amr-dbzone04b.mycompany.com 255.255.255.255 SPLA     aa:01:bb:02:cc:03
ce0    amr-dbzone04c.mycompany.com 255.255.255.255 SPLA     aa:01:bb:02:cc:03
ce0    amr-dbzone04d.mycompany.com 255.255.255.255 SPLA     aa:01:bb:02:cc:03
ce0    amr-dbzone04e.mycompany.com 255.255.255.255 SPLA     aa:01:bb:02:cc:03
In my environment I can use our naming standard to pick out the parent server (you may have to find a different way to do this depending on your environment):
/u01/app/oracle/david >arp -a | grep $MYMAC | grep dbserv
ce0    amr-dbserv04.mycompany.com  255.255.255.255 SPLA     aa:01:bb:02:cc:03

/u01/app/oracle/david >arp -a | grep $MYMAC | grep dbserv | awk '{print $2}'
amr-dbserv04.mycompany.com

References:

ARP and the ARP table Solaris Zones Partitioning Technology Thanks to Lawrence Z. and Jackie A. for turning me on to this information.
  • arp
  • solaris
  • zone
  • dmann's blog

Post new comment

The content of this field is kept private and will not be shown publicly.
Input format
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
8 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.


Cornify
  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !

Content Copyright 2006-2010. Links are copyright of respective owners.