Thursday, November 12, 2015

Check on which global zone does the Solaris container resides

One of the major challenge of managing Oracle Solaris server is finding out where the host really resides. The system administrator can't just assume that every Solaris shell they login into is the global zone. Even more problems could arise if the administrator is new or the system just have been handed over to them.

One way to find out which the Solaris container resides is by using this long command :

find /var -type f -name 'pkginfo' 2>/dev/null |xargs grep "From: " 2>/dev/null |grep -v "From: fern"|awk -F: '{print $6}' 2>/devh/null| awk '{print$1}'|sort|uniq

Sometimes, it will give out the name of the global zone. Please note : sometimes. Not every time the global zone will be given by running the command.

If somehow the global zone does not appear, that means you just have to look elsewhere, eg. : ask the previous system administator.

Hope this helps.

No comments:

Post a Comment