6 Replies Latest reply on Mar 31, 2013 2:38 AM by Siddu angadi

    NSH command to get Machine Serial Number

    Esam Eid

      Hi All,

       

      any one knows how can i get the SN of any AIX, SOLARIS, ...etc  using the nsh command.

       

      from the agentinfo we can get the hostid, but i need the serial number

       

      regards,

      Esam

        • 1. Re: NSH command to get Machine Serial Number

          One way will be :

           

          to execute vendor api through nsh scripts , to get such information.

           

          eg. for HP the vendor api "hpasmcli" will be of help

          • 2. Re: NSH command to get Machine Serial Number
            Steffen Kreis

            Hi,

             

            How would you query the SN in the default Shell ? As I know it is not always possible especially in Solaris.

             

            Once you have that you could execute  it via nexec from your NSH session.

            • 3. Re: NSH command to get Machine Serial Number
              Siddu angadi

              Hi Esam,

               

              For AIX, you can use "prtconf" in conjuction with nexec command in NSH.

               

              as Steffen said it is very difficult to get serial number from sun.

               

              You could try using Sneep, I was used on our SUN systems to enter the serial number data.

               

              And I aslo I used some command line in BMC ADDM to get serial number from certain solaris versions, probably I will find that command and post here.

               

              Thanks

              Siddu

              1 of 1 people found this helpful
              • 4. Re: NSH command to get Machine Serial Number
                Bill Robinson

                if this shows up under the hardware info i believe you can use the blcli Get command to pull out the data.

                • 5. Re: NSH command to get Machine Serial Number
                  Jim Wilson

                  Hi Esam,

                   

                  Did this get resolved?

                  If so, please can you update the discussion thread with details so that is can be marked as answered.

                   

                  Thanks & Regards,

                  Jim (Forum Manager/Facilitator)

                  • 6. Re: NSH command to get Machine Serial Number
                    Siddu angadi

                    Below is the BMC ADDM command I used to discover the Fujitsu solaris server serial id:

                     

                    Actaul command is:  /opt/FJSVmadm/sbin/serialid -a

                     

                    =================================

                     

                    body

                                          model_check := regex.extract (host.model, regex 'PRIMEPOWER(\d+)', raw '\1')

                                        if model_check.result matches regex '450' or '650' or '850' then

                                                            Serial_No := discovery.runCommand(host, "/opt/FJSVmadm/sbin/serialid -a");

                     

                                                  elif model_check.result matches regex '1500' then

                                                            Serial_No := discovery.runCommand(host, "/opt/FJSVcsl/bin/serialid -m");

                     

                                        end if;

                     

                                                  host.vendor := regex.extract (host.model, regex 'Fujitsu');

                                                  host.serial := regex.extract (Serial_No, regex '\d+');

                     

                     

                      end body;

                     

                     

                     

                     

                     

                     

                     

                    ######################################