8 Replies Latest reply on May 28, 2012 4:01 AM by Stocktrader

    LANDesk remote control goes to "Gateway mode" after update SP3 agent

    Apprentice

      I had agents SP2 and after update SP3 agents the LANDesk remote control goes to "Gateway mode" (please see the picture), we can not remote the computer when it is in "Gateway mode". If I do click in "Switch mode" it changes to "Direct mode", it is that we want but after restart de computer it changes to "Gateway mode" again.

       

      I went to see the services (start->run->services), I found "LANDesk remote control service" and I changed the properties of "Startup type" to "Automatic (delayed start)"  then I restart the services and it fix the problem but I cannot do this for all our computers.

       

      Since we are updating to SP3 agent I would like to know if you guys have any clue about it. What do I need to modify in my agents. It happen in differents computer models.

       

      None of my agents use "Mirror Driver"

       

      Thank you in advance.

        • 1. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
          Employee

          Hello,

           

          as far as I know in LD9 SP3 a mechanism to autoswitch in gateway mode was introduced.

          It works in this way: when the remote control service starts it tries to contact the core server, if the core server is reachable then goes in direct mode, if it is not reachable goes in Gateway mode.

          The problem is that on some computer that are slow to boot the service starts before that the network is ready and so goes to the wrong mode.

          You can fix the issue in these ways:

          • Set the delayed start in the service as you already did: unfortunately the delayed start does not exists in XP.
          • Make the remote control service depending on another service that you know starts when the network is ready.
          • Write a script that restarts the remote control service some a couple of minutes after you log in on the machine.

           

          The first 2 solutions are scriptable and you can deploy on your machines safely.

          The third one is a bit more complex but I have a good news: I already written the script, it works on every Windows supported platform and if you are insterested in it I can share it with you.

           

          Kind regards,

          StockTrader

          • 2. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
            zman Master

            ST,

             

            I would post it here in this thread or in an article. I'm somewhat puzzled as to why LANDesk chose using the service as a determining factor. My concerns are that as we have been seeing on the community is that there are issues with this approach. Especially with certain VPN and other configurations (e.g.wireless configurations). Considering that service on most systems never restart (except if restarted manually, or rebooted), the gateway mode will never change after a restart?  I could however, not understand how it works, and there may be more to this, but it seems to be a very limited approach. Coates and I wrote our own auto gateway scripts, and I have mine still running in SP3 (I was hoping to remove it). I think if LANDesk continues with the service controlling this feature, they should consider:

            1. Local Scheduled task that runs with IP change to re-evaluate the state of the internal/external status. This works well in my script.
            2. Could also use /toe=logon to check the status.
            3. Configurable hosts to determine status. I use three sources in my script incase the core is down.  Yeah if the core is down can't do much, but did not want it flipping back and forth and we have multiple cores.
            • 3. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
              Employee

              Hello Archi,

               

              due to poplar demand ( ) I'm going to share with everyone on this forum the solution that I've developed. It's not rocket science but works.

              The solution comes in two scrips:

              • RCRestartConf.batthat detects if the Remote Control Service is installed and if yes configures the LANDesk Local Scheduler to execute the second script
              • RestartRC.bat that restarts the LANDesk Remote Control Service

              So to deploy this solution you will need to create a Batch Package with RCRestartConf.bat as primary file and RestartRC.bat as additional file.

               

              This is the RCRestartConf.bat script

               

              @ECHO OFF
              REM This script installs the RestartRC.bat script in the LDCLIENT directory and schedule the execution of it 
              REM using the LANDesk Local Scheduler at the logon time
              REM Script created by Marco S. Zuppone for LANDesk Software. [email protected]
              REM The script is given AS IS without any implied or express warranties.
              REM
              REM Let's check if this computer has the Remote Control part of the agent
              REM Error 1060 means that the service does not exists.
              SC QUERY ISSUSER | FIND "1060"
              REM The FIND command is not elegant but needed to ensure that this script is going to work on XP, VISTA and Windows 7
              REM It is mysterious but on Windows 7 the SC QUERY command valorizes the ERRORLEVEL, in XP not!
              IF %ERRORLEVEL% EQU 0 GOTO SERVICENOTFOUND
              REM Now let verify that going one level back from the LDMS_LOCAL_DIR points us to the LDCLIENT directory 
              IF NOT EXIST "%LDMS_LOCAL_DIR%\..\localsch.exe" GOTO NOGOODVARIABLE
              REM Now let verify that the additional file that need to be added to the scheduled task has been downloaded in the current directory and ready to be transferred to LDCLIENT
              IF NOT EXIST RestartRC.bat GOTO FILENOTFOUND
              COPY /Y RestartRC.bat "%LDMS_LOCAL_DIR%\..\"
              "%LDMS_LOCAL_DIR%\..\localsch.exe" /exe="%LDMS_LOCAL_DIR%\..\RestartRC.bat" /toe="logon" /autodelay="2|3" /taskid=9090
              REM LocalSch.exe will return as exit code the task id so we need to zero it...
              IF %ERRORLEVEL% EQU 9090 EXIT /B 0
              EXIT /B
              :NOGOODVARIABLE
              EXIT /B 9999
              :FILENOTFOUND
              EXIT /B 8888
              :SERVICENOTFOUND
              EXIT /B 1060
              

               

              And this one is the RestartRC.bat script that is very simple:

               

              @ECHO OFF
              REM This script restarts the LANDesk Remote Control Service.
              REM Script created by Marco S. Zuppone for LANDesk Software. [email protected]
              REM The script is given AS IS without any implied or express warranties.
              SC STOP ISSUSER
              SC START ISSUSER
              

               

              The first script has (normally) four possible return codes that you may want to map using the return code mapping feature of LANDesk

              • 9999: Something is wrong with the agent configuration on the machine because the script was not able to find the environment variable LDMS_LOCAL_DIR that is always defined, at least with LD 9.0 agents
              • 8888: The file RCRestart.bat was not found. This may happen if you forget to add it as additional file when you deploy the package
              • 1060: The LANDesk Remote Control Service is not found on that machine
              • 0:        OK..All went fine

               

              FAQ

              Q: Why do you use two scripts instead of one?

              A: Because both the command NET and SC of Microsoft lacks of the RESTART parameter to restart services. They have only Start and Stop (and maybe PAUSE).  So I need to schedule another one that does the ''dirty'' job.

               

              Q:Why do you use 9090 as Task ID?

              A:You can use the number that you want ABOVE 1000 but it important to use an univoque task id just in case you execute this script more than once to avoid to add to the scheduler more than one entry.

               

              Q: Is this script supported?

              A: No. It is given AS IS. Test it please before to deploy it.

               

              Kind regards,

              StockTrader

               

              Message was edited by: Stocktrader - The file names of the scripts are now correct!

               

              Message was edited by: Stocktrader - Attachment added with the two scripts plus an example query to target the machines where the job is not in the Local Scheduler yet

              • 4. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
                jabramson Apprentice

                I am curious about a couple of things. First, can you add to your script that if there is a problem with the remote control service to attempt to restart it? Also, if the service doesn't exist then how about calling a condition to reinstall the agent?

                 

                One thing I have been doing for this is to run a daily query of devices reporting and gateway mode and not only calling a restart of the service but to also rewrite the registry to change the key from gateway mode to LAN mode. I hadn't tried just restarting the service.

                • 5. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
                  Apprentice

                  I notice that I have in my core server a "management gateway configuration" (see picture)

                  In this window I see that I have a device set up, but looks like is shut down, because I cannot do ping to the internal IP. I will talk with our LAN administrator about it.

                  I will check that first. Also maybe we don’t need to use that so I will remove it.

                   

                  Also there is a document about taking “Management Gateway” out.

                  http://community.landesk.com/support/docs/DOC-1888

                   

                  Thank you.

                   

                  I will let you know what happen.

                  • 6. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
                    jabramson Apprentice

                    One other possibility like Archi said is to change the start of the issuser to delayed. This could also be done with a task that executes a batch file with the command:

                    sc config issuser start= delayed-auto

                     

                    Although if the agent is installed or updated, it would need to be run again. Seems if LANDesk made this auto-gateway feature and installed the issuser service as delayed start, that would resolve the issue.

                    • 7. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
                      Employee

                      Hello jabramson,

                       

                      for sure setting the service to ''delayed start' is a good idea as well but unfortunately this feature is not available on Windows XP.

                      The good news is that XP is going in end-of-life soon but we still have customer using XP and some Windows 2000 as well!

                      Regards,

                      StockTrader

                      • 8. Re: LANDesk remote control goes to "Gateway mode" after update SP3 agent
                        Employee

                        Hello jabramson,

                         

                        thanks for your comments about the script.

                        I may try to add a more solid mechanism to handle to restart of the service (time permitting).

                        About the other suggestion to reinstall the agent if the remote control service is not a good idea to implement that in the script because running WSCFG32.EXE to re-install the agent will uninstall the agent and then reinstall so the communication with the core is lost during the installation so the status of what is going on is uncertain.

                        I prefer to send back a specific exit code as I'm doing now so that the administrator can decide what to do if the scrip finds out that the remote control agent is not there.

                        Thanks for the feedback and regards,

                        StockTrader