cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1921
Views
25
Helpful
8
Replies

Would like to monitor input errors and crc on a cisco catalyst 3650.

rex135
Level 1
Level 1

How would I go about monitoring input errors and crc on a Cisco switch. Essentially, I would like to output those values to a text file?

1 Accepted Solution

Accepted Solutions

Take a look at this one:

https://github.com/sebrupik/srupik-apic-em-tools/blob/master/frozenPony/src/oneLinerSimple.py

 

...change the sh_session.send_command lines to what ever you need.

 

When you run the script from a scheduled task, just pipe it to a text file:

 

python oneLinerSimple.py > output_$time.txt

 

cheers,

Seb.

View solution in original post

8 Replies 8

Deepak Kumar
VIP Alumni
VIP Alumni

Hi,

Open putty and start saving logs in a log file:

 

and run below command:

sh interfaces | in up|CRC

 

Regards,

Deepak Kumar

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

Seb Rupik
VIP Alumni
VIP Alumni

HI there,

This is dependent on your IOS supporting EEM 4.0 or above. 

The script would run the sh int command on the required interface and regex the lines/ values you require. You would execute the script via a timer event and write the regex results to a file with a name based on the system clock value.

 

Either that, or have a cron python script SSH onto the switch are run/ regex the sh int command and output to a file.

 

Alternatively this information is available via SNMP, and at least that way you could get a nice graph too!!

 

cheers,

Seb.

balaji.bandi
Hall of Fame
Hall of Fame

If you looking periodically run and get the logs, you can do out of box with small scripting to login to switch get suggested output and ammend in to log file desired format.

 

let me know if you keep to know that script, i can provide one.

 

BB

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

How to Ask The Cisco Community for Help

Hello,

 

Thanks for your suggestion. Running a simple script is essentially what I want to do. Every hour or so the script would run to get those values and output it to a file. How would that script look like?

 

Thanks for the help!

Take a look at this one:

https://github.com/sebrupik/srupik-apic-em-tools/blob/master/frozenPony/src/oneLinerSimple.py

 

...change the sh_session.send_command lines to what ever you need.

 

When you run the script from a scheduled task, just pipe it to a text file:

 

python oneLinerSimple.py > output_$time.txt

 

cheers,

Seb.

I'll check this out.

Thanks for your help!

yes other support what you looking for using python, the one i was referring simple script uses expect command and write to logs.

 

BB

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

How to Ask The Cisco Community for Help

Hello,

 

I don't want to be redundant, but if your switch supports EEM 4.0 (you need to run a 15.2 release as far as I recall), you could use the script below. I am using SolarWinds TFTP server, make sure you have 'Rename existing files on conflict' checked, otherwise the file will be overwritten (unless that is what you want).

 

10.10.10.2 is the IP address of the TFTP server, yours most likely is different. The applet runs each hour.

 

event manager applet INPUT_CRC_3650
event timer cron name cronpolicy cron-entry "0 0-23/1 * * *"
action 1.0 file open 3650LOG tftp://10.10.10.2/3650.txt w
action 2.0 cli command "enable"
action 3.0 cli command "sh int | include ^(G|F)|input errors"
action 4.0 file puts 3650LOG "$_cli_result"
action 5.0 file close 3650LOG