Saving Logging Messages to the Other Routing Engine

Problem

Your router has a second Routing Engine for redundancy, but the router runs fine off the primary Routing Engine and never fails over to the second one. You want to take advantage of the storage space available on the second Routing Engine's hard disk to save some of your logging messages.

Solution

Redirect the logging messages to the other Routing Engine:

	[edit system syslog]
	aviva@router1# set host other-routing-engine authorization notice

 

Discussion

If you always run your router off the primary Routing Engine ( RE0), there is likely a lot of available hard disk space on the second Routing Engine's hard disk that you can use to store system logfiles. Here we can see that there's almost nothing on RE1's hard disk (/dev/ad1s1f, mounted on /var):

	aviva@router1a> show system storage | except /dev/vn
	Filesystem Size Used Avail Capacity Mounted on
	/dev/ad0s1a 77M 37M 35M 51% /
	devfs 16K 16K 0B 100% /dev/
	mfs:172 1.5G 4.0K 1.3G 0% /tmp
	/dev/ad0s1e 12M 9.0K 11M 0% /config
	procfs 4.0K 4.0K 0B 100% /proc
	/dev/ad1s1f 17G 622M 15G 4% /var

The messages you save to RE1 are placed in the file /var/log/messages and include the string re0 after the timestamp and router name to distinguish those messages that originated from RE0 from the messages from RE1:

	Apr 29 21:39:09 router1a rshd[3811]: root@re0 as root: cmd='mv /var/db/dcd.snmp_ix+
	/var/db/dcd.snmp_ix'
	Apr 29 22:30:14 router1a login: LOGIN_INFORMATION: User aviva logged in from host
	re0 on device ttyp0
	Apr 29 22:38:08 router1a login: LOGIN_INFORMATION: User aviva logged in from host
	re0 on device ttyp0
	Apr 29 22:51:51 router1a re0 init: ntp (PID 4752) exit on SIGHUP, will be restarted
	to get the new config
	Apr 29 22:51:51 router1a re0 init: ntp (PID 4977) started
	Apr 29 22:51:51 router1a re0 xntpd[4977]: ntpd 4.1.0-a Wed Apr 27 07:11:10 GMT 2005
	(1)
	Apr 29 22:51:51 router1a re0 xntpd[4977]: kernel time discipline status 2040
	Apr 29 22:52:13 router1a rshd[3829]: root@re0 as root: cmd='rcp -T -t /var/db/dcd.
	snmp_ix+'
	Apr 29 22:51:51 router1a re0 mgd[4791]: UI_DBASE_LOGOUT_EVENT: User 'aviva' exiting
	configuration mode
	Apr 29 22:52:14 router1 rshd[3832]: root@re0 as root: cmd='mv /var/db/dcd.snmp_ix+ /
	var/db/dcd.snmp_ix'
	Apr 29 22:52:22 router1a login: LOGIN_INFORMATION: User aviva logged in from host re0
	on device ttyp0

To have RE1 send its log messages to files on RE0, you configure this in the configuration file on RE1:

	aviva@router1> request routing-engine login re1
	aviva@router1a> configure
	[edit]
	aviva@router1a# set system syslog host other-routing-engine authorization notice
	aviva@router1a# commit and-quit

Because this is the same configuration as on RE0, you can also configure both Routing Engines from RE0:

	[edit system syslog]
	aviva@router1# set host other-routing-engine authorization notice
	aviva@router1# commit synchronize

Then check for the messages on RE0:

	aviva@router1a> exit
	aviva@router1> show log messages | last
	Apr 29 22:55:16 router xntpd[4977]: kernel time discipline status change 2041
	Apr 29 22:56:47 router re1 mgd[3841]: UI_DBASE_LOGOUT_EVENT: User 'aviva' exiting
	configuration mode

 

See Also

Recipe 1.30


Router Configuration and File Management

Basic Router Security and Access Control

IPSec

SNMP

Logging

NTP

Router Interfaces

IP Routing

Routing Policy and Firewall Filters

RIP

IS-IS

OSPF

BGP

MPLS

VPNs

IP Multicast



JUNOS Cookbook
Junos Cookbook (Cookbooks (OReilly))
ISBN: 0596100140
EAN: 2147483647
Year: 2007
Pages: 290
Authors: Aviva Garrett

Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net