Reset Search
 

 

Article

How to create and use a UPM script to calculate the number of bytes to a destination ip every 5 secs

« Go Back

Information

 
TitleHow to create and use a UPM script to calculate the number of bytes to a destination ip every 5 secs
Objective
UPM script to calculate the number of bytes to a destination ip every 5 secs
Environment
EXOS ALL
UPM 
 
Procedure
1) Create the policy to count the packets 
entry one {
if match all {
    destination-address 192.168.1.2/32 ;
}
then {
    byte-count ibcf_bytes ;
}
}

2) Create the upm script to grep the output from show access-list counter and display in the logs
create upm profile byte_count
enable cli scripting
set var cli.out 0
show access-list counter port 7 ingres
set var a $TCL(split ${cli.out} "\n")
set var b $TCL(lindex ${a} 4 1)
if ($b > 1) then
create log entry "$(b) Bytes sent to 192.168.1.2"
clear access-list counter ibcf_bytes port 7
endif
3) configure the upm timer to execute the script every 5 secs
create upm timer byte_count
configure upm timer byt_count profile byte_count
configure upm timer byt_count after 3 every 300


 
Additional notes
This example is to run the script every 5 seconds. As it will log an event every 5 seconds this will fill up the log very quickly. If you want to put this in a production network it would be better to use a higher interval.
grep is a Unix command used to search files for the occurrence of a string of characters that matches a specified pattern.

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255