28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Discussion</strong><br />

This configuration redirects all logging messages to the file server 172.17.12.30. You<br />

can also specify the hostname instead of the IP address. The file server must be running<br />

a standard syslogd utility. You find the system logging messages in the /var/log/<br />

messages file on the server, unless the server has been configured to save them someplace<br />

else:<br />

aviva-server1%: tail /var/log/messages<br />

Mar 23 09:27:29 server1 /kernel: linux: syscall mmap2 is obsoleted or not implemented<br />

(pid=12624)<br />

%INTERACT-5-UI_DBASE_LOGIN_EVENT: User 'aviva' entering configuration mode<br />

Mar 23 17:48:40 router1-fxp0.mycompany mgd[4098]: %INTERACT-5-UI_COMMIT: User 'aviva'<br />

performed commit: no comment<br />

Mar 23 17:48:44 router1-fxp0.mycompany xntpd[4860]: %NTP-5: ntpd 4.0.99b Sat Mar 12<br />

07:43:39 GMT 2005 (1)<br />

Mar 23 17:48:44 router1-fxp0.mycompany xntpd[4860]: %NTP-5: using kernel phase-lock<br />

loop 2001<br />

Mar 23 17:48:44 router1-fxp0.mycompany xntpd[4860]: %NTP-5: using kernel phase-lock<br />

loop 2041<br />

Mar 23 17:48:45 router1-fxp0.mycompany mgd[4098]: %INTERACT-5-UI_DBASE_LOGOUT_EVENT:<br />

User 'aviva' exiting configuration mode<br />

The output shows both the server’s and the router’s logging messages intermixed in<br />

the logging file. You can identify the messages from the router because the field after<br />

the timestamp identifies the router by IP address and router port or, if the server can<br />

resolve the IP address, by its DNS name. The router messages in this output show<br />

router1-fxp0.mycompany. The router name is router1, and the messages were sent to<br />

the log server over port (or interface) fxp0, which is the router’s out-of-band management<br />

interface. The JUNOS software has a tendency to send logging messages out<br />

the interface with the shortest path to the syslog server. This can cause all sorts of<br />

problems, depending on how your log server and firewall filters are set up. To circumvent<br />

these problems, specifically include the interface from which to send the<br />

messages:<br />

[edit system syslog]<br />

aviva@router1# set source-address 192.168.15.42/32<br />

This command sets the messages to go out 192.168.15.42, which is the router’s loopback<br />

address. You normally use the router’s loopback address when sending system<br />

logging messages, but you can use any interface dedicated to management. With this<br />

configuration, logging messages from the router will include the resolved hostname<br />

of the IP address for lo0 (for example, lo.router1.mycompany.com) rather than showing<br />

router1-fxp0.mycompany.<br />

Sometimes you want to have more information to identify the source of the message<br />

than just the router name. You can specify a text string that is also included in the<br />

logging message:<br />

[edit system syslog]<br />

Sending Logging Messages to a Log Server | 173<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!