cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
584
Views
0
Helpful
12
Replies

Periodic log generation for syslog server

Flash Bang
Level 1
Level 1

Hi guys,

I' m trying to configure MDS switches to genrate log in particular period of time. I have tryed to walk throught event manager and also scheduler but no success. Any ideas how to achieve this goal ?

Regards

12 Replies 12

marce1000
VIP
VIP

 

  - Would you want to generate ? Meaning in general  a  syslog server collects logs from the devices , these can be urgent or need to arrive on the syslog server when being generated , 

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

Can i see eem you use ?

Flash Bang
Level 1
Level 1

So marce yeah, I know but in means of adiotional security we need this devices to log in specified period of time so except these warning and debugging logs we need something that will come allways ,no matter of situation in the network.

 

  - As other poster replies you may want to look in automated eem scripting :
                        https://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-xe-16/216091-best-practices-and-useful-scripts-for-ee.html

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

Many thanks Marce but this guide is for IOS/ XE and we are working with NXOS, comands in here are bit different and not all works as it is in guides.
 https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/system_management/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_System_Management_Configuration_Guide/sm_12eem.html
E.G.:Here are timers mentioned in EEM but there is no option for that on my device.

Flash Bang
Level 1
Level 1

Actualy I just find out that with scheduler i can use job to trigger interface flap. But this is a bit invasive way of generating logs.

To describe my problem best way of log generation would be scheduler->job(send syslog) but unfortunately I m not able to do this. I m trying to generate log with EEM based on this interaface state change but no success for now too. Any Ideas ?

can I see EEM you use?

Sure here are 2 versions of my attemps.

 

show event manager policy internal
Name : PerrLog
Policy Type : applet
Event Specification : event syslog pattern "Interface fc1/9 is down"
Action : 1,sup:syslog msg line Log from "HOSTNAME"
Event Specification active on : Active

Name : SendHello
Policy Type : applet
Event Specification : event syslog pattern "Interface fc1/9 is down"
Action : 1,sup:syslog priority informational msg line Periodical Hello msg from "HOSTNAME"
Event Specification active on : Active

please I want the commend you use 
thanks 

Here it is, exmaple 1

(config)# event manager applet PerrLog

(config-applet)# event syslog pattern "Interface fc1/9 is down"

(config-applet)# action 1 syslog msg line Log from "Hostname"

 

(config-applet)# event syslog pattern "Interface fc1/9 is down"

event syslog pattern "Interface fastethernet1/9.* down" <<- check this 

Hello, it has been a while. Your point was no good because it is fiber channel interface and log sounds exactly like  posted before. but I have achieved my goal by interface flap so the log is generated when it goes down.

Also I have to mention that it is best to create loopback interface for this operation.

Many thanks for your replies.

 


Regards Flash
SAN# sh scheduler schedule
Schedule Name : PerrLog
-----------------------------
User Name : schedulerU
Schedule Type : Run every 0 Days 23 Hrs 0 Mins
Start Time : Tue Jul 25 16:33:36 2023
Last Execution Time : Thu Aug 10 00:33:42 2023
Last Completion Time: Thu Aug 10 00:33:44 2023
Execution count : 17
-----------------------------------------------
Job Name Last Execution Status
-----------------------------------------------
IntFlap Success (0)
==============================================================================
SAN#
SAN#
SAN# sh scheduler job
Job Name: IntFlap
-----------------
configure terminal
interface fc1/9
no shutdown
sleep 1
shutdow

Review Cisco Networking for a $25 gift card