12-26-2018 04:21 AM - edited 03-08-2019 04:53 PM
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.
12-26-2018 06:39 AM
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.
12-26-2018 10:15 PM
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
12-27-2018 12:15 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide