cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3627
Views
0
Helpful
3
Replies

How to display hostname in logs on WS-C3750G-12S-D

WGPavell
Level 1
Level 1

I need to display hostname in logs. How do I make it?

P.S. logging origin-id don't work, this command just doenst exit:

(config)#logging ?
buffered Set buffered logging parameters
buginf Enable buginf logging for debugging
cns-events Set CNS Event logging level
console Set console logging parameters
count Count every log message and timestamp last occurance
exception Limit size of exception flush output
facility Facility parameter for syslog messages
file Set logging file parameters
history Configure syslog history table
host Set syslog server IP address and parameters
monitor Set terminal line (monitor) logging parameters
on Enable logging to all enabled destinations
rate-limit Set messages per second limit
reload Set reload logging level
source-interface Specify interface for source address in logging transactions
trap Set syslog server logging level

 

(config)#logging origin-id hostname
Translating "origin-id"
                           ^
% Invalid input detected at '^' marker.

3 Replies 3

balaji.bandi
Hall of Fame
Hall of Fame

What is the IOS version code running on this device most of them work, but want to confirm what code.

 

on the other hand can you post the sample log message syslog receiving now.

 

Make sure SYSLOG able to resolve the IP to host name also, this can also be done by adding manually /etc.hosts file.

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

IOS version: Cisco IOS Software, C3750 Software (C3750-IPSERVICES-M), Version 12.2(40)SE, RELEASE SOFTWARE (fc3)

 

Logs looks something like that:

Dec 27 08:23:31 192.168.42.7 103777: *Apr 10 20:31:57: %SW_MATM-4-MACFLAP_NOTIF: Host 9ce0.63a1.5003 in vlan 1615 is flapping between port Gi1/0/12 and port Gi1/0/11

 

I need to append hostname to log's strings but I cant find any options on the switch

Looks like some old switch not supporting sending hostname.

 

alternatively i did some work around for that (we use syslog-ng here)

if this is linux edit /etc/hosts add entry like below

 

10.10.9.2       CORESW1   <--- change as per your requirement

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Review Cisco Networking for a $25 gift card