Home AMX User Forum AMX Technical Discussion

Check disk space in program

I promise I looked around first, but I can't find a way to check the total disk space or available disk space within a program. I'm writing timestamped files and I want to know when to erase some if diskFree/diskTotal gets too high. Thanks in advance.

Comments

  • you could telnet back into your master (from itself) and use the showmem command to get the memory usage.

  • thanks, works for me

  • John NagyJohn Nagy Posts: 1,734

    To manage log file storage, we opted for day files, named for the day part of the date, so there are always 31 of them and overwrite themselves as the month changes. 31 days of logs is plenty for our purposes and cannot possibly stress the storage. We also keep separate folders for logs on system issues versus panel issues. On shorter months, of course, you get leftover files from the prior month. You can tell by the write date AND by the log entry dates if you have the right month...

  • I keep 10 days of logs for systems that we can easily access remotely or have someone pull logs for us or 30 days for systems that are remote and we don't have easy access to. That's usually enough time to pull anything unless the user says "Oh, a few weeks ago we had a problem..." I wrote a quick and dirty date diff function and it gets called once a day when a log file is written to and all old files that are beyond the date get deleted.

  • viningvining Posts: 4,368
    edited December 2019

    There was a logging module written by Dave Hawthorne, might be in modpedia if that still exists and it kept log files for 5 days. It can easily be modified to send an email daily with the log file attached. I opted to create servers on my office master so the client masters connect directly to that daily to transfer the log file and then my master emails them so I can lay in bed and read them. Usually I can just look at the file size to see if things are normal since there are more log entries when something goes wrong so the file size is larger then normal.

    Edit:
    Part of this modules routine was a memory check

  • Just a note that the NX masters have embedded support for SysLog (labelled as the Audit Log) where anything (and more) that prints to the Diagnostics panel can be written remotely on a server. The amount of data transferred can be controlled when using the system function amx_log() based on the threshold passed into the function. Syslog communications can be secured at both the server and client with TLS. There is also a local log maintained as a backup if the remote server fails.

  • Can you enable the syslog on a remote server WITHOUT having it stored locally on the device too? I tried to log it on USB (which works) but it also logs on the device card itself (which I don't want).

    Thanks in advance.

  • You could set the retained messages to a minimum count (50) with the SET LOG COUNT command.
    Possibility of regularly purging the data through the CLEAR AUDIT LOG command too,

Sign In or Register to comment.