1 2 Previous Next 24 Replies Latest reply on Jan 21, 2011 9:26 AM by Bill Robinson

    Reporting a Server Value



      Is there a simple way to generate a job that reports value of environment variables ?  Where a snaphot will look for a specific value, I want to return all values for all servers ?  For example;


      Component Part = JAVA_HOME

      Job - Report back variable value for all servers


      Where the value returned could be any version of java on a server.  I know I could script it as an extended object, but other than a script generating an external file, even this does not give me a report with this variable on all servers.


      Essentially, I want a report on a specific extended object variable for all servers.





        • 1. Reporting a Server Value
          Bill Robinson

          The EO or a NSH script are your best options I think.  what do you mean by report?  all servers in 1 piece of output?  couldn't you snapshot the EO on all servers and then export that to a csv ?

          • 2. Reporting a Server Value

            Actually, I have tended to snapshot a single server and used that as an audit job as a baseline.  I guess i could just snapshop that property on all servers as a standalone task as you suggest.





            • 3. Reporting a Server Value

              How do you just export that hostname:value pairs ?  Exporting the 'log' doesn't give you the snap shot data in any usable format, ie;


              hostname        var1                              var2                     var3

              xxxxxxx          //c/prgram files/java       yyyyyy                 nnnnnnnnn



              Same issue with doscovery jobs, you have to select each host to find out what the action was, how do you export a list of hostname:Message




              hostname1  Valid   Created New Component

              hostname2  Valid   Keep Existing Coomponent


              etc.  This ought to be fairly straight forward.





              • 4. Reporting a Server Value
                Bill Robinson

                Can you export the snapshot, not the log forthe 1st part.


                for the 2nd, what do you need that info for?  you can possibly do this w/ the blcli.

                • 5. Re: Reporting a Server Value

                  >> Can you export the snapshot, not the log forthe 1st part.


                  I don't know, can you ?   I can export the log, how do you export the results for all hosts in the snapshop, the only way i can find to do this is to click on each server one at a time and export the results individually.


                  Also, I have started down the cli route as contingency, I have the component name from the DB Key etc.  What command in which namespace is used to retrieve a snapshot 'part' name and value ? 





                  • 6. Re: Reporting a Server Value

                    Any more info for me



                    >> for the 2nd, what do you need that info for?  you can possibly do this w/ the blcli.


                    Because some jobs do not appear to delete components that no longer meet the discovery remit, and thus the job fails as a audit ot compliance job tries to run against a component that is invalid.  The information is for me to easily see what components have been deleted / added at a glance.





                    • 7. Re: Reporting a Server Value
                      Bill Robinson

                      look at Utility exportSnapshot

                      • 8. Re: Reporting a Server Value

                        ok, great start


                        If I use


                        blcli_execute Utility exportSnapshot "/Infrastructure/Electronic Markets Infrastructure (EMI)/SnapShot" "SNP-JavaVersions" "file" "CSV"


                        I get the error

                        "Found more than one snapshot for job key: DBKey:SJobKey:172507-6 and job run id : 1208654 LONW00059854%"


                        The description of this method says "returns the latest" yet it seems it does not like there being more than 1, so  it thus returns the latest of a single snapshop Job Run  which is useless.


                        So I looked at "exportSnapshotRun" but this has similar issues.


                        #get DB key for the snapshot job

                        blcli_execute SnapshotJob getDBKeyByGroupAndName "/Infrastructure/Electronic Markets Infrastructure


                        (EMI)/SnapShot" "SNP-JavaVersions"




                        #return the job run keys
                        blcli_execute JobRun findAllRunKeysByJobKey DBKey:SJobKey:172507-6



                        blcli_execute JobRun jobRunKeyToJobRunId DBKey:SJobRunKey:1174405



                        blcli_execute JobRun jobRunKeyToJobRunId DBKey:SJobRunKey:1208041

                        >> 1208041


                        Now, if I run;

                        blcli_execute Utility exportSnapshotRun "/Infrastructure/Electronic Markets Infrastructure (EMI)/SnapShot" "SNP-JavaVersions" 1208041 "file" "CSV"


                        I get the error


                        "Found more than one snapshot for job key: DBKey:SJobKey:172507-6 and job run id : 1208041"


                        How can this be ?  There are two hosts in the snapshot run, but the point of this is I need to get a 'dump' of all host snapshot values.


                        It appears it treats each component within the job run as a separate "SnapshotRun".  So, how do I export all results in one go for a sjob run of a snapshot ?





                        • 9. Re: Reporting a Server Value
                          Bill Robinson

                          Look at the 2nd version of the exportSnapshot command that includes the template and server name as arguments.

                          • 10. Re: Reporting a Server Value

                            Ii have already, but as I have said, I want to export ALL result from a snaphop job run.  this latter version exports it for a single 'host' not all hosts within a run, ie 1000 hosts.  the first snaphot suggests it will do this, but it does not.


                            So, are you suggesting I have to iterated through, 1 by 1, each host within a snaphot job run, export each to a file, and then manually merge them ?


                            I just want


                            1) 1 snaphot job

                            2) which takes a snaphot of 1 env. variable

                            3) which runs on say 1000 servers

                            4) so a run has 1000 snaphots

                            5) and export this, as variable / value pairs in to 1 file.


                            I have tried this using the bli, but the BLI sees each snaphot WITHIN a snaphot Run as a separate snapshot.  The blcli therefore reports multiple instances but provides no API for extracting this data ??


                            ie. see image below.I have 3 RUNS, I want to export the results of the highlighted 5 hosts within the expanded snapshot run.  both of the two blcli's fail to chieve this as they result in "Found more than one snapshot for job key: DBKey:SJobKey:172507-6 and job run id : 1208654"








                            • 11. Re: Reporting a Server Value
                              Bill Robinson

                              What about ‘simplexportSnapshot’ ?  I believe one of the utility commands should do what you want w/o having to iterate over each server.  You’ll need to play w/ it a little.

                              • 12. Re: Reporting a Server Value

                                OK,  I have tried sing SimpleExportSnapshotRun as follows;


                                blcli_execute Utility simpleExportSnapshotRun "/Infrastructure/Electronic Markets Infrastructure (EMI)/Snapshot" "SNP-JavaVersions" 1226783 ver.csv "COMPUTERNAME,JAVA_HOME"


                                and it is a slight improvement.  The sample in the help indicates you add the Property Name Value as a comma list, ie "computername, java_home" as the last argument, however this returns an empty value.  If i list the property "Value1" as the argument, you get each entry per device on a separate line, and you can only use one value (as you have Name:Value pairs where Value is always Value1).  ie.


                                Property                    Value

                                Name                         ComputerName

                                Value1                        xxxxxxxxx


                                For each element in the snapshot job.


                                If i use "ComputerName" as the argument, it is left empty.  Also the report lists the hostnames at the top, and then below uses "device1", "device2" etc, why doesn't it just use the name of the asset, ie the host name ?


                                {tried to insert image but get a site unavailable error}


                                Simple Snapshot Export Version 1.0
                                Mapping: xxxxxxxx1 -> Device_3
                                Mapping: xxxxxxxx2 -> Device_2
                                Mapping: xxxxxxxx3 -> Device_1
                                Mapping: Environment Variables//JAVA_HOME -> Template_Part_2
                                Mapping: Environment Variables//COMPUTERNAME -> Template_Part_1
                                Export Results Table:
                                DeviceTypeQualified PathCOMPUTERNAMEJAVA_HOME
                                Device_1Extended Object Entry SnapshotTemplate_Part_1
                                Device_1Extended Object Entry SnapshotTemplate_Part_2
                                Device_2Extended Object Entry SnapshotTemplate_Part_1
                                Device_2Extended Object Entry SnapshotTemplate_Part_2
                                Device_3Extended Object Entry SnapshotTemplate_Part_1
                                Device_3Extended Object Entry SnapshotTemplate_Part_2





                                • 13. Re: Reporting a Server Value
                                  Bill Robinson

                                  the last 2 'properties' should be things like size,checksum or other values that would apply to that asset - i don't have the complete list handy.  i don't think they take arbitrary names.  i don't know why it does the device_1, device_2 thing - that's annoying - but you can fix that w/ some sed and awk.

                                  • 14. Re: Reporting a Server Value

                                    The values I have used are those that appear in the snapshot, so they are values that apply to that asset as part of that snapshot job.  i do not have checksum, size or other 'file' values in this job.


                                    I need to export values defined in extended objects, subsequently used in the snapshot for each asset in a snapshot hjob run.  If I can't export these the whole thing is pointless as its the results of the snapshot I am after.  ie one part of the snapshot is "JAVA_HOME" which is returned from an extended object, this is what I want to see.


                                    Sounds like the only way to do this is to export the snapshot results 1 value per asset at a time, awk/sed the deivce to hostname, and then merge the results of all exports to give me a single view.


                                    Totally crazy way to do such a simple task.  I hope BL 8.0 has better functionality for extracting data !





                                    1 2 Previous Next