Thursday, January 31, 2013

A one-line HMC command to check the managed systems and its LPARs





I wrote couple of blogs about :
 Checking the LPARs in a phyiscal machines from the HMC CLI   
And Checking the connected physical machines to HMC using the CLI. 

For the sake of the simplicity and to quickly get the desired information,I found a one-command line and (my friend Sakker,the owner of www.how-2-know.com ) edited it to make it visually easier to read and understand!



hscroot@myhmc:~>for m in $(lssyscfg -r sys -F name); do echo "......................";echo "Physical Machine ===> $m";echo "--------------" ; lssyscfg -r lpar -m $m -F name:state ; done


 This command gives you the name of the Physical Machines and the name of the LPARs withing each one! 

Checking the LPARs in a phyiscal machines from the HMC CLI



After I wrote a blog about Checking the connected physical machines to HMC using the CLI , 

I wondered why I don`t guide you to get more info from the the HMC CLI and what came 1st into my mind is "checking the LPARs and its state withing a physical machine" 


let me rtemind you and tell you how to get the name.serical number and the state of the physical machine:
hscroot@myhmc:~> lssyscfg -r sys -F name:serial_num:state
amer:1234567:operating

Up till now what we got are:
-pysical machine called "amer"
-the serial umber of the machine which is 1234567 
-the state of the machine which is operating


The question now is "how many LPARs are in this machine?"!


The short answer(there is shortest answer from the HMC GUI) is to the run the following command:
 
 hscroot@myhmc:~> lssyscfg -r amer -r lpar -F name:state
lpar1:Running
lpar2:Not Activated
VIOS:Running


 Now you get a clue about the Name of the LPARs and its stat!

 


     
 

Checking the connected managed systems (physical machines) to HMC using the CLI




Sometimes and for whatever reasons you would like to know or get the name of the physical machines that are connected to your HMC.

The easy way is to check them from the HMC GUI interface! 


The geeky way is to discover them from the HMC CLI.


let`s discover  the name of the connected machines:
hscroot@myhmc:~> lssyscfg -r sys -F name:serial_num:state 
 This simple command tells you about the following:
-the name of the machines
-the serial number of the machines
-the state of the machines 


Note:the command vtmenu gives you only the name of the machines!


That command could be handy if you want to collect the serial number and the state of all your physical machine with one-command line! 




Related blogs:
 Checking the LPARs in a phyiscal machines from the HMC CLI


Monitoring and Modifing HMC file systems


Full HMC file systems cause serious problems that affect the HMC operations.Monitoring HMC file systems is an easy task,But you have to  Enabling the HMC for remote command execution!
 

Let us start by know how to  Enabling the HMC for remote command execution:
Follow this guide to accomplish this task:
 http://pic.dhe.ibm.com/infocenter/director/v6r1x/index.jsp?topic=/director.virtual_6./eica7_t_enabling_hmc_7_remote_command_execution.html


Now,you could open SSH session with your HMC.once you logged in (default user name "hscroot" and default password "abc1234"),you get restricted shell.

Although,you log int HMC with restricted shell ,you still have the ability to monitor and Modify the File systems of the HMC!



-To Monitor the file systems


#monhmc -r disk     (the default time interval is every 4 sec)



 Note: full /var file systems cause a lot of problems!

Additionally ,you can set time count to monitoring your HMC file systems :
 #monhmc -r disk  -n 10  (every 10 sec)

For the sake of completion,i have to tell you about another command to monitor and check your HMC file systems which is lshmcfs ,thie command gives you much more information!


Let`s see how we can clean up the full file systems:
 Freeing up HMC file systems (to be more specific,freeing up the logs),we simply run:
#chhmcfs -o f -d 0 
-o inidacate opration and "f" means freeing
-d meaning no. of days and zero means ALL 

NOTE: chhmcfs  frees  up  space  in Hardware Management Console (HMC) file systems. Space is freed by removing temporary HMC files that are used for HMC and managed system firmware problem analysis from the HMC hard disk.



If for any reason you want to freeing up a specific file systems or do more sophisticated tasks,then you need full access with root privilege to you HMC.To get root access ,give your IBM guy a call to give you a password based on your serial machine(valid for only 24 hours).
 This way of accessing the HMC with root is called PESH,Produce Engineering Shell.


The scope of this blog dose not cover the PESH,for more info go to the following link:
http://www-01.ibm.com/support/docview.wss?uid=nas1dba3b86d228b9b6c862570d1008009fd


Tuesday, January 15, 2013

Determining When a System Was Installed





Have you ever asked yourself when your systems was installed?!

I have a tricky command to run to get the answer:

 
# lslpp -h bos.rte

Check the following screenshot to get a clue how the output looks like:


Control AIX group





To control and manage AIX groups, we chgroup command.

Right away, I am going to give you some examples so you totally understand how to manage and control your AIX groups!

-To add ahmed and amer to the oracle group, which currently only has Mohamed as a member, type:
#chgroup users=ahmed,mahmoud,amer oracle
 


-To remove ahmed from the oracle group, type:
#chgroup users=mahmoud,amer oracle

Display group attributes





The lsgroup command displays group attributes. You can use this command to list all the system groups and their attributes or you can list all the attributes of individual groups.

1st of all, you don`t know how many groups are existing in a machine and what are the names of these groups. To get all these information ,you have to methods to use:

   1)    #lsuser ALL 


 
2)    # cat /etc/group



 
Now, you know ALL the groups on this systems and you are curious to know more information about a specific group and which users are members of this group…..etc! 

- To display the attributes of the staff group,type:
#lsuer staff


Displaying group attruibuites is an easy-job,dosn`t it?! ;-)