Managing Logs

I have approximately 610 devices I’m currently monitoring in my environment, and I noticed the the /logs are currently eating up a large amount of space around 153 Gig.!

Filesystem Size Used Avail Use% Mounted on
/dev/sda3 347G 199G 131G 61% /

Trying to keep the system healthy going forward, and wanted to know the best practice for removing old log files.

If the logs that eats your disk are in this format `librenms-YYYY-MM-DD.log

Run php artisan cache:clear and remove those files.

Dont worry, its safe to remove them.

The correct ones are librenms.log(-YYYYMMDD) and daily.log(-YYYYMMDD)

1 Like

[root@NMS librenms]# ls -liah ./logs
total 153G
17302879 drwxrwxr-x+ 2 librenms librenms 4.0K Feb 23 00:00 .
17181146 drwxr-xr-x. 31 librenms librenms 4.0K Feb 23 09:50 …
17301507 -rw-rw-r–. 1 librenms librenms 71K Feb 23 09:17 daily.log
17301509 -rw-rw-r–. 1 librenms librenms 5.0K Jan 26 00:17 daily.log-20190126.gz
17301512 -rw-rw-r–. 1 librenms librenms 689 Jan 27 00:17 daily.log-20190127.gz
17301515 -rw-rw-r–. 1 librenms librenms 996 Feb 3 00:16 daily.log-20190203.gz
17301522 -rw-rw-r–. 1 librenms librenms 1.1K Feb 10 00:16 daily.log-20190210.gz
17301506 -rw-rw-r–. 1 librenms librenms 59K Feb 17 00:17 daily.log-20190217
17301514 -rw-rw-r–. 1 librenms librenms 71 Feb 7 00:15 .gitignore
17301523 -rw-rw-r–. 1 librenms librenms 0 Feb 17 03:41 librenms-2019-02-13.log
17301517 -rw-rw-r–. 1 librenms librenms 14G Feb 13 23:59 librenms-2019-02-13.log-20190217
17301524 -rw-rw-r–. 1 librenms librenms 0 Feb 17 03:41 librenms-2019-02-14.log
17301518 -rw-rw-r–. 1 librenms librenms 15G Feb 14 23:59 librenms-2019-02-14.log-20190217
17301525 -rw-rw-r–. 1 librenms librenms 0 Feb 17 03:41 librenms-2019-02-15.log
17301519 -rw-rw-r–. 1 librenms librenms 15G Feb 15 23:59 librenms-2019-02-15.log-20190217
17301526 -rw-rw-r–. 1 librenms librenms 0 Feb 17 03:41 librenms-2019-02-16.log
17301520 -rw-rw-r–. 1 librenms librenms 15G Feb 16 23:59 librenms-2019-02-16.log-20190217
17301521 -rw-rw-r–. 1 librenms librenms 15G Feb 18 00:00 librenms-2019-02-17.log
17301528 -rw-rw-r–. 1 librenms librenms 15G Feb 18 23:59 librenms-2019-02-18.log
17301529 -rw-rw-r–. 1 librenms librenms 15G Feb 19 23:59 librenms-2019-02-19.log
17301530 -rw-rw-r–. 1 librenms librenms 16G Feb 20 23:59 librenms-2019-02-20.log
17301531 -rw-rw-r–. 1 librenms librenms 17G Feb 22 00:00 librenms-2019-02-21.log
17301532 -rw-rw-r–. 1 librenms librenms 16G Feb 23 00:00 librenms-2019-02-22.log
17301533 -rw-rw-r–. 1 librenms librenms 6.3G Feb 23 09:03 librenms-2019-02-23.log
17301508 -rw-rw-r–. 1 librenms librenms 80M Feb 23 09:50 librenms.log
17301510 -rwxrwxr–. 1 librenms librenms 66M Jan 26 03:48 librenms.log-20190126.gz
17301513 -rw-rw-r–. 1 librenms librenms 1.2M Jan 27 03:17 librenms.log-20190127.gz
17301516 -rw-rw-r–. 1 librenms librenms 8.6M Feb 3 03:20 librenms.log-20190203.gz
17301527 -rw-rw-r–. 1 librenms librenms 8.6M Feb 10 03:37 librenms.log-20190210.gz
17301511 -rw-rw-r–. 1 librenms librenms 81M Feb 17 03:41 librenms.log-20190217

As I said, remove all the librenms-YYYY-MM-DD ones

As I said, remove all the librenms-YYYY-MM-DD ones

Thanks for the verification I appreciate it.