1828722 Members
2338 Online
109984 Solutions
New Discussion

Creating new log files

 
Sprint Unix Team
Frequent Advisor

Creating new log files

I need send logs from Cisco and Brocade switches on to a log files..say cisco.log in a unix server.

How do i create this??
4 REPLIES 4
Kenny Chau
Trusted Contributor

Re: Creating new log files

Hi,

This is what I am using to get information from Cisco Routers:

#!/bin/sh
{
for i in rtr1 rtr2 rtr3 rtr4
do
telnet $i < login > /tmp/login.log
cat /tmp/login.log | grep -v Trying | grep -v Connect | grep -v Escape | grep
-v Unauth | grep -v User | grep -v Password | grep -v exit | grep -v Local
done
} > /logging/rtr.log

and the login is:


show standby bri
exit

Hope this helps.
Kenny.
Kenny
Ron Kinner
Honored Contributor

Re: Creating new log files

To set up logging on a Unix Box, you need to do the following on the
router.

conf t
logging xxx.xxx.xxx.xxx (the IP of your Unix box)
logging trap warnings
alerts
critical
etc. (level of the alert)

All of the differnet levels are stated in config guide, or on the CD.

Next, on the Unix box you need to provide the following statement in your
/etc/syslog.conf

local7.debug /var/adm/cisco.log
(note: there are other syslog levels that can be used)
Then
kill -HUP `cat /var/run/syslog.pid`
and you should
be done. Don't forget to use tabs instead of spaces between the entries in syslog.conf.

Ron
Sprint Unix Team
Frequent Advisor

Re: Creating new log files

Ron,

Thanks. I have been using the same. May be I used space bar for tabs. But again..how do i set different files for differnt devices

local7.debug /var/adm/cisco.log

Is local7.debug to be used for other devices...
Ron Kinner
Honored Contributor

Re: Creating new log files

Don't think you can get syslog to separate the files by source. What most people do is have a cron job run every once in a while to grep out the different boxes and separate them into different files.

Ron