Help Center/ Application Performance Management/ FAQs/ Usage FAQs/ What Can I Do If the SSH Tunnel Process Is Abnormal?
Updated on 2022-06-20 GMT+08:00

What Can I Do If the SSH Tunnel Process Is Abnormal?

In the hybrid cloud scenario, the Secure Shell (SSH) tunnel process becomes abnormal when monitoring data is forwarded to APM through a jump server. To solve the problem, do as follows:

  1. Log in to the jump server using a remote login tool.
  2. Run the following command to configure interaction-free login:

    ssh-keygen
    cd /root/.ssh/
    cat id_rsa.pub > authorized_keys
    vi /etc/ssh/sshd_config
    Set the value of PubkeyAuthentication to yes.
    service sshd restart 

  3. Obtain the checkSsh.sh script, modify the configuration, and set the permission.

    1. Obtain the script.

      Download address: https://icagent-{region}.obs.{region}.myhuaweicloud.com/ICAgent_linux/checkSsh.sh

      The download address varies according to region. Replace {region} in the download address with the actual region.

    2. Set the permission.
      chmod +x checkSsh.sh 
    3. Execute the checkSsh.sh script.
      • In the following commands, replace {Jump server IP address}, {ELB IP address}, and {region} with the actual values.
      • If the jump server runs Ubuntu or Debian, run the sudo dpkg-reconfigure dash command and select NO before running the checkSsh.sh script.
      sh checkSsh.sh "ssh -f -N -L {Jump server IP address}:8149:{ELB IP address}:8149 -L {Jump server IP address}:8102:{ELB IP address}:8102 -L {Jump server IP address}:8923:{ELB IP address}:8923 -L {Jump server IP address}:30200:{ELB IP address}:30200 -L {Jump server IP address}:30201:{ELB IP address}:30201 -L {Jump server IP address}:80:icagent-{region}.obs.{region}.myhuaweicloud.com:80 {Jump server IP address}"

  4. Configure the crontab command and run it periodically.

    crontab -e 
    */10 * * * * /home/tools/checkSsh.sh ssh -f -N -L {Jump server IP address}:8149:{ELB IP address}:8149 -L {Jump server IP address}:8102:{ELB IP address}:8102 -L {Jump server IP address}:8923:{ELB IP address}:8923 -L {Jump server IP address}:30200:{ELB IP address}:30200 -L {Jump server IP address}:30201:{ELB IP address}:30201 -L {Jump server IP address}:80:icagent-{region}.obs.{region}.myhuaweicloud.com:80 {Jump server IP address}
    crond restart
    • In the preceding command, the /home/tools/checkSsh.sh directory is used as an example. Replace it with an actual directory.
    • 10 indicates that the command is run every 10 minutes. You can change the value as required.