03-29-2012 03:02 PM
I am trying to use a kron process to send output from the "show license udi" command to a logging host.
My requirements are:
send license udi output to remote host.
bonus requirements:
send current feature set to remote logging host.
A couple questions I guess.
1. What level of precidence are kron processes considered? Informational? They don't seem to be listed anywhere that I can find.
2. Is there another way to periodically send the router serial number, license type and ios version to a logging host?
this is what I am doing currently, but I'm unsure if this is correct.
kron policy-list UDI
cli show license udi
!
kron occurrence UDI600 in 600 recurring
policy-list UDI
logging trap informational
logging console debug
logging userinfo
logging origin-id string "xx"
logging source-interface xxx
logging host xxxxxxxx
logging host xxxxxxx
logging host xxxxxxxx
If there are any changes I need to make to the kron process, or anything added to the logging process please let me know. Thanks
Message was edited by: craig pardo
Solved! Go to Solution.
03-29-2012 04:36 PM
I don't see how the kron results are getting passed to syslog at all.
First approach coming to mind is to do it through an EEM applet:
event manager applet ShowCommands
description send show license udi and show version output to syslog
event timer cron name "daily_ShowCommands_cron" cron-entry "0 1 * * *"
action 1.0 cli command "enable"
action 2.0 cli command "show license udi"
action 3.0 cli command "show version"
action 4.0 syslog msg "show license udi and show version output: $_cli_result"
Offhand, I don't know what logging level EEM syslogs are using, but it can be found quickly by temporarily changing "logging trap informational" to "logging trap debugging" and observing the incoming logs on the syslog server. Then adjust "logging trap
03-30-2012 08:19 AM
EEM syslogs are sent using buginf so you need to have logging trap debugging enabled. On top of that you can control the level with the priority command. By default they go out with priority/severity 6 (informational). You can adjust that to whatever value you want, but you need to trap on debugging.
03-29-2012 04:36 PM
I don't see how the kron results are getting passed to syslog at all.
First approach coming to mind is to do it through an EEM applet:
event manager applet ShowCommands
description send show license udi and show version output to syslog
event timer cron name "daily_ShowCommands_cron" cron-entry "0 1 * * *"
action 1.0 cli command "enable"
action 2.0 cli command "show license udi"
action 3.0 cli command "show version"
action 4.0 syslog msg "show license udi and show version output: $_cli_result"
Offhand, I don't know what logging level EEM syslogs are using, but it can be found quickly by temporarily changing "logging trap informational" to "logging trap debugging" and observing the incoming logs on the syslog server. Then adjust "logging trap
03-30-2012 08:19 AM
EEM syslogs are sent using buginf so you need to have logging trap debugging enabled. On top of that you can control the level with the priority command. By default they go out with priority/severity 6 (informational). You can adjust that to whatever value you want, but you need to trap on debugging.
03-30-2012 11:58 AM
Thanks to both of you. I have never worked with the event manager before, and this has greatly improved my knowledge. I took the advice from both of you, and ran it through a couple different tests and it works perfect!
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: