Our Juniper STRM is running out of space after receiving more and more logs from Check Point management server and Juniper NSM. Since my STRM 500 only has about 400G storage capability and there is no other way to get budget to upgrade it to other expensive model, I decided to manually archive some older data out of this box. The steps are quite straightforward, just need to find out log folders and tar them , move them to remote ssh server.
1. Current Situation:
88% disk has been used and it is going to stop receiving the logs and flows from sources. Also reports will not be able to generated once the disk is reached certain level, about 92%.[root@strm ~]# df
Filesystem      1K-blocks    Used Available Use% Mounted on
/dev/sda2 Â Â Â Â Â Â 20323232 Â 14568560 Â 4705628 Â 76% /
/dev/sda3 Â Â Â Â Â Â 10169544 Â 1970636 Â 7673988 Â 21% /var/log
/dev/sda1 Â Â Â Â Â Â Â 108865 Â Â 30790 Â Â 72454 Â 30% /boot
tmpfs          4091188     0  4091188  0% /dev/shm
/dev/sda8 Â Â Â Â Â Â 424837936 362963724 Â 31193700 Â 92% /store
/dev/sda5 Â Â Â Â Â Â 17263128 Â Â 177164 Â 16194896 Â 2% /store/tmp
2. All log data are stored at /store/ariel/events folder:
Under /store/ariel/events folder, there are two sub directories payloads and records which stores all log data. The payloads is the raw data which is being sent to the STRM and the records are the normalized data which are stored onto the STRM after the parsing of the raw data.
[root@strm events]# ls -lIn both of payloads and records folders, the logs are stored by years and months.
total 16
drwxr-xr-x 4 root  root  4096 Jan  1 00:01 md
drwxr-xr-x 4 root  root  4096 Jan  1 00:00 payloads
drwxr-xr-x 4 root  root  4096 Jan  1 00:00 records
drwxr-xr-x 4 nobody nobody 4096 Jan  2 01:04 uncompressedCache
This is the folder size for each month of 2014 under payloads folder:
This is the folder size for each month of 2014 under records folder:
3. Â Tar the folder which you want to archive and move to remote ssh storage server:
cd /store/ariel/events/payload/2014Â
tar -zcvf /store/tmp/2014.1.payload.tar.gz 1Â
cd /store/ariel/events/records/2014Â
tar -zcvf /store/tmp/2014.1.records.tar.gz 1
du -hs 2014.1.*.tar.gz
watch du -hs 2014.1.*.tar.gz
4. SCP tar files to remote site
scp /store/tmp/2014.1.*.tar.gz [email protected]:/data/backup/juniper
5. Delete files and folders
rm -rf /store/tmp/2014.1.*.tar.gz
rm -rf /store/ariel/events/payloads/2014/1
rm -rf /store/ariel/events/records/2014/1
6. Â Verify
[root@strm tmp]# df -kÂ
Filesystem      1K-blocks    Used Available Use% Mounted onÂ
/dev/sda2 Â Â Â Â Â Â 20323232 Â 14562300 Â 4711888 Â 76% /Â
/dev/sda3 Â Â Â Â Â Â 10169544 Â 1999120 Â 7645504 Â 21% /var/logÂ
/dev/sda1 Â Â Â Â Â Â Â 108865 Â Â 30790 Â Â 72454 Â 30% /bootÂ
tmpfs          4091188     0  4091188  0% /dev/shmÂ
/dev/sda8 Â Â Â Â Â Â 424837936 329588056 Â 73669368 Â 82% /storeÂ
/dev/sda5 Â Â Â Â Â Â 17263128 Â Â 658040 Â 15714020 Â 5% /store/tmp
No comments:
Post a Comment