December 2006
Intermediate to advanced
1188 pages
72h 8m
English
You want to test the configuration of your syslog server to ensure that the log messages are stored in their correct location.
The Bourne shell script in Example 18-2 emulates syslog messages at various severity levels to ensure that your server routes them to the correct location. By default, the script will emulate syslog messages to the local7 syslog facility, since Cisco routers default to local7, but the logging facility is completely configurable. No arguments are required or expected.
Example 18-2. testlog.sh
#!/bin/sh # # testlog.sh -- a script to test the syslog facility to ensure that # messages, at various levels, are being forwarded # to the correct file(s) # # Set Behavior FACILITY=local7 LOGGER="/usr/bin/logger" # $LOGGER -p $FACILITY.emerg "This meassage was sent to $FACILITY.emerg (0)" $LOGGER -p $FACILITY.alert "This meassage was sent to $FACILITY.alert (1)" $LOGGER -p $FACILITY.crit "This meassage was sent to $FACILITY.crit (2)" $LOGGER -p $FACILITY.err "This meassage was sent to $FACILITY.err (3)" $LOGGER -p $FACILITY.warning "This meassage was sent to $FACILITY.warning (4)" $LOGGER -p $FACILITY.notice "This meassage was sent to $FACILITY.notice (5)" $LOGGER -p $FACILITY.info "This meassage was sent to $FACILITY.info (6)" $LOGGER -p $FACILITY.debug "This meassage was sent to $FACILITY.debug (7)"
This script is designed to test the syslog server configuration to ensure that router log messages forward ...
Read now
Unlock full access