Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong session times generated for remote sessions. #6893

Closed
Wolper19 opened this issue Mar 18, 2025 · 12 comments
Closed

Wrong session times generated for remote sessions. #6893

Wolper19 opened this issue Mar 18, 2025 · 12 comments
Assignees
Labels

Comments

@Wolper19
Copy link

Describe the bug
A clear and concise description of what the bug is.
User report & created/downloaded user report in .csv uses wrong calculation

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'User Events'
  2. Click on 'Reports'
  3. Scroll down to 'Create Report'
  4. Error in session length

Expected behavior
A clear and concise description of what you expected to happen.
I created a report for remote sessions/user/device group.
The displayed report shows wrong remote session length when converting these with the event list times in seconds. Also the downloaded .csv is incorrectly calculating the remote session times. Can this be corrected or is there a way to fix this myself?
Thanks and Regards,
Lutz Lorenz

Screenshots
Attachment 1 shows the remote session times that are shown on the screen after filtering them. The second attachment shows the downloaded .csv file in excel with a comparison of the session times in seconds, calculated session time and shown session time that meshcentral calculates and shows on the screen.

Server Software (please complete the following information):

  • OS: Ubuntu
  • Virtualization: direct ubuntu server installation on a vm
  • Network: LAN/WAN, reverse proxy
  • Version: 24.04.02
  • Node: 23.10.0

Client Device (please complete the following information):

  • Device: desktop
  • OS: Windows 11
  • Network: LAN
  • Browser: Firefox
  • MeshCentralRouter Version: 1.1.42

Remote Device (please complete the following information):

  • Device: desktop
  • OS: windows 11
  • Network: LAN, WIFI with installed 64-bit mesh-agent
  • Current Core Version: Mar 6 2025, 3791275116

Additional context
Add any other context about the problem here.

Your config.json file
Settings used in the config.json are added in below.

{
  "$schema": "https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json",
  "__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
  "settings": {
   "Mongodb": "mongodb://127.0.0.1:27017/meshcentral",
   "cert": "myserver.mydomain.com",
    "_WANonly": true,
    "_LANonly": true,
    "_sessionKey": "MyReallySecretPassword1",
    "port": 4430,
    "aliasPort": 443,
    "redirPort": 800,
    "redirAliasPort": 80
     "AgentPong": 300,
     "TlsOffload": "127.0.0.1"
  },

 "domains": {
    "": {
      "title": "MyServer",
      "title2": "Servername",
      "_minify": true,
      "_newAccounts": true,
      "_userNameIsEmail": true
       "certUrl": "https://10.10.10.20:443/",
    }
  },
  "_letsencrypt": {
    "__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
    "email": "[email protected]",
    "names": "myserver.mydomain.com",
    "skipChallengeVerification": false,
     "rsaKeySize": 3072,
     "production": true
  }
}

Image

Image

@Wolper19 Wolper19 added the bug label Mar 18, 2025
@Wolper19 Wolper19 changed the title Wrong session times generated for remote sessions Wrong session times generated for remote sessions. Mar 18, 2025
@si458
Copy link
Collaborator

si458 commented Mar 18, 2025

how weird? i see the same sorta thing?
need to see if either the CSV is wrong, OR the web ui is wrong?
Image
Image

EDIT:
its the web ui thats at fault,
the csv gets its data from the webui, which was retrieved in the original request for the grid in the web ui

@Wolper19
Copy link
Author

Hi Simon,

Ok thanks for the quick reply. I suppose there is nothing I could do to fix this myself?

Thanks and Regards,
Lutz Lorenz

si458 added a commit that referenced this issue Mar 18, 2025
@si458
Copy link
Collaborator

si458 commented Mar 18, 2025

Yes you can fix it urself, it was a simple spelling mistake! b34d314
fix is to change 1 single line in 2 files
then to use with non-english, you will have to sadly re-run the translate!
i can walk u through this if you want
OR
if you happy edit the default_MYLANGUAGE.handlebars file from inside translations in view with the fix too 👍

@si458 si458 closed this as completed Mar 18, 2025
@si458 si458 self-assigned this Mar 18, 2025
@Wolper19
Copy link
Author

Hi Simon,

Can you tell me how to update default_MYLANGUAGE.handlebars file from inside translations as I don‘t know where this or these reside? It sounds like a webpage update, but how can you save the changes and re-publish it?
Regards,
Lutz

@si458
Copy link
Collaborator

si458 commented Mar 18, 2025

so im guessing your install is setup in /opt/meshcentral (change folder if urs is different)
and im guessing your language is de (german based on Sitzung)

  1. edit the file /opt/meshcentral/node_modules/meshcentral/views/translations/default_de.handlebars
  2. look for the line containing var minutes = Math.floor(v / 60) & 60; im guessing around 17810
  3. change & 60; to % 60;
  4. make sure to edit /opt/meshcentral/node_modules/meshcentral/views/default.handlebars also (for english)
  5. restart meshcentral 👍

@Wolper19
Copy link
Author

Wolper19 commented Mar 18, 2025

Hi Simon,

Ok I have updated both files in /home/myhomedir/node_modules/meshcentral/views/translations/default_de.handlebars & default_uk.handlebars wth % 60;
I restarted meshcentral and yes it looks better. Though the total time from the remote session time in seconds is still off by about 20 seconds (higher) than it should be. Is that normal that the calculations are off by that much?
Thanks & Regards,
Lutz

Image

Image

@si458
Copy link
Collaborator

si458 commented Mar 18, 2025

@Wolper19 will double check that, didnt check the total only the individual values!

@si458 si458 reopened this Mar 19, 2025
@si458
Copy link
Collaborator

si458 commented Mar 22, 2025

@Wolper19 all the figures are correct here my side on my server
but that report you have isnt the same report we get out of meshcentral?
if this a custom one you have made or something?
how are you calculating the from and too to make 688 seconds for that one session?
you should just run the report and then click the DOWNLOAD blue icon
Image
Image
can you share the excel/output report at all? (email me - check my github page for address)

@Wolper19
Copy link
Author

Hi Simon,

Thanks for your reply.
I am not creating any special spreadsheet. Just like you mention I generate the report from the window you are showing (I use the last 30 days to see the connection I want) and I display the log on the screen and then I click the blue icon to the very right to download the.csv file. I open Excel (I use Excel version 2019) navigate to the Data menu at the very top, then I pick to import text/csv and there is the report. See attached.
Thanks and Regards,
Lutz

Image

Image

@si458
Copy link
Collaborator

si458 commented Mar 22, 2025

@Wolper19 i think the is a problem with your excel

https://unitconverter.io/seconds/minutes/688
688 seconds is 11 minutes 28 seconds which is correct in the web ui and the csv export
and is correctly shown in the column of your report remote log display

im not sure what function you are using for the converted from session column but i think its wrong?

edit: https://unitconverter.io/seconds/hours/3683
3683 seconds is 1 Hour, 1 Minute and 23 Seconds

@Wolper19
Copy link
Author

Hi Simon,

These the logs both meshcentral and the excel generated log showing all the sessions times taken from the actual meshcentral event log. I am not doing anything special, apart from filtering the relay logs to only show the connections I am interested in.

Regards,
Lutz

Image
Image

@si458
Copy link
Collaborator

si458 commented Mar 22, 2025

@Wolper19 the seconds is correct in the csv export,
and the web ui is being converted correctly and displayed correctly,
if excel is showing something wrong, then its excel thats wrong im afraid

@si458 si458 closed this as completed Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants