04-18-2016 09:44 PM
We have ASR9K Platform, and using 5.1.3 SP3 and using the below script where the requirment is fullfiled of logs getting generated on the syslog server and show log, but with that below logs are also getting printed. Need to understand how do we avoid this extra logs printing.
RP/0/RSP0/CPU0:Mar 21 18:02:11.389 IST: syslog_dev[92]: noscan: while executing
RP/0/RSP0/CPU0:Mar 21 18:02:11.389 IST: syslog_dev[92]: noscan: "close $fd"
RP/0/RSP0/CPU0:Mar 21 18:02:11.389 IST: syslog_dev[92]: noscan: (file "/dev/rdsfs/etc/eem_rdsfs/commit_syslog.tcl" line 10)
::cisco::eem::event_register_syslog pattern "%MGBL-CONFIG-6-DB_COMMIT : Configuration committed by user" maxrun_sec 600\
\
#\
# errorInfo gets set by namespace if any of the auto_path directories do not\
# contain a valid tclIndex file. It is not an error just left over stuff.\
# So we set the errorInfo value to null so that we don't have left\
# over errors in it.\
#\
set errorInfo ""\
\
\
namespace import ::cisco::eem::*\
namespace import ::cisco::lib::*\
\
#\
# errorInf gets set by namespace if any of the auto_path directories do not\
# contain a valid tclIndex file. It is not an error just left over stuff.\
# So we set the errorInfo value to null so that we don't have left\
# over errors in it.\
#\
set errorInfo ""\
#Notify users that we're collecting\
set output_msg "Collecting commit configuration"\
\
#query the event info\
array set arr_einfo [event_reqinfo]\
\
if \{$_cerrno != 0\} \{\
set result [format "component=%s; subsys err=%s; posix err=%s;\\n%s" \\\
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str]\
error $result\
\}\
\
#Extract the message from the event info and append it to the email body\
set syslog_msg $arr_einfo(msg)\
\
\
#Extract the location of the message:\
set location ""\
set output_msg "xyz"\
\
regexp \{.*show configuration commit changes ([0-9]*).*\} $syslog_msg match commit_id\
\
set output_msg "xyz" \
\
#open a cli connection\
\
if [catch \{cli_open\} result] \{\
error $result $errorInfo\
\} else \{\
array set cli1 $result\
\}\
set show_cmd "show config commit changes $commit_id"\
if [catch \{cli_exec $cli1(fd) $show_cmd\} result] \{\
error $result $errorInfo\
\}\
action_syslog priority info msg $result\
\
#close the cli connection\
if [catch \{cli_close $cli1(fd) $cli1(tty_id)\} result] \{\
error $result $errorInfo\
\}\
Solved! Go to Solution.
04-18-2016 09:50 PM
Have you considered using a free tool like RANCID?
04-18-2016 09:50 PM
Have you considered using a free tool like RANCID?
04-18-2016 09:54 PM
haven't tried this tool, and i doubt it will be allowed to be implement the same by customer.
04-19-2016 10:47 PM
Hi
any one who knows how to avoid this logs ?
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