Sending Log Messages to Your Screen

Problem

You log in to the router to try to track a serious problem that is currently happening, and you want to see logging messages as they are being generated.

Solution

You can use the monitor command to temporarily see logging messages as they are occurring:

	aviva@router1>  
monitor start messages
	aviva@router1>
	*** messages ***
	Apr 4 22:00:00 router1 syslogd: %SYSLOG-6: restart
	*** 'messages' has been deleted ***
	*** 'messages' has been created ***
	*** messages ***
	Apr 4 22:00:00 router1 newsyslog[4939]: logfile turned over

To see the messages for a longer period of time, you can configure the router to display them on your screen:

	[edit]
	aviva@router1# edit system syslog user aviva 
	[edit system syslog user aviva ]
	aviva@router1# set any critical 

 

Discussion

An easy way to see logging messages as they are occurring without modifying the router's configuration is to use the monitor start command. Include the name of one of the system logging files that you have already configured. This operation is similar to the Unix tail -f command.

When you are done, turn off the display:

	aviva@router1> monitor stop

If you want to see the logging messages over a longer period of time, or always want a particular person to watch logging messages when they are logged in to the router, add that information to the router's configuration. With the configuration shown above, if the user aviva is logged in to the router, she will see any critical and more serious messages on her terminal screen as soon as the router generates them:

	aviva@router1> Mar 18 11:12:30 router1 chassisd[2800]: %DAEMON-2-CHASSISD_SNMP_
	TRAP10: SNMP trap generated: redundancy switchover (jnxRedundancyContentsIndex 6,
	jnxRedundancyL1Index 2, jnxRedundancyL2Index 0, jnxRedundancyL3Index 0,
	jnxRedundancyDescr SSB 1, jnxRedundancyConfig 3, jnxRedundancyState 2,
	jnxRedundancySwitchoverCount 2, jnxRedundancySwitchoverTime 5611,
	jnxRedundancySwitchoverReason 4)

If a number of people are trying to track down a problem on the router, you can have them all receive logging messages on their screens:

	[edit system syslog]
	aviva@router1# set system syslog user * any critical

Or, if you are logged in through the console, you can see the logging messages on the console:

	[edit system syslog]
	aviva@router1# set system syslog console any critical

To turn off this logging, you need to remove or deactivate the statements in the configuration:

	[edit]
	aviva@router1# deactivate system syslog user aviva


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