9 Replies Latest reply on Apr 18, 2019 1:58 AM by Andrew Waters

    AIX Frame Firmware

    Kamal Sharma
      Share:|

      Hi All,

      I have a customer who is asking to discover Frame Firmware and mentioned command provided by him so can any one help me to write a script or pattern for the same.

      Command : lsmcode –c

      OS : AIX

      Command output.

      Frame.jpg


       

        • 1. Re: AIX Frame Firmware
          Andrew Waters

          What did you come up with?

          • 2. Re: AIX Frame Firmware
            Kamal Sharma

            Hi Andrew,

            Currently ADDM is not discovering frame firmware version of AIX so we have to discover it and need to share the report.

            We need output as per screen shot..like

            Frame Version : EM350_85, EM350_149

            • 3. Re: AIX Frame Firmware
              Andrew Waters

              That does not answer what you have come up with - that is what you want to produce.

              • 4. Re: AIX Frame Firmware
                Kamal Sharma

                Hi Andrew,

                 

                Can we modify OOB discovery script or do we have to write a new pattern?

                • 5. Re: AIX Frame Firmware
                  Petrus Johansson

                  I would recommend you write a custom pattern that runs the lsmcode -c command and parses the information. You should create a Detail node in the pattern with the parsed information and relate the Detail node to the Host the information was obtained from.

                  • 6. Re: AIX Frame Firmware
                    Pranali Mohite

                    Hi Community Members,

                     

                    I have the same requirement so that I have created a custom pattern as follows:

                    Please suggest what modifications I have to do for getting the result as expected:

                    Firmware Version: EM350_85, EM350_149

                     

                    constants

                    cmd_aix_vio := 'lsmcode -c';

                    end constants;

                     

                    triggers

                    on host := Host created , confirmed where os_class= 'UNIX';

                    end triggers;

                     

                    body

                      

                        //-------------------------------------- BIOS Details for VIO AIX -----------------------------------------------

                        if host.os_type matches 'AIX' then

                     

                          cmd_result := discovery.runCommand(host, cmd_aix_vio);

                     

                          if cmd_result and cmd_result.result then

                     

                         host.firmware_version := cmd_result.result;

                     

                          model.addDisplayAttribute(host, "firmware_version");

                    end if;

                    end body;

                    end pattern;

                    • 7. Re: AIX Frame Firmware
                      Andrew Waters

                      You would be better served with triggering off AIX rather than all Unix machines

                      triggers

                        on host := Host created, confirmed where os_type = 'AIX';

                      end triggers

                      You could use awk to extract the details

                      body

                        cmd_result := discovery.runCommand(host,"'lsmcode -c | awk '/system firmware image is/ { print $NF; }'");

                       

                        if cmd_result then

                          host.firmware_version := text.split(cmd_result.result);

                          model.addDisplayAttribute(host, 'firmware_version');

                        end if;

                      end body;

                      May be a typo, just typed directly though it should give you the idea.

                      2 of 2 people found this helpful
                      • 8. Re: AIX Frame Firmware
                        Bob Anderson

                        Andrew did have a typo... the cmd_result line should be:

                         

                        cmd_result := discovery.runCommand(host, "lsmcode -c | awk '/system firmware image is/ { print $NF }' ");

                        (the full command is enclosed by double quotes, and the awk script is enclosed in single quotes)

                         

                        This will result in an attribute that is a list of version strings

                        If you want an attribute that is just a string, use: host.firmware_version := text.join(text.split(cmd_result.result), ', ');

                         

                        The type (list vs string) difference is important if also doing sync to the CMDB.

                         

                        I noticed the output lists both a permanant and temporary version. If you also need to differentiate between the 'temporary' and 'permanent' you will need to add code to capture that information.

                        2 of 2 people found this helpful
                        • 9. Re: AIX Frame Firmware
                          Andrew Waters

                          It does not seem great to be producing a string for the Discovery model. A list makes it obvious there are multiple values.

                          1 of 1 people found this helpful