Closed timaw7 closed 1 month ago
Just a followup. I'm making some assumptions here, but it is erroring on returning netinfo. I was able on the first device to pull that info through the web console tab.
> netinfo
{
lo: {
0: {
mac: "00:00:00:00:00:00"
type: "ethernet"
status: "up"
address: "127.0.0.1"
family: "IPv4"
netmask: "255.0.0.0"
}
1: {
mac: "00:00:00:00:00:00"
type: "ethernet"
status: "up"
address: "::1"
family: "IPv6"
netmask: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
}
}
enp0s31f6: {
0: {
mac: "11:11:11:11:11:11"
type: "ethernet"
status: "up"
}
}
wlp1s0: {
0: {
mac: "22:22:22:22:22:22"
type: "ethernet"
status: "up"
address: "XXX.XXX.XXX.XXX"
family: "IPv4"
gateway: "XXX.XXX.XXX.XXX"
netmask: "255.255.255.0"
}
1: {
mac: "22:22:22:22:22:22"
type: "ethernet"
status: "up"
address: "fe11::"fe11:"fe11:"fe11:"fe11%3"
family: "IPv6"
netmask: "ffff:ffff:ffff:ffff::"
}
}
bridge0: {
0: {
mac: "22:22:22:22:22:22"
type: "ethernet"
status: "up"
address: ""fe11::"fe11:"fe11:"fe11:"fe11%4"
family: "IPv6"
netmask: "ffff:ffff:ffff:ffff::"
}
}
vnet0: {
0: {
mac: "22:22:22:22:22:22"
type: "ethernet"
status: "up"
address: "fe11::"fe11:"fe11:"fe11:"fe11%4"
family: "IPv6"
netmask: "ffff:ffff:ffff:ffff::"
}
}
wg0: {
0: {
status: "up"
address: "XXX.XXX.XXX.XXX"
family: "IPv4"
netmask: "255.255.255.255"
}
}
A side question here. Is it possible to pull the Node ID through the Web GUI? I'm currently using the listDevices command which is not convenient for testing.
i can replicate the issue, looking into it now for you 👍
the issue is because your nodeid will have a $
in it which isnt phased correctly at the command line
try putting nodeid with '
around instead --id 'LONGNODE$ID'
@si458 You are correct. The executed command works with '
but not "
for the nodeid. I can also confirm the not working nodeid has a $
in it whereas the devices that worked did not have the $
.
I think you've nailed this one. Any idea how to get the nodeid out of the webgui? Would just be convenient for testing.
@timaw7 the nodeid is actually part of the URl itself
https://meshcentral.myserver.com/?viewmode=10&gotonode=lupekvnEmP$6OBe0yhtXEzBl9FUAcuyF@T7fs1gIQxCDGgK4l1YBk0Ziua01TLZA
so in this example its the gotonode=
value
and to be honest after a quick check, the is actually nowhere listing the node id haha, not even in the console tab!
will add a nodeid option into the console tab, so you can type nodeid
and it will return its id for you! 👍
@si458 I see it in the URI now. Right in front of my face. Yeah at least on the console tab would be ideal.
I've confirmed that this works in a script for all my devices (over 80+). Also a side note, this fixes another issue I was having. Some device calls were not returning at all as opposed to erroring like above. This apparently fixes it all. Thanks for the help! Closing out the issue.
from what ive learn use '
on linux and "
with windows,
and IF no special characters like $ @
in the nodeid then use without both
side note: just added Node ID:
into the info
output in the console tab hehe https://github.com/Ylianst/MeshCentral/commit/e8da6a607c4a238fd49399c5f6346bb325cb7643
side note: https://github.com/Ylianst/MeshCentral/commit/7cf14a2b69f9f970959838a68628f415adae0384 ive pushed a fix to show invalid device id
if no data at all was returned
Describe the bug
I'm attempting to use meshctrls.js script to trigger API commands to the server. I've started with the deviceInfo command, but this is throwing errors on specific devices but not on others. Just to note, I've been able to modify it to work, but it is having unexpected results and requires someone more familiar with the software to take a look.
This is the thrown error on an attempted run for one device. Another functioning device is noted below.
To Reproduce Steps to reproduce the behavior:
node meshctrl.js --url wss://SERVER:443?key=KEY --loginuser "USER" --loginpass "PASSWORD" --token TOKEN deviceInfo --id "NODEID"
Expected behavior
I would expect the following result. I was able with slight modification to the script above, run the above command and produce device Info. The modifications are down below. This should eliminate any concern of authentication or errors in the parameters.
Modifications were to comment out the entire networking blocks for .netif and .netif2 lines 2836 to 2907.
Screenshots
No screenshots.
Server Software (please complete the following information):
Client Device (please complete the following information):
Remote Device (please complete the following information):
Additional context
To note, we recently upgraded a few months ago from 1.1.0 to 1.1.22 as we saw that the LTS hadn't been updated in quite awhile and decided to modernize. We had not been using meshctrl on the prior version.
Additionally, some devices appear to fail to return differing results. Another remote devices results that seem to be more detailed with no change to the command... I've also had some devices fail to return results in past testing, but haven't located a device yet as an example.
Run on modified script
Same device run on stock meshctrl.js
Provides networking and storage info.
Additionally, here is info about the meshctrl.js file. We pulled this file on Apr 26 from NPM for the install.
Top lines of file
Your config.json file