5 Replies Latest reply on Sep 28, 2016 12:58 PM by James Donohue

    Does my Extended Object execute for every Compliance Rule in my Template?

    James Donohue

      Hi Community,

      This is more of a question on efficiency than a real issue although it can be viewed as an issue. I have a Component Template with 12 Rules that require a script to be run on each target(i.e. Extended Object). I push the script via a BLPackage and then execute it -   and then run discovery and then Compliance. The script gets 12 pieces of configuration info and formats them into NAME=VALUE grammar format which is displayed to STDOUT (to the screen).

       

      Question: When compliance runs and each rule is executed, does the script run separately? In other words, does the Extended Object script run 12 times?

       

      To be safe, I modified the script to also save the output to a txt file and run compliance against the txt file(configuration file) instead which works as well but requires that I ALWAYS have to make sure to tell my Users that they MUST run the BLPackage right before they run Compliance which can obviously be accomplished via a Batch Job but LIVE Browsing Servers may show stale value if the User decides to view the txt file from time to time. I do not want to include all 12 configuration items into 1 Compliance rule and want to keep them separated but certainly do not want to have to execute the same script 12 times on every Server that I run compliance on.

       

      Any feedback is appreciated.   

        • 1. Re: Does my Extended Object execute for every Compliance Rule in my Template?
          Bill Robinson

          why don't you have the EO defined in the Template handle itself - eg, copy and execute the script w/ scriptutil or nsh commands - and then you don't need to have a blpackage, batch job, worry about users copying stuff around, results being present on the target ?

           

          EO will be run as many times as it's listed in the parts list.

          • 2. Re: Does my Extended Object execute for every Compliance Rule in my Template?
            James Donohue

            Hi Bill, I looked into doing what you suggest and was told that the only way I would be able to accomplish that is to copy the script to one of the App Servers. Unfortunately, since this is such an enormous environment, I (and my Users) only have access to use the Console and have no ability to reference the App Server file system. So, I think that's restricts me from doing what you suggest and seems I'm only limited to using a BLPackage.

             

            The EO is only listed twice in the Parts list but as mentioned, I have 12 Rules that reference it. Based on what you stated, then I'm assuming that the EO (script) will only execute twice; is that correct?   

            • 3. Re: Does my Extended Object execute for every Compliance Rule in my Template?
              Bill Robinson

              so talk to your blade admins and get the script located on the file server or some other central location ?  if you can't or find some other central location to put the script then pushing it w/ a blpackage may be the only option.

               

              sorry - by part list i mean the 'local object' definition - i'd seen some cases where people call the same script w/ different args and have that defined as different local EOs.  as long as it's a single EO definition then it should only be called once and the rules should process the result of that single execution.

              1 of 1 people found this helpful
              • 4. Re: Does my Extended Object execute for every Compliance Rule in my Template?
                James Donohue

                I tried talking to the Admins but didn't really get a response but I can push it; thanks Bill!

                • 5. Re: Does my Extended Object execute for every Compliance Rule in my Template?
                  James Donohue

                  Hi Bill,

                  I have a way to get my Script(s) into the Sensor directory on the BL App Server and have created high level requirements but have additional challenges as listed below:

                   

                  High-Level process

                  • Header is a MUST
                  • Place script in Depot
                  • Governance will copy the script
                  • Reference the Script with Scriptutil

                   

                  We use Linux and Windows and for Windows, use PowerShell,
                  vbscript, cmd files. . . Taking this example, how would I construct the Command
                  line in the Extended Object? Right now, I’m using a script in a Component
                  Template | Local Configuration Object, as shown:

                  BL_EO.png

                   

                  1. I have to call the ps1 script using cmd.exe and
                    then echo to STDOUT; how would I engineer this within a sensor? How should the
                    Command line be syntaxed?
                  2. Can / Should I put the Header in the PowerShell?
                    Or should I create a batch file with the command line above and put the Header
                    in the bat file?
                  3. I’m just not sure how a PowerShell script (or
                    any Windows script) should be executed from a Sensor system. . .?