1 2 Previous Next 15 Replies Latest reply on Jun 12, 2012 3:04 PM by Bill Robinson

    Configuration Object Dictionary

      In the Configuration Object Dictionary, I've created a Extended Object for the Onboarding question that reads:


      "On Windows, using VB Scripts, list all of the attributes of the Page File."


      I've created a VBScript and placed it into a C:\blscripts directory to cut down on troubleshooting issues. My script name is "pagefile_info.vbs."


      I haven't been able to get the script to dump output when called from a command prompt such as:


      Microsoft (R) Windows Script Host Version 5.6
      Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.



      However, I'm pretty sure that is a different issue than the one I'm asking about here. (When I put some "msgbox" prompts in at key areas in my script, I get the results that I'm looking for, so the script seems fine. It simply isn't returning information to the command line.) My problem is, no matter what I do to point to this script in the Extended Object definition box, whenever I run the script against a Windows machine I get the following error.


      Caught exception running command - C:/blscripts/pagefile_info.vbs
      Error: CreateProcess: %1 is not a valid Win32 application.


      How can I successfully point to a prewritten VBScript within an Extended Object and have it work correctly?


      Also, while I'm in the same area, what is the actual difference between the "Remote Execution" and "Central Execution" options? Why is one beneficial to the other? When would I choose to use one over the other?


      As always, I sincerely appreciate your time and effort in helping me on this matter.

        • 1. Re: Configuration Object Dictionary

          I'm not exactly a VB Scripting Wizard, but I can tell you about Central vs. Remote execution.


          Central execution means to execute the command / script on the application server. If you are running a script, this assumes your script lives on the application server. You can do stuff like /" which means "launch the command prompt and run this command".

          • 2. Re: Configuration Object Dictionary

            Thank you for clarifying central vs remote execution. I had suspected most of that, but it's good to hear it all put out there like that.


            Your last note about putting the "CMD" in the command sounded like it might have been applicable to my situation, so I gave it a go. The "Command / Script" box now has the following typed into it:



            "CMD /C/blscripts/pagefile_info.vbs"


            Now, when I execute the Extended Object against my machine, I get a new error:



            Error occurred during Pagefile.sys Info execution. The system cannot find the specified path.

            • 3. Re: Configuration Object Dictionary

              The /C is not a path. It's a switch. I did a quick search and to execute a vbscript from the command line you need the "cscript" command. You probably want something like this:


              "cmd /C cscript c:\blscripts\pagefile_info.vbs"


              Usually the message "The system cannot find the specified path." means that your syntax is wrong.

              • 4. Re: Configuration Object Dictionary

                Ok, I'm pretty sure that I've got this issue down to solved for BladeLogic but still working on the VBScript. Here's what I have and the behavior I am now noticing.


                In the Extended Object definition page, I ended up putting this exact command in before it would work.



                cmd /C cscript c:\blscripts\pagefile_info.vbs (no quotes or it fails!)


                Another interesting thing to note is that I have to set it for "Central Execution" or, again, it fails. It fails "Remote Execution" even if I put the same script on the local machines in the same directory. Change the radio button back to "Central Execution" and everything works as it should. The exact error message that I get when I try to run as "Remote Execution" is as follows:



                Error occurred during Pagefile.sys Info extended object execution.


                I have the information I need to press forward with this project, so no further assistance is required. The information presented here is for future reference and troubleshooting as required. Thank you for your assistance!

                • 5. Re: Configuration Object Dictionary
                  Bill Robinson

                  hmm - i usually make it like;


                  cmd /c "cscript c:\foo\something"


                  local exection will run this only against the appserver, you have to use the remote execution.

                  • 6. Re: Configuration Object Dictionary

                    I still can't get this script to work under "Remote Execution." I now have the VBScript working as it should, and I can get it to report back like a champ in Local Execution. But, no matter what combination I try under Remote Execution, I get errors.


                    Under Local Execution, the following will work:


                    cmd /C cscript c:\blscripts\pagefile_info.vbs //nologo


                    If I just change it to Remote, it fails. If I put in the quotes as suggested above it fails:


                    cmd /C "cscript c:\blscripts\pagefile_info.vbs //nologo"


                    I get the error: "Error occurred during the Pagefile.sys Info extended object execution."


                    I've tried nearly every combination of quotes, no quotes, unix style directories (/c/blscripts/pagefile_info.vbs), putting nexec in front of it, etc, etc, etc.


                    What am I missing here?


                    Full contents of my script are below:


                    dim fso
                    dim f
                    Set fso = CreateObject("Scripting.FileSystemObject")
                    Set f = fso.GetFile("C:\pagefile.sys")

                    CreatedDate = f.DateCreated
                    LastAccessed = f.DateLastAccessed
                    LastModified = f.DateLastModified
                    FileSize = f.Size

                    Call returnit(CreatedDate,LastAccessed,LastModified,FileSize)

                    Function returnit(CreatedDate,LastAccessed,LastModified,FileSize)

                    returnit = "Created Date: " & CreatedDate & ", Last Accessed: " & LastAccessed & ", Last Modified: " & LastModified & ", Filesize(bytes): " & FileSize
                    WScript.Echo returnit

                    End Function


                    • 7. Re: Configuration Object Dictionary
                      Bill Robinson

                      is there anything in the appserver log when you run this?


                      also, where is the error popping up? (screenshot?)


                      and look in the agent log of the target system.


                      do you have the proper permissions on the target system to pagefile.sys ? (who is your role mapping to on the target?)

                      • 8. Re: Configuration Object Dictionary

                        Has anyone ever got scriptutil to work with a VBScript? I wonder if this is possible.


                        Have a look at the attached script. It echoes the contents of a VBScript to a temporary file on the remote host, and then calls it via nexec. You won't be able to execute this directly as an Extended Object, but it might give you some ideas for how to go about executing a remote VBScript.

                        • 9. Re: Configuration Object Dictionary
                          Bill Robinson

                          i didn't think scriptutil would work against a windows box. i've used the self-extracting nsh scripts that cut themselves up w/ the vbs script in the bottom of the script...

                          • 10. Re: Configuration Object Dictionary

                            One reason they won't work is because scriptutil requires a certain format at the top of the script using # for comments like so:


                            #! /bin/sh

                            # Check license status of server agents

                            # sys_license_status

                            # sys_license_status

                            # Check the license status of a BladeLogic server agent


                            and VBScript uses a "'" for comments.

                            • 11. Re: Configuration Object Dictionary
                              Bill Robinson

                              does scriptutil even know what to run on windows?


                              like you normally name stuff like script.SunOS or script.Linux


                              what happens for windows ?

                              • 12. Re: Configuration Object Dictionary

                                I'm guessing it's just not supported. I don't think it was written with Windows in mind.

                                • 13. Re: Configuration Object Dictionary
                                  Bill Robinson

                                  well, so i renamed one of my sensors to like foo.WindowsNT and then i tried to run it:


                                  blapp% scriptutil -s unowned_files_dirs -h blapp

                                  "C:/tmp/_blapp-2368-0-unowned_files_dirs.WindowsNT" is not a valid Win32 application.


                                  i think windows doesn't know what to do w/ it.


                                  i've tried for a while to get engineering to make scriptutil work w/ batch or vbs...no luck. maybe you can borrow mcmahon's bat.


                                  i think that runcmd might work here...

                                  • 14. Re: Configuration Object Dictionary

                                    What was the ultimate resolution to this issue?


                                    I have the exact same problem. I have a VBScript that runs perfectly when I run it directly on my servers but as an Extended Object I get the following error:


                                    Error occurred during MSSQL-Information extended object execution


                                    MSSQL-Information is the name of the extended object and the basic script is "cscript SQLVersion.vbs //nologo". I have tried just about every combination of quotes for my script that you can think of. I have tried using "cmd /C" and "nexec -e". And although the Command / Script should "Remote Execution", I have even tried running it as "Central Execution" but nothing works.


                                    Any suggestions?

                                    1 2 Previous Next