Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
3.99k stars 537 forks source link

Install/Update with MeshAgent(exe) on remote devices/machines #1460

Open ghost opened 4 years ago

ghost commented 4 years ago

I was checking if MeshAgent(s) does update after updating to the latest MeshCentral release. The MeshAgent .exe version seems to be 0.2.1 in the application but the MeshAgent file version is 0.2.3 which is a bit confusing but ok.

MeshCentral version we're running now is 5.51 on Ubuntu 18.04 LTS - most of the Agents running on Windows machines/devices and RPi/Asus TB/S.

What I found is when hitting the [Install/Update] button in the Mesh Agent v2 application will result in a complete removal of the application and service. There's a work-arround though - copy the MeshAgent.exe to eg. Windows root (C:) and run it as admin.

Not sure if its urgent but at least worth mentioning because you will loose connection with the remote device!

Ylianst commented 4 years ago

The MeshAgent does auto-update when you update the server, however we have never changed the agent version number, should does create confusion. I need to start updating it or remove it completely and replace it with the hash of the exe or something.

For the "install/update" button, there is a problem where if you run the agent in the "c:\program files\mesh agent" folder and hit "install/update", the agent will uninstall and remove itself. If you run the agent at any other location it will uninstall the previous agent and copy itself into "c:\program files\mesh agent" and install correctly.

I think we should improve this behavior and detect that the agent is being run from the install folder and change the behavior.

Can you confirm this is what you see? Thanks.

ghost commented 4 years ago

Yes, I can confirm..

Ylianst commented 4 years ago

FYI. Bryan worked hard and fixed this. In the next version of MeshCentral with updated mesh agents, it should be fixed.

haxmachine commented 4 years ago

Im running meshcentral 5.58 when i try to connect to some of my endpoints i get the below image

walterzilla commented 4 years ago

Happens to me too, from time to time...cannot really spot the cause, seems to be almost random...

uldiseihenbergs commented 4 years ago

seen the same today on one machine - after agent reinstall it started working again.

walterzilla commented 4 years ago

Agent reinstalling never worked for me, sadly...

krayon007 commented 4 years ago

Agent reinstalling never worked for me, sadly...

Did you try with 0.5.51? This version has a fix for running the installer from the target location.

uldiseihenbergs commented 4 years ago

i think, i just reinstalled it with older version i have already downloaded some time ago. not sure, if agent get updated after then.

haxmachine commented 4 years ago

To get around it i duplicate the tab in chrome, disconnect on tab 1 and on the duplicate i manage to reconnect

uldiseihenbergs commented 4 years ago

Im running meshcentral 5.58 when i try to connect to some of my endpoints i get the below image

@krayon007 any news on this issue? still happens to me on some Win machines. i reverted to .56 to see if this helps... it's weird - just looked at this Win (Windows server 2012 R2) again - on MC it shows disconnected, agent uses one core at 100% and nothing happens, restarting agent process helps - host is now online, and i can connect to desktop again.

krayon007 commented 4 years ago

If you go to the console tab, does it say it was unable to connect a tunnel? If so, your browser session expired. Sometimes hitting refresh fixes it, sometimes closing the browser and reopening it fixes it.

uldiseihenbergs commented 4 years ago

huh, i don't know, but my browser with MC is always open. any other MC items opens just OK. when i see next time this message, i will look at console tab. someone else, who have this, can you log at console tab?

krayon007 commented 4 years ago

When the session is expired, existing tunnels stay connected, it's that new tunnels fail because the security token is expired.

uldiseihenbergs commented 4 years ago

but how can session be expired, if i can successfully connect to another win/linux kvm after this error?

krayon007 commented 4 years ago

If you have direct access to the machine that isn't connecting, go to the agent folder (/usr/local/mesh_services/meshagent)

and run the command: ./meshagent -state

That should give a hint as to what the agent is doing...

uldiseihenbergs commented 4 years ago

ok, can i run this command in Windows too?

krayon007 commented 4 years ago

Yes, it works on all platforms. Just omit the leading ./ for windows.

You need to run the command with elevated priveladges.

krayon007 commented 4 years ago

Ylian posted an version 0.5.66, which I believe fixes this... This issue is caused by an unescaped character in the tunnel uri, which occasionally showed up depending on what the session cookie was... Version 66 escapes the uri correctly.

uldiseihenbergs commented 4 years ago

@krayon007 as i wrote https://github.com/Ylianst/MeshCentral/issues/1498#issuecomment-645531442, it seems it works now, but i had an issue with agent after upgrade..

uldiseihenbergs commented 4 years ago

@krayon007 i just had a problem, when on MC side win agent is offline, but on Agent side service is running. i executed a state command on Win Admin command prompt, here is the result: image if i restart Agent service, everything starts working again.. meshAgent.log has no additional info. what to try next?

ghost commented 4 years ago

We're updating tonight from 5.65 - let you all know asap if there is any issue..

Updated about an half hour ago and randomly checked some remote location without any issue. Current version is 5.67 - wil check some more devices tomorrow, thx!