Wednesday, 22 April 2015

EEM - Embedded Event Manager

Very useful tool for cisco admins:
Look below. Here is my script which I use daily. In working hours I must use limitation for DFS traffic from our local machines. I did not have time for create complicated script so my idea is simple: "Remove QoS policy from interface where limit is active by selected period" after specified time I add QoS policy to interface again.

Look:

event manager applet DISABLE_DFS_LIMIT_WEEK
 event timer cron cron-entry "10 18 * * 1-5"
 action 1.0 cli command "enable"
 action 2.0 cli command "configure terminal"
 action 3.0 cli command "interface GigabitEthernet0/1"
 action 4.0 cli command "no service-policy input QOS_MARKING"
 action 5.0 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "routername1: Bandwidth limit between X and Y is uncontrolled"
 

This same script you can use for enable but must change only cron settings and one command. Look at bold and underline fonts.

Usefull mdf file - Embedded Menu Manager



Here is created file named *.mdf.
You can run this file using "emm" tool include cisco IOS.
MDF file allows you to create menu with many functions. It is very useful for administrators who using many of this same function to analyse, diagnose, or checking network parameters. MDF - using XML language. You can use ISO commands include XML, you can use TCL scripts also.
Here is simple mdf file which I created and moved to router. If you want to run this file use:
emm mdf flash:/menu_cisco.mdf   <Menu MenuName="Cisco Menu" schemaVersion="1.1">
 <MenuTitle>
  </MenuTitle>
  
   <Item ContinuePrompt="true">
    <ItemTitle>
    <Constant String="Show processor utilization chart" />
    </ItemTitle>
    <IOSExecCommand>"sh processes cpu history"</IOSExecCommand>
   </Item>
 
  <Item ContinuePrompt="true">
   <ItemTitle>
   <Constant String="Show most wanted process in CPU" />
   </ItemTitle>
   <IOSExecCommand>"sh processes cpu sorted | exclude 0.0"</IOSExecCommand>
  </Item>
 
  <Item ContinuePrompt="true">
   <ItemTitle>
   <Constant String="Show remote users" />
   </ItemTitle>
   <IOSExecCommand>"sh crypto session brief | inc remote"</IOSExecCommand>
  </Item>

 <Item ContinuePrompt="true">
  <ItemTitle>
  <Constant String="Show all crypto sessions tunnels users" />
  </ItemTitle>
  <IOSExecCommand>"sh crypto ISakmp SA"</IOSExecCommand>
 </Item>

 <Item ContinuePrompt="true">
  <ItemTitle>
  <Constant String="Show most wanted process in CPU" />
  </ItemTitle>
  <IOSExecCommand>"sh processes cpu sorted | exclude 0.0"</IOSExecCommand>
 </Item>

 <Item>
    <ItemTitle>
        <Constant String="Exit" />
    </ItemTitle>
 </Item>
</Menu>
  Result: 1. Show processor utilization chart
2. Show most wanted process in CPU
3. Show remote users
4. Show all crypto sessions tunnels users
5. Show most wanted process in CPU
6. Exit

Enter selection: 2
CPU utilization for five seconds: 1%/0%; one minute: 2%; five minutes: 2%
 PID Runtime(ms)     Invoked      uSecs   5Sec   1Min   5Min TTY Process
 377      354512  1655186684          0  0.39%  0.40%  0.40%   0 IP SLAs XOS Even
 107      244464    26615162          9  0.23%  0.19%  0.18%   0 Netclock Backgro
 136      136484   843191441          0  0.15%  0.11%  0.10%   0 Ethernet Msec Ti
  88      230716     6654995         34  0.15%  0.13%  0.15%   0 Per-Second Jobs


Press any key to continue...
  

Contact with me

Name

Email *

Message *