Troubleshooting Tool for OMS Agent for Linux

February 12, 2024 ยท View on GitHub

The following document provides quick information on how to install the Troubleshooting Tool, as well as some common error codes.

Table of Contents

Troubleshooter Basics

The OMS Linux Troubleshooter is designed in order to help find and diagnose issues with the agent, as well as general health checks.

Installing the Troubleshooter

The OMS Troubleshooter is automatically installed upon installation of the OMS Agent. However, if installation fails in any way, it can also be installed manually by following the steps below.

Manual Install of the Troubleshooter

  1. Copy the troubleshooter bundle onto your machine: wget https://raw.github.com/microsoft/OMS-Agent-for-Linux/master/source/code/troubleshooter/omsagent_tst.tar.gz
  2. Unpack the bundle: tar -xzvf omsagent_tst.tar.gz
  3. Run the manual installation: sudo ./install_tst

If it installed successfully, the troubleshooter can be run using sudo /opt/microsoft/omsagent/bin/troubleshooter

Requirements

The OMS Troubleshooter requires Python 2.6+ installed on the machine, but will work with either Python2 or Python3. In addition, gdb is required to run, as well as the following Python packages:

Python PackageRequired for Python2?Required for Python3?
copyyesyes
errnoyesyes
osyesyes
platformyesyes
reyesyes
socketyesyes
sslyesyes
subprocessyesyes
urllib2yesno
urllib.requestnoyes

Scenarios Covered

  1. Agent is unhealthy, heartbeat doesn't work properly
    • Verify agent is installed / connected
    • Check if running multi-homing (multi-homing is not supported yet)
    • Verify OMSAgent is currently running
    • Start / restart OMSAgent if necessary
    • Check if OMSAgent is encountering an error in omsagent.log
  2. Agent doesn't start, can't connect to Log Analytic Services
    • Ask about error codes encountered during onboarding
    • Verify agent is installed
    • Check omsadmin.conf
    • Check internet connectivity
    • Check agent service endpoint connectivity
    • Check log analytics endpoints connectivity
    • Run queries to see if logs are flowing
  3. Agent syslog isn't working
    • Verify agent is installed / connected / healthy
    • Check if machine is running rsyslog or syslog-ng
    • Check 95-omsagent.conf for configuration errors
    • Check syslog.conf for configuration errors
    • Verify data is being sent to port
  4. Agent has high CPU / memory usage
    • Verify agent is installed / connected / healthy
    • Check if logs are rotating correctly with logrotate
    • Check if OMI is running at 100% CPU
    • Check if slab memory / dentry cache usage is erroring
  5. Agent having installation issues
    • Ask about error codes encountered during installation
    • Check OS version is supported
    • Check disk space
    • Check package manager
    • Check package installation (DSC, OMI, SCX)
    • Check OMS version
    • Check location / permissions on files
    • Check certificate and RSA key
  6. Agent custom logs aren't working
    • Ask user if running custom logs
    • Verify agent is installed / connected / healthy
    • Check if agent has pulled configuration from OMS backend
    • Check customlog.conf for configuration errors
    • Parse through custom logs for errors
  7. (A) Run all scenarios
    • Run through scenarios 1-6 in the following order: 5, 2, 1, 4, 3, 6
  8. (L) Collect logs
    • Run OMS Agent Log Collector
  9. No issues found
    • Tell customer what information to collect

List of Possible Errors

Below is a list of the errors that can be caught by the troubleshooter:

ErrorError CodeMeaning
NO_ERROR0No errors found
USER_EXIT1User requested to exit
ERR_SUDO_PERMS100Not running as root
ERR_FOUND101Errors found earlier
ERR_BITS102Couldn't get 32-bit vs 64-bit
ERR_OS_VER103Supported OS, but wrong version
ERR_OS104Unsupported OS
ERR_FINDING_OS105Couldn't figure out OS
ERR_FREE_SPACE106Not enough space on VM
ERR_PKG_MANAGER107No supported package manager (dpkg or rpm)
ERR_OMSCONFIG108OMSConfig not installed correctly
ERR_OMI109OMI not installed correctly
ERR_SCX110SCX not installed correctly
ERR_OMS_INSTALL111OMS not installed correctly
ERR_OLD_OMS_VER112OMS version is too old for troubleshooter (< 1.11)
ERR_GETTING_OMS_VER113Couldn't get most current OMS version
ERR_FILE_MISSING114Missing directory / file / link
WARN_FILE_PERMS115Wrong permissions for directory / file / link
ERR_CERT116Invalid certificate
ERR_RSA_KEY117Invalid RSA key
ERR_FILE_EMPTY118File empty
ERR_INFO_MISSING119File missing some information
ERR_ENDPT120Endpoint couldn't connect
ERR_GUID121GUID different from WSID
ERR_OMS_WONT_RUN122OMSAgent not running
ERR_OMS_STOPPED123OMSAgent stopped
ERR_OMS_DISABLED124OMSAgent disabled
ERR_FILE_ACCESS125Couldn't access file
WARN_LOG_ERRS126Error in logs
WARN_LOG_WARNS127Warning in logs
ERR_HEARTBEAT128Heartbeats failing to send data to workspace
ERR_MULTIHOMING129Running multihoming
WARN_INTERNET_CONN130Couldn't connect to internet
ERR_QUERIES131Queries failed
ERR_SYSLOG_WKSPC132Syslog collecting to wrong workspace
ERR_PT133Wrong number of '@'s in omsagent95 paths
ERR_PORT_MISMATCH134Ports don't match up
ERR_PORT_SETUP135Error with ports
ERR_SERVICE_CONTROLLER136No systemctl on machine
ERR_SYSLOG137No rsyslog or syslog-ng on machine
ERR_SERVICE_STATUS138Service erroring
ERR_CL_FILEPATH139Custom log filepath mismatch
ERR_CL_UNIQUENUM140Unique number mismatch
ERR_OMICPU141OMI high CPU script ran into error
ERR_OMICPU_HOT142OMI high CPU script shows OMI running too hot
ERR_OMICPU_NSSPEM143OMI 100% CPU bug, upgrade nss-pem to fix
ERR_OMICPU_NSSPEM_LIKE144Similar to OMI 100% CPU bug
ERR_SLAB145Slabtop issue in checking slab memory
ERR_SLAB_BLOATED146Slab memory has >300 DNE messages, no dentry
ERR_SLAB_NSSSOFTOKN147Dentry cahce issue, upgrade nss-softokn to fix
ERR_SLAB_NSS148Dentry cache issue, initialize NSS variable to fix
ERR_LOGROTATE_SIZE149Logrotate has wrong size formatting
ERR_LOGROTATE150Logrotate isn't rotating logs
WARN_LARGE_FILES151Large files growing in size
ERR_PKG152Couldn't find package
ERR_BACKEND_CONFIG153Can't pull config from backend
ERR_PYTHON_PKG154Missing Python package
WARN_INTERNET155Couldn't verify SSL connection to internet
WARN_ENDPT156Endpoint SSL connection couldn't be verified