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
4.28k stars 573 forks source link

Implement AddDevice to meshctrl #6473

Closed lschnetl closed 4 weeks ago

lschnetl commented 1 month ago

Is your feature request related to a problem? Please describe. It seems that we can mostly use the meshctrl application to do most tasks that you would normally do, except to add devices. I don't want to manually add devices every time we have a new one, so it would be great if we can add a device using meshctrl.

Currently you can view, edit and delete devices, but not add

Describe the solution you'd like It would be great if we can add a device using meshctrl. Something like node node_modules/meshcentral/meshctrl.js AddDevice --name <name> --hostname <hostname> --user <admin> --password <password> --tls

Describe alternatives you've considered So far I have tried to import hosts using the import json function, but it constantly creates duplicates if I don't make sure to remove existing hosts

Additional context N/A

si458 commented 1 month ago

are you talking about adding devices to the Local devices, no agent or the Intel® AMT only, no agent groups?

you cant add devices into the meshagent group as thats the meshagents appliction job haha

lschnetl commented 1 month ago

Intel® AMT only, no agent (don't want to add agents or rely on host os)

si458 commented 1 month ago

thats ok just wanted to clarify as you are indeed correct, you cant add devices using the meshctrl.js ! will add it to my to-do list!

lschnetl commented 1 month ago

Awesome! Thank you for the quick feedback!

si458 commented 4 weeks ago

all done! https://github.com/Ylianst/MeshCentral/commit/141bec559fb291a0f361826d3000851a118e08cb

you need to patch the server side aswell as the meshctrl.js otherwise the meshctrl.js will just hang with no reply

but plz dont forget to donate ❤️ https://www.si458.co.uk/2024/01/05/donation/

EDIT:

simon@testmc:~/meshcentral/MeshCentral$ node meshctrl.js help AddLocalDevice
Add a Local Device, Example usages:

  MeshCtrl AddLocalDevice --id 'meshid' --devicename 'devicename' --hostname 'hostname'
  MeshCtrl AddLocalDevice --id 'meshid' --devicename 'devicename' --hostname 'hostname' --type 6

Required arguments:

  --id '[meshid]'              - The mesh identifier.
  --devicename '[devicename]'  - The device name.
  --hostname '[hostname]'      - The devices hostname or ip address.

Optional arguments:

  --type [TypeNumber] - With the following choices:
    type 4            - Default, Windows (RDP)
    type 6            - Linux (SSH/SCP/VNC)
    type 29           - macOS (SSH/SCP/VNC)

simon@testmc:~/meshcentral/MeshCentral$ node meshctrl.js help AddAmtDevice
Add an Intel AMT Device, Example usages:

  MeshCtrl AddAmtDevice --id 'meshid' --devicename 'devicename' --hostname 'hostname --user 'admin' --pass 'admin'
  MeshCtrl AddAmtDevice --id 'meshid' --devicename 'devicename' --hostname 'hostname --user 'admin' --pass 'admin' --notls

Required arguments:

  --id '[meshid]'              - The mesh identifier.
  --devicename '[devicename]'  - The device name.
  --hostname '[hostname]'      - The devices hostname or ip address.
  --user '[user]'              - The devices AMT username.
  --pass '[pass]'              - The devices AMT password.

Optional arguments:

  --notls                      - Use No TLS Security.

simon@testmc:~/meshcentral/MeshCentral$