2217 lines
62 KiB
HTML
Raw Normal View History

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="A remote monitoring and management tool">
<meta name="author" content="Ylianst">
<link rel="canonical" href="https://ylianst.github.io/MeshCentral/meshcentral/debugging/">
<link rel="prev" href="../codesigning/">
<link rel="next" href="../devicetabs/">
<link rel="icon" href="../../images/favicon.ico">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.49">
<title>Debugging - MeshCentral Documentation</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.6f8fc17f.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../../stylesheets/extra.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="white" data-md-color-accent="indigo">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#websockets-video" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="MeshCentral Documentation" class="md-header__button md-logo" aria-label="MeshCentral Documentation" data-md-component="logo">
<img src="../../images/favicon.ico" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
MeshCentral Documentation
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Debugging
</span>
</div>
</div>
</div>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/Ylianst/MeshCentral" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
Ylianst/MeshCentral
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href="../.." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item">
<a href="../../install/" class="md-tabs__link">
Install
</a>
</li>
<li class="md-tabs__item md-tabs__item--active">
<a href="../" class="md-tabs__link">
MeshCentral2
</a>
</li>
<li class="md-tabs__item">
<a href="../../design/" class="md-tabs__link">
Design and Architecture
</a>
</li>
<li class="md-tabs__item">
<a href="../../meshcmd/" class="md-tabs__link">
MeshCmd
</a>
</li>
<li class="md-tabs__item">
<a href="../../meshctrl/" class="md-tabs__link">
MeshCtrl
</a>
</li>
<li class="md-tabs__item">
<a href="../../meshrouter/" class="md-tabs__link">
Mesh Router
</a>
</li>
<li class="md-tabs__item">
<a href="../../intelamt/" class="md-tabs__link">
Intel AMT
</a>
</li>
<li class="md-tabs__item">
<a href="../../how-to-contribute/" class="md-tabs__link">
How to Contribute
</a>
</li>
<li class="md-tabs__item">
<a href="../../other/adfs_sso_guide/" class="md-tabs__link">
Other
</a>
</li>
</ul>
</div>
</nav>
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="MeshCentral Documentation" class="md-nav__button md-logo" aria-label="MeshCentral Documentation" data-md-component="logo">
<img src="../../images/favicon.ico" alt="logo">
</a>
MeshCentral Documentation
</label>
<div class="md-nav__source">
<a href="https://github.com/Ylianst/MeshCentral" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
Ylianst/MeshCentral
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Install
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Install
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../install/" class="md-nav__link">
<span class="md-ellipsis">
Quick Start Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../install/install2/" class="md-nav__link">
<span class="md-ellipsis">
Full Install Guide
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
<span class="md-ellipsis">
MeshCentral2
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
MeshCentral2
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral2 Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../config/" class="md-nav__link">
<span class="md-ellipsis">
All Configuration Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../agents/" class="md-nav__link">
<span class="md-ellipsis">
Agent Information
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../assistant/" class="md-nav__link">
<span class="md-ellipsis">
Assistant
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../codesigning/" class="md-nav__link">
<span class="md-ellipsis">
Code Signing
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Debugging
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Debugging
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#websockets-video" class="md-nav__link">
<span class="md-ellipsis">
Websockets Video
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#meshcentral-server" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Server
</span>
</a>
<nav class="md-nav" aria-label="MeshCentral Server">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#useful-configjs-settings" class="md-nav__link">
<span class="md-ellipsis">
Useful config.js settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#understanding-node-and-paths" class="md-nav__link">
<span class="md-ellipsis">
Understanding node and paths
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#unable-to-update-server" class="md-nav__link">
<span class="md-ellipsis">
Unable to update server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#port-troubleshooting-on-server" class="md-nav__link">
<span class="md-ellipsis">
Port Troubleshooting on server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#running-meshcentral-server-in-debug-mode" class="md-nav__link">
<span class="md-ellipsis">
Running Meshcentral server in debug mode
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#enabling-trace-in-your-browser-dev-tools" class="md-nav__link">
<span class="md-ellipsis">
Enabling trace in your browser Dev Tools
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#finding-agent-problems" class="md-nav__link">
<span class="md-ellipsis">
Finding agent problems
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#logging-it-all" class="md-nav__link">
<span class="md-ellipsis">
Logging it all
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#restricting-server-to-specific-ips" class="md-nav__link">
<span class="md-ellipsis">
Restricting server to specific IP(s)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#finding-system-id-types" class="md-nav__link">
<span class="md-ellipsis">
Finding system ID types
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pull-down-cert-crt-file-from-internet" class="md-nav__link">
<span class="md-ellipsis">
Pull down cert .crt file from internet
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#meshagent" class="md-nav__link">
<span class="md-ellipsis">
MeshAgent
</span>
</a>
<nav class="md-nav" aria-label="MeshAgent">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#agent-debug-logs-to-server" class="md-nav__link">
<span class="md-ellipsis">
Agent Debug Logs to server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#determine-agent-capabilities" class="md-nav__link">
<span class="md-ellipsis">
Determine Agent capabilities
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#useful-meshagentmsh-flags" class="md-nav__link">
<span class="md-ellipsis">
Useful MeshAgent.msh flags
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#obtain-generated-msh-file" class="md-nav__link">
<span class="md-ellipsis">
Obtain generated .msh File
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#meshagent-commands" class="md-nav__link">
<span class="md-ellipsis">
MeshAgent Commands
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#on-the-fly-patching-meshagent" class="md-nav__link">
<span class="md-ellipsis">
On the fly Patching MeshAgent
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#agent-debugging-using-meshcore-js-debugger" class="md-nav__link">
<span class="md-ellipsis">
Agent Debugging using MeshCore JS Debugger
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#troubleshooting-agent-connectivity" class="md-nav__link">
<span class="md-ellipsis">
Troubleshooting Agent connectivity
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#intel-amt" class="md-nav__link">
<span class="md-ellipsis">
Intel AMT
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../devicetabs/" class="md-nav__link">
<span class="md-ellipsis">
Device Tabs
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../plugins/" class="md-nav__link">
<span class="md-ellipsis">
Plugins
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../SSLnletsencrypt/" class="md-nav__link">
<span class="md-ellipsis">
SSL
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../security/" class="md-nav__link">
<span class="md-ellipsis">
Security
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../tokens/" class="md-nav__link">
<span class="md-ellipsis">
Tokens
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../tipsntricks/" class="md-nav__link">
<span class="md-ellipsis">
Tips n Tricks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../messaging/" class="md-nav__link">
<span class="md-ellipsis">
Messaging
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../customization/" class="md-nav__link">
<span class="md-ellipsis">
Customization
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../openidConnectStrategy/" class="md-nav__link">
<span class="md-ellipsis">
openidConnectStrategy
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
<span class="md-ellipsis">
Design and Architecture
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Design and Architecture
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../design/" class="md-nav__link">
<span class="md-ellipsis">
Design and Architecture
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
MeshCmd
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
MeshCmd
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../meshcmd/" class="md-nav__link">
<span class="md-ellipsis">
MeshCmd
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
<span class="md-ellipsis">
MeshCtrl
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
MeshCtrl
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../meshctrl/" class="md-nav__link">
<span class="md-ellipsis">
MeshCtrl
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Mesh Router
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Mesh Router
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../meshrouter/" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Router
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Intel AMT
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Intel AMT
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../intelamt/" class="md-nav__link">
<span class="md-ellipsis">
Intel AMT
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_9" >
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
<span class="md-ellipsis">
How to Contribute
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
How to Contribute
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../how-to-contribute/" class="md-nav__link">
<span class="md-ellipsis">
Contribute to MeshCentral
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_10" >
<label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
<span class="md-ellipsis">
Other
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_10">
<span class="md-nav__icon md-icon"></span>
Other
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../other/adfs_sso_guide/" class="md-nav__link">
<span class="md-ellipsis">
ADFS SSO Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../other/meshcentral_satellite/" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Satellite
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#websockets-video" class="md-nav__link">
<span class="md-ellipsis">
Websockets Video
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#meshcentral-server" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Server
</span>
</a>
<nav class="md-nav" aria-label="MeshCentral Server">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#useful-configjs-settings" class="md-nav__link">
<span class="md-ellipsis">
Useful config.js settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#understanding-node-and-paths" class="md-nav__link">
<span class="md-ellipsis">
Understanding node and paths
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#unable-to-update-server" class="md-nav__link">
<span class="md-ellipsis">
Unable to update server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#port-troubleshooting-on-server" class="md-nav__link">
<span class="md-ellipsis">
Port Troubleshooting on server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#running-meshcentral-server-in-debug-mode" class="md-nav__link">
<span class="md-ellipsis">
Running Meshcentral server in debug mode
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#enabling-trace-in-your-browser-dev-tools" class="md-nav__link">
<span class="md-ellipsis">
Enabling trace in your browser Dev Tools
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#finding-agent-problems" class="md-nav__link">
<span class="md-ellipsis">
Finding agent problems
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#logging-it-all" class="md-nav__link">
<span class="md-ellipsis">
Logging it all
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#restricting-server-to-specific-ips" class="md-nav__link">
<span class="md-ellipsis">
Restricting server to specific IP(s)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#finding-system-id-types" class="md-nav__link">
<span class="md-ellipsis">
Finding system ID types
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pull-down-cert-crt-file-from-internet" class="md-nav__link">
<span class="md-ellipsis">
Pull down cert .crt file from internet
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#meshagent" class="md-nav__link">
<span class="md-ellipsis">
MeshAgent
</span>
</a>
<nav class="md-nav" aria-label="MeshAgent">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#agent-debug-logs-to-server" class="md-nav__link">
<span class="md-ellipsis">
Agent Debug Logs to server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#determine-agent-capabilities" class="md-nav__link">
<span class="md-ellipsis">
Determine Agent capabilities
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#useful-meshagentmsh-flags" class="md-nav__link">
<span class="md-ellipsis">
Useful MeshAgent.msh flags
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#obtain-generated-msh-file" class="md-nav__link">
<span class="md-ellipsis">
Obtain generated .msh File
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#meshagent-commands" class="md-nav__link">
<span class="md-ellipsis">
MeshAgent Commands
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#on-the-fly-patching-meshagent" class="md-nav__link">
<span class="md-ellipsis">
On the fly Patching MeshAgent
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#agent-debugging-using-meshcore-js-debugger" class="md-nav__link">
<span class="md-ellipsis">
Agent Debugging using MeshCore JS Debugger
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#troubleshooting-agent-connectivity" class="md-nav__link">
<span class="md-ellipsis">
Troubleshooting Agent connectivity
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#intel-amt" class="md-nav__link">
<span class="md-ellipsis">
Intel AMT
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1>Debugging</h1>
<h2 id="websockets-video">Websockets Video<a class="headerlink" href="#websockets-video" title="Permanent link">&para;</a></h2>
<p>Make sure you understand how MeshCentral works with your browser using chrome developer tools.</p>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/3vI4URd3VzU" frameborder="0" allowfullscreen></iframe>
</div>
<h2 id="meshcentral-server">MeshCentral Server<a class="headerlink" href="#meshcentral-server" title="Permanent link">&para;</a></h2>
<h3 id="useful-configjs-settings">Useful config.js settings<a class="headerlink" href="#useful-configjs-settings" title="Permanent link">&para;</a></h3>
<p><a href="https://github.com/Ylianst/MeshCentral/blob/master/meshcentral-config-schema.json">https://github.com/Ylianst/MeshCentral/blob/master/meshcentral-config-schema.json</a></p>
<div class="highlight"><pre><span></span><code><span class="nt">&quot;AgentsInRAM&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
<span class="nt">&quot;AgentUpdateBlockSize&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">2048</span><span class="p">,</span>
<span class="nt">&quot;agentUpdateSystem&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
<span class="nt">&quot;noAgentUpdate&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
<span class="nt">&quot;WsCompression&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
<span class="nt">&quot;AgentWsCompression&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
</code></pre></div>
<h3 id="understanding-node-and-paths">Understanding node and paths<a class="headerlink" href="#understanding-node-and-paths" title="Permanent link">&para;</a></h3>
<p>Note that when running MeshCentral, you should always run from the path that is parent to node_modules, so you do this:</p>
<div class="highlight"><pre><span></span><code>cd C:\Program Files\Open Source\MeshCentral
node node_modules\meshcentral
</code></pre></div>
<p>You do NOT do this:</p>
<div class="highlight"><pre><span></span><code>cd C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral
node meshcentral
</code></pre></div>
<p>The problem with the second command is that NPM may install missing modules in the incorrect location.</p>
<p>Also, in general I recommend not using the MeshCentral MSI Installer and just install manually unless you are very scared of the command prompt. Anyone that knows a bit about the shell should install MeshCentral like this:</p>
<div class="highlight"><pre><span></span><code>mkdir c:\meshcentral
cd c:\meshcentral
npm install meshcentral
node node_modules\meshcentral
(ctrl-c when done installing optional modules)
node node_modules\meshcentral --install
</code></pre></div>
<p>This way, you have a lot more control over what is going on. In my opinion, the MSI installer basically does the same thing and installs NodeJS for you.</p>
<h3 id="unable-to-update-server">Unable to update server<a class="headerlink" href="#unable-to-update-server" title="Permanent link">&para;</a></h3>
<p>Generally the problem is that MeshCentral can't find the npm tool and therefore, can't run it to see if there is a new version. You can fix this by setting the path to npm in the config.json like this:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;npmPath&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;c:\\npm.exe&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;npmProxy&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;http://1.2.3.4:80&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>The problem could also be that you need a proxy, the configuration line to that is above.</p>
<p>You can also manually update. Just stop your server and so this:</p>
<div class="highlight"><pre><span></span><code>mv<span class="w"> </span>node_modules<span class="w"> </span>node_modules_bak
npm<span class="w"> </span>install<span class="w"> </span>meshcentral
node<span class="w"> </span>node_modules/meshcentral
</code></pre></div>
<p>Then wait for all optional modules to install, then once the server starts hit ctrl-c and start up the server again. You can also use the following to help you start/stop the server:</p>
<div class="highlight"><pre><span></span><code>node<span class="w"> </span>node_modules/meshcentral<span class="w"> </span>--install
node<span class="w"> </span>node_modules/meshcentral<span class="w"> </span>--uninstall
node<span class="w"> </span>node_modules/meshcentral<span class="w"> </span>--start
node<span class="w"> </span>node_modules/meshcentral<span class="w"> </span>--stop
</code></pre></div>
<h3 id="port-troubleshooting-on-server">Port Troubleshooting on server<a class="headerlink" href="#port-troubleshooting-on-server" title="Permanent link">&para;</a></h3>
<p>If you're getting a <code>port 4433 is not available</code> error, this is because another process is using this port, very likely another instance of MeshCentral. If your MeshCentral server is bound to ports 81/444 MeshCentral could not get port 80/443 and got the next available ones.</p>
<p>In general the problem is that you are running two MeshCentral instances at the same time. Probably one as a background Windows Service and one in the command line. Which ever instance can grab port 4433 will have a running MPS and CIRA should work, but the second instance will not have port 4433 and CIRA will not work.</p>
<h3 id="running-meshcentral-server-in-debug-mode">Running Meshcentral server in debug mode<a class="headerlink" href="#running-meshcentral-server-in-debug-mode" title="Permanent link">&para;</a></h3>
<p>Debug more will cause MeshCentral to output a lot of debug messages to the console. To display all debug messages, run MeshCentral like this:</p>
<div class="highlight"><pre><span></span><code>node<span class="w"> </span>node_modules/meshcentral<span class="w"> </span>--debug
</code></pre></div>
<p>A more practical way to run the debug command it to specify what messages you want printed out using a comma seperated list, for example:</p>
<div class="highlight"><pre><span></span><code>node<span class="w"> </span>node_modules/meshcentral<span class="w"> </span>--debug<span class="w"> </span>web,amt,mps
</code></pre></div>
<p>Here is the list of all debug options:</p>
<div class="highlight"><pre><span></span><code>cookie - Cookie encoder
dispatch - Message Dispatcher
main - Main Server Messages
peer - MeshCentral Server Peering
agent - MeshAgent traffic
agentupdate - MeshAgent update
cert - Server Certificate
db - Server Database
email - Email/SMS/Push Traffic
web - Web Server
webrequest - Web Server Requests
relay - Web Socket Relay
httpheaders - Web Server HTTP Headers
authlog - User Authentication Log
amt - Intel AMT
webrelay - Connection Relay
mps - CIRA Server
mpscmd - CIRA Server Commands
</code></pre></div>
<p>You can also specify the <code>debug</code> option in the config.json file in the <code>settings</code> section. For example:</p>
<div class="highlight"><pre><span></span><code>&quot;settings&quot;: {
&quot;debug&quot;: &quot;web,amt,mps&quot;
}
</code></pre></div>
<h3 id="enabling-trace-in-your-browser-dev-tools">Enabling trace in your browser Dev Tools<a class="headerlink" href="#enabling-trace-in-your-browser-dev-tools" title="Permanent link">&para;</a></h3>
<p>You can enable browser console tracing by adding <code>trace=1</code> as a parameter to the URL of the MeshCentral main web page. For example <code>https://myserver.com/?trace=1</code>. Once present, open the browser's console window to see all web client tracing messages.</p>
<p>To log all database queries, change log_statement in /etc/postgresql/13/main/postgresql.conf</p>
<div class="highlight"><pre><span></span><code># CUSTOM
log_statement = &#39;all&#39; # none, ddl, mod, all
</code></pre></div>
<p>The stacktrace was logged to <code>stdout/journalctl</code>. Supposedly, you can enable debug logging for node modules by adding <code>DEBUG=&lt;modulename&gt;</code> to the environment. </p>
<p>Adding this to <code>/etc/systemd/system/meshcentral.service</code> should do it but it didn't seem to do anything. </p>
<p>I think that's because Mesh uses the trace logging in the browser instead of logging things in the server logs. </p>
<div class="highlight"><pre><span></span><code>Environment=DEBUG=mesh*
</code></pre></div>
<p>If you want to change node to meshcentral in journalctl, add this to /etc/systemd/system/meshcentral.service.</p>
<div class="highlight"><pre><span></span><code>SyslogIdentifier=meshcentral
</code></pre></div>
<h3 id="finding-agent-problems">Finding agent problems<a class="headerlink" href="#finding-agent-problems" title="Permanent link">&para;</a></h3>
<p>Using the servers <code>My Server &gt; console</code></p>
<ul>
<li><code>agentstatus</code> - Gives you summary counts of problems</li>
<li><code>agentissues</code> - Gives IP:port and what error</li>
<li><code>dupagents</code> - Gives duplicateAgent IP's, counts and names</li>
</ul>
<h3 id="logging-it-all">Logging it all<a class="headerlink" href="#logging-it-all" title="Permanent link">&para;</a></h3>
<p>To log everything that's possible, prepare the log directory.</p>
<div class="highlight"><pre><span></span><code>mkdir /meshcentral/meshcentral-logs/
chown tactical:tactical logs
ln -s ../meshcentral-logs/log.txt /meshcentral/meshcentral-data/log.txt
</code></pre></div>
<p>And then add this to your config.</p>
<div class="highlight"><pre><span></span><code><span class="w"> </span><span class="nt">&quot;meshErrorLogPath&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;/meshcentral/meshcentral-logs/&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;authLog&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;/meshcentral/meshcentral-logs/auth.log&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;log&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
<span class="w"> </span><span class="s2">&quot;cookie&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;dispatch&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;main&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;peer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;web&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;webrequest&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;relay&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;webrelaydata&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;webrelay&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;mps&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;mpscmd&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;swarm&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;swarmcmd&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;agentupdate&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;agent&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;cert&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;db&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;email&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;amt&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;httpheaders&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;websocket&quot;</span>
<span class="w"> </span><span class="p">],</span>
</code></pre></div>
<p>You'll then have 3 files:</p>
<div class="highlight"><pre><span></span><code>-rw-rw-r--<span class="w"> </span><span class="m">1</span><span class="w"> </span>tactical<span class="w"> </span>tactical<span class="w"> </span><span class="m">2593</span><span class="w"> </span>Feb<span class="w"> </span><span class="m">2</span><span class="w"> </span><span class="m">12</span>:22<span class="w"> </span>auth.log
-rw-r--r--<span class="w"> </span><span class="m">1</span><span class="w"> </span>tactical<span class="w"> </span>tactical<span class="w"> </span><span class="m">147593</span><span class="w"> </span>Feb<span class="w"> </span><span class="m">2</span><span class="w"> </span><span class="m">12</span>:31<span class="w"> </span>log.txt
-rw-rw-r--<span class="w"> </span><span class="m">1</span><span class="w"> </span>tactical<span class="w"> </span>tactical<span class="w"> </span><span class="m">381</span><span class="w"> </span>Feb<span class="w"> </span><span class="m">2</span><span class="w"> </span><span class="m">12</span>:02<span class="w"> </span>mesherrors.txt
</code></pre></div>
<p><code>log.txt</code> will now log everything in the Trace tab</p>
<h3 id="restricting-server-to-specific-ips">Restricting server to specific IP(s)<a class="headerlink" href="#restricting-server-to-specific-ips" title="Permanent link">&para;</a></h3>
<p>When doing debugging on my development server, I use this line in the settings section to block all agent connections except the agent I want:</p>
<div class="highlight"><pre><span></span><code>&quot;agentAllowedIp&quot;: [ &quot;192.168.2.147&quot; ],
</code></pre></div>
<p>Of course, this is just for debugging.</p>
<h3 id="finding-system-id-types">Finding system ID types<a class="headerlink" href="#finding-system-id-types" title="Permanent link">&para;</a></h3>
<p><a href="https://serverurl/meshagents">https://serverurl/meshagents</a> aka trying figure out what this is</p>
<p><img alt="ID" src="../images/determine-id.png" /></p>
<h3 id="pull-down-cert-crt-file-from-internet">Pull down cert .crt file from internet<a class="headerlink" href="#pull-down-cert-crt-file-from-internet" title="Permanent link">&para;</a></h3>
<p><a href="https://github.com/Ylianst/MeshCentral/issues/1662#issuecomment-666559391">See #1662</a> We have run into this challenge before, where our .crt file expired and then all our agents were unable to connect. In our case, the TLS cert was available on the internet, and thus, we were able to use these commands to update it:</p>
<div class="highlight"><pre><span></span><code><span class="nb">echo</span><span class="w"> </span>-n<span class="w"> </span><span class="se">\|</span><span class="w"> </span>openssl<span class="w"> </span>s_client<span class="w"> </span>-connect<span class="w"> </span>yourdomain.com:443<span class="w"> </span><span class="m">2</span>&gt;<span class="w"> </span>/dev/null<span class="se">\|</span><span class="w"> </span>sed<span class="w"> </span>-ne<span class="w"> </span><span class="s1">&#39;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p&#39;</span><span class="w"> </span>&gt;<span class="w"> </span>/opt/meshcentral/meshcentral-data/webserver-cert-public.crt
service<span class="w"> </span>meshcentral<span class="w"> </span>restart
</code></pre></div>
<h2 id="meshagent">MeshAgent<a class="headerlink" href="#meshagent" title="Permanent link">&para;</a></h2>
<p>Troubleshooting agent</p>
<div class="highlight"><pre><span></span><code>./meshagent<span class="w"> </span>-state
</code></pre></div>
<h3 id="agent-debug-logs-to-server">Agent Debug Logs to server<a class="headerlink" href="#agent-debug-logs-to-server" title="Permanent link">&para;</a></h3>
<p>This automatically downloads all agent error logs into <code>meshcentral-data/agenterrorlogs.txt</code></p>
<p><a href="https://github.com/Ylianst/MeshCentral/blob/aa58afcc3a5d738177ab7a7b6d0228d72af82b85/meshcentral-config-schema.json#L100">Set</a> in <code>config.json</code></p>
<div class="highlight"><pre><span></span><code><span class="nt">&quot;agentLogDump&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
</code></pre></div>
<h3 id="determine-agent-capabilities">Determine Agent capabilities<a class="headerlink" href="#determine-agent-capabilities" title="Permanent link">&para;</a></h3>
<p>On the server goto the agents console tab. Type:</p>
<div class="highlight"><pre><span></span><code>info
</code></pre></div>
<h3 id="useful-meshagentmsh-flags">Useful MeshAgent.msh flags<a class="headerlink" href="#useful-meshagentmsh-flags" title="Permanent link">&para;</a></h3>
<p><a href="https://github.com/Ylianst/MeshAgent/blob/master/meshcore/agentcore.h#L190">https://github.com/Ylianst/MeshAgent/blob/master/meshcore/agentcore.h#L190</a></p>
<div class="highlight"><pre><span></span><code><span class="err">co</span><span class="kc">ntr</span><span class="err">olCha</span><span class="kc">nnel</span><span class="err">Debug=</span><span class="mi">1</span>
<span class="err">logUpda</span><span class="kc">te</span><span class="err">=</span><span class="mi">1</span>
</code></pre></div>
<h3 id="obtain-generated-msh-file">Obtain generated .msh File<a class="headerlink" href="#obtain-generated-msh-file" title="Permanent link">&para;</a></h3>
<p>If you need a trick to get the .msh file, you can add ?debug=1 to the URL and click "Add Agent", there will be an extra link to download it.</p>
<h3 id="meshagent-commands">MeshAgent Commands<a class="headerlink" href="#meshagent-commands" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>MeshAgent run
MeshAgent dbTool.js list
</code></pre></div>
<p>Forcing Core version from Cmdline</p>
<ul>
<li>Download meschore.js and rename to CoreModule.js and put it alongside MeshAgent.exe</li>
<li>Stop MeshAgent service</li>
<li>Run <code>MeshAgent.exe dbTool.js import CoreModule</code></li>
</ul>
<h3 id="on-the-fly-patching-meshagent">On the fly Patching MeshAgent<a class="headerlink" href="#on-the-fly-patching-meshagent" title="Permanent link">&para;</a></h3>
<p><a href="https://github.com/Ylianst/MeshAgent/issues/89#issuecomment-949901720">MeshAgent#89 (comment)</a></p>
<p>There are two ways to do this... When debugging, and making changes, you can modify the .js file directly, and just save it in the same folder as the agent binary... The agent will use the .js file from disc if it's there, if it's newer than the one compiled in the binary. You don't even need to restart the agent. You can just clear the core, and reload the core.....</p>
<p>When you are satisfied with your changes to the .js file, you can use the clipboard, in the following fashion:</p>
<div class="highlight"><pre><span></span><code>meshagent<span class="w"> </span>-exec<span class="w"> </span><span class="s2">&quot;require(&#39;clipboard&#39;).nativeAddCompressedModule(&#39;foo&#39;);process.exit();&quot;</span>
</code></pre></div>
<p>if the file you modified isn't in the same folder as the agent binary, you can use the following command if you don't want to move the file, and edit it directly in the modules folder:</p>
<div class="highlight"><pre><span></span><code>meshagent<span class="w"> </span>-exec<span class="w"> </span><span class="s2">&quot;setModulePath(&#39;pathToFolder&#39;);require(&#39;clipboard&#39;).nativeAddCompressedModule(&#39;foo&#39;);process.exit();&quot;</span>
</code></pre></div>
<p>This command is just like the previous, except it searches for modules in the path specified.</p>
<p>Just substitute foo, with the name of the module that you modified. It will load the module from disc, compress it, and save it into the clipboard.. So you can just load up your editor for ILibDuktape_Polyfills.c, and find where that particular module is defined... and paste directly from the clipboard... The clipboard will contain all the necessary C code to uncompress and load the module.</p>
<p>If the compressed result is relatively long, it will auto break it up into multiple lines to work around an issue with visual studio's maximum string literal limitations.</p>
<h3 id="agent-debugging-using-meshcore-js-debugger">Agent Debugging using MeshCore JS Debugger<a class="headerlink" href="#agent-debugging-using-meshcore-js-debugger" title="Permanent link">&para;</a></h3>
<p><a href="https://github.com/Ylianst/MeshAgent/issues/119">(#119)</a> How to test changes to the meshagent and recompile them.</p>
<ul>
<li>Copy duktape-debugger.js to the mesh directory on the target machine.</li>
<li>From the console tab of the agent, enter this command, substituting the port number you want to use instead of 9999
<code>eval "attachDebugger({ webport: 9999 })"</code></li>
</ul>
<p>Then open your browser to http://localhost:9999 or whatever port you used.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you pause the debugger, and happen to forget about it, the agent will automatically kill itself and restart because it will think that a thread is stuck. Default debugger timeout is 10 minutes, you may find a log entry saved to disk saying "Microstack Thread STUCK", or something similar.</p>
</div>
<h3 id="troubleshooting-agent-connectivity">Troubleshooting Agent connectivity<a class="headerlink" href="#troubleshooting-agent-connectivity" title="Permanent link">&para;</a></h3>
<p>If an agent keeps disconnecting and reconnecting, add this line to the "settings" section of the config.json:</p>
<div class="highlight"><pre><span></span><code>&quot;agentping&quot;: 30
</code></pre></div>
<p>This will cause MeshCentral to "ping" the agent every 30 seconds and the agent to respond with a "pong" each time. That usually solves the issue however, it does generate more traffic. If that works, you can remove the line and try this line instead:</p>
<div class="highlight"><pre><span></span><code>&quot;agentpong&quot;: 30
</code></pre></div>
<p>This will cause MeshCentral to "pong" the agent every 30 seconds, the agent will not respond. This usually fixes the issue, but you have half the traffic. I would also increase the time like:</p>
<div class="highlight"><pre><span></span><code>&quot;agentpong&quot;: 90
</code></pre></div>
<p>This is the best, you have one way traffic to all agents every 90 seconds. The larger the number you can get away with the better.</p>
<p>If you ever get the same problem but on the browser side, you can also use one of these:</p>
<div class="highlight"><pre><span></span><code>&quot;browserping&quot;: 30
&quot;browserpong&quot;: 30
</code></pre></div>
<p>Same idea, browser side instead of agent side.</p>
<h2 id="intel-amt">Intel AMT<a class="headerlink" href="#intel-amt" title="Permanent link">&para;</a></h2>
<p>To debug issues, confirm that Intel AMT is active and there MeshCentral is not showing any red errors on the "Intel AMT" line:</p>
<p><img alt="" src="../images/amt_troubleshoot1.png" /></p>
<p>Next, you can go in the "My Server / Trace" tab and enable tracing on the "Intel AMT Manager" like this:</p>
<p><img alt="" src="../images/amt_troubleshoot2.png" /></p>
<p>You can then open another tab and select to power off or power on Intel AMT, you should see "performPowerAction" with 2 or 8 depending on power on/off.</p>
<p><img alt="" src="../images/amt_troubleshoot3.png" /></p>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.tabs", "navigation.expand", "navigation.top", "navigation.instant"], "search": "../../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.88dd0f4e.min.js"></script>
</body>
</html>