How to relocate device logs on juniper NSM server to a different directory

Sponsored Link
This tutorial will details the relocation of the device logs directory on the NSM server. This procedure is normally used in cases where the NSM Server has limited disk space and a network file system is available and mounted on the NSM server just for writing device logs.
Note:The device server uses /usr/netscreen/DevSvr/var/logs for writing all the device logs.

The assumption is that the /data directory on the NSM server is mounted to a NAS file system.

1. Login to the NSM Server via SSH as root user.

2. Stop all the NSM service processes (and in case of HA, stop it on both the NSM servers).

3. Rename the current logs directory as follows:

mv /usr/netscreen/DevSvr/var/logs /usr/netscreen/DevSvr/var/logs_bak

4. Become nsm user and create a soft link for the logs directory to point to /data directory as follows:

su nsm –
cd /usr/netscreen/DevSvr/var
ln -s /data logs

5. Make sure  the user nsm can write files under /data directory.

6. When the “ls -l” command is performed under /usr/netscreen/DevSvr/var, it should look as below for the soft link :

lrwxrwxrwx   1 nsm  nsm     14June  7 11:07 logs -> /data

7. Now copy all the old device logs to /data or /usr/netscreen/DevSvr/var/logs:

cd /usr/netscreen/DevSvr/var/logs_bak
cp -rpf * /usr/netscreen/DevSvr/var/logs/.

8. Once the copy is complete, verify that all files have nsm ownership.

9. Now start all the NSM processes. Login to the GUI client to make sure logs are visible and new logs are showing up.

10. Perform the same procedure on the secondary NSM server as well.

11. Once it is confirmed that servers are showing new and old logs,  then delete the old logs directory “/usr/netscreen/DevSvr/var/logs_bak” on both NSM Servers.

12. Start processes on the secondary server in case of HA.

Sponsored Link

Leave a comment

Your email address will not be published. Required fields are marked *