11-04-2021 12:02 PM
Hello,
What I am trying to accomplish is setting up a script that will repeatedly run sh interface interfacename every 30 seconds or so, and to take the "30 second output rate" from within that output and export it to a text file. Each time the "30 second output rate" is exported to the text file it should be time stamped within the text file.
Can the text file stay stored on the router until I am ready to stop the script and then export it elsewhere (maybe via TFTP)?
Forgive my ignorance on this matter.
Solved! Go to Solution.
11-04-2021 12:20 PM
writing in your device may overload once the flash is full you may see another issues, instead you can move to FTP or TFTP
example and options you can see to send output.
event manager applet intstats
event timer watchdog name timer time 30
action 1.0 cli command "enable"
action 2.0 cli command "show interface gi 0/0 | append ftp://user:pass@10.10.10.10/intoutput.txt"
11-04-2021 12:20 PM
writing in your device may overload once the flash is full you may see another issues, instead you can move to FTP or TFTP
example and options you can see to send output.
event manager applet intstats
event timer watchdog name timer time 30
action 1.0 cli command "enable"
action 2.0 cli command "show interface gi 0/0 | append ftp://user:pass@10.10.10.10/intoutput.txt"
11-04-2021 12:39 PM
Hi @balaji.bandi! This is pretty helpful so far. I still have a few more tweaks that probably need to be made. Here is what I setup:
event manager applet intstats
event timer watchdog name timer time 30
action 1.0 cli command "enable"
action 1.1 cli command "show interface fastethernet4 | redirect tftp://192.168.26.220/intoutput.txt"
action 1.2 cli command "show clock | redirect tftp://192.168.26.220/intoutput.txt"
The reason I am using "show clock" was because that was the only way I could figure to actually timestamp the output each time. My issue though is that each time the script runs I only end up with the latest output of the show clock. I believe this is because I am using "redirect" probably and not "append"? When I tried to use append I got an error that "Append is not supported by the file system" do you know what that means?
11-04-2021 02:45 PM
Not sure about the error, as long as the file is RW (read-write access to anyone) it will append the file end of each line.
good idea to use clock EEM have built time if you like to use...but make it simple show clock is good.
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