What's new

Keeping traffic stats after a reboot

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Can you SSH into the router and post the output of these commands:

Code:
ps w | grep rstats
ls -l /var/lib/misc/
free
df -h
mount
 
Can you SSH into the router and post the output of these commands:

Code:
ps w | grep rstats
ls -l /var/lib/misc/
free
df -h
mount
I hope I've done this correctly. This is what happened after pasting in the above commands:

ASUSWRT-Merlin RT-AX88U 386.8_0 Sat Aug 13 20:54:16 UTC 2022
BrianAdmin@RT-AX88U:/tmp/home/root# ps w | grep rstats
1281 BrianAdm 4352 S rstats
29596 BrianAdm 5512 S grep rstats
BrianAdmin@RT-AX88U:/tmp/home/root# ls -l /var/lib/misc/
-rw-r--r-- 1 BrianAdm root 1167 Oct 25 19:04 dnsmasq.leases
BrianAdmin@RT-AX88U:/tmp/home/root# free
total used free shared buffers cached
Mem: 903544 464536 439008 3216 500 65276
-/+ buffers/cache: 398760 504784
Swap: 2097148 0 2097148
BrianAdmin@RT-AX88U:/tmp/home/root# df -h
Filesystem Size Used Available Use% Mounted on
ubi:rootfs_ubifs 69.4M 69.4M 0 100% /
devtmpfs 441.1M 0 441.1M 0% /dev
tmpfs 441.2M 760.0K 440.4M 0% /var
tmpfs 441.2M 2.2M 439.0M 0% /tmp/mnt
mtd:bootfs 5.1M 4.2M 976.0K 81% /bootfs
mtd:data 8.0M 3.2M 4.8M 40% /data
tmpfs 441.2M 2.2M 439.0M 0% /tmp/mnt
tmpfs 441.2M 2.2M 439.0M 0% /tmp
/dev/mtdblock9 63.0M 9.1M 53.9M 14% /jffs
/dev/sda1 29.3G 2.1G 25.7G 7% /tmp/mnt/SCRIPTS
tmpfs 441.2M 2.2M 439.0M 0% /www/require/modules/menuTree.js
BrianAdmin@RT-AX88U:/tmp/home/root# mount
 
That all looks fine. You missed out the output of the mount command.

Try this:
Code:
service restart_rstats

ls -l /var/lib/misc/

P.S. Post terminal output inside a CODE block for readability.
 
That all looks fine. You missed out the output of the mount command.

Try this:
Code:
service restart_rstats

ls -l /var/lib/misc/

P.S. Post terminal output inside a CODE block for readability.
I've executed each line of code one at a time. Was that the right way to do it? It doesn't seem to have solved the problem and I'm still only getting a few minutes of log data, so that's another problem.

I'm not sure what you mean in your postscript comment.

Could it be that I'm going to need to do a complete reset of my router to clear these problems?
 
I've executed each line of code one at a time. Was that the right way to do it? It doesn't seem to have solved the problem and I'm still only getting a few minutes of log data, so that's another problem.
Did the output of ls -l /var/lib/misc/ show anything different after you did service restart_rstats?

I'm not sure what you mean in your postscript comment.
Untitled.png


Could it be that I'm going to need to do a complete reset of my router to clear these problems?
It might come to that.

Post the output of the mount command.
 
After executing the two commands above, I get this:
Screenshot - 25_10_2022 , 20_43_12.jpg


and this is what I get after the mount command:
Screenshot - 25_10_2022 , 20_46_19.jpg
 
That looks like it's working now.
Well there's good news and bad news. The bad news is that after rebooting this morning, the problem remains with the traffic stats. The good news is that after disabling Skynet, the system log returned to normal, so I've uninstalled Skynet.
 
I'm going to try using a different flash drive for the traffic stats (which I'll probably format to NTFS), rather than storing them on the one I use for scripts. I have ordered a SanDisk drive from Amazon, which is supposed to be arriving by 10:00 PM today. I'll update this discussion when I have anything further to report.
 
I've just installed a SanDisk 32GB flash drive and set that to be where the traffic stats will be saved. I'll reboot the router in the morning, when no-one else is using the network and see what happens.
 
I can confirm that the traffc stats have survived a router reboot this morning. I'm not sure whether this is because they are now being saved to a different flash drive (formatted to NTFS) to the one used for scripts or whether it is because I have removed the space in the folder name. Also, the system log is working normally now.
 
It may be working now, but my thoughts went to the filesystem. IIRC (and this was a long time ago with a different model than I have now) it was important to format EXT4 with the -O no_journal option.

My thinking was that maybe the status were lost due to a journal flushing (or not) at shutdown.
 
On the syslog situation, I put Skynet back on and added four countries to ban, i.e., Russia, North Korea, China and Iran. I then checked the syslog and it was back to only showing entries for the last few minutes. I uninstalled Skynet and this morning I reinstalled it but didn't add any banned countries. The problem didn't materialise. I'll try adding those countries again but one at a time, to see if I can reproduce the problem. If I can, then I supoose I ought to start another discussion related to that issue only.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top