help with a completely useless applet

Hello

It's my second applet (first was an hour ago) please go easy on me.  Earlier today, I watched a great webex and I got a little too excited about EEM, especially now I don't have to learn some TCL.  I still have a script TCL unopned bible on my shelf I brought just never pick me up!

I'm trying to understand the use of 'while/end' and ' if/else' statements.  I created a completely useless applet that tells me off every time I have stop the loopback100 on my router interface.  It worked perfectly, and I even managed to get the e-mail accounts of the variable name based on who is connected.

What I want to do now, is to send an e-mail if the user persists and closed at the interface of loopback100 3 times.

Event Manager environment _email_server X.X.X.X

Event Manager environment company @company.com
environment events counter manager 3

no event manager applet lo100protector
Event Manager applet lo100protector
event model syslog 'Interface Loopback100, state change down administratively' period 1

Action 1.0 all $counter gt 0
command action 2.1 cli 'enable '.
Action 2.2 cli command "view".
Action 2.3 regexp ' [a - z] +------. " "[a - z] +" "$_cli_result" username! RegExp relavent not particularly
Action 2.4 syslog msg "Hello $username".
Action 2.5 syslog msg "Please do not stop loopback100!"
cli command measure 2.6 'enable '.
Action 2.7, «config t» cli command
"action 2.8, command cli" int lo100 ".
action 2.9 cli command 'no shut '.
Action 3.0 cli command "quit".
Action 3.1 cli command "quit".
Action 3.2 subtract $counter 1
Action 3.3 puts $counter! I put this to "solve" the problem (if you can call it that).  Always returns a value of 3
3.4 action ended
command cli action 4.0 'enable '.
action 4.1 cli command ' see the race | hostname Inc.
4.2 action '[a-z]+_[a-z]+[0-1]_f[0-9]_[a-z]+[0-1]' regexp ' $_cli_result ' hostname! Neither is this one.
e-mail action 5.0 Server "$_email_server" "company of $$username ' of ' company of $$hostname" subj "this email was generated by EEM on $hostname" body "Please stop you by train to stop the loopback100 interface!  It's not big or clever. "source-int vlan1
Action 5.1 syslog msg 'email sent to $username.
game action 6.0 counter 3

so.  The first problem I have is that my $counter variable never seem to decrement.

The second problem I have is that it seems to be a loop statement.  I see the statement "Please do not stop loopback100!" several times.  Although it seems don't last forever, only a few times.

I tested it without one while loop in it and everything seems to be good.  Someone would be nice enough to put me in the right direction please?

A few other random questions.

Is it possible that I can put a charater directly after a variable?  For example in action 2.4, I seem not to be able to put a "!" after the $username without a space variable has ' ' Hello $username!

Server mail action 5.0 command struck roughly of the charater line limit.  Is it possible that I can break the order into its components?

Thank you very much in advance

A bit too excited, Alex

Thank you for attending the webinar.  I'm glad that you found it informative.

Congratulations on your first applet.  What you want to do is possible, but you cannot set environment variables locally.  Those who cannot be defined that turning in the configuration mode t and their reset.  There are some other counters that you can use, however.  One idea is to use a meter of EEM.  Should be a different policy, but you can accomplish what you want with what follows.

event manager applet lo100protector

event syslog pattern "Interface Loopback100, changed state to administratively down" period 1

action 1.0 counter name lo100cnt op dec 1

action 1.1 if $_counter_value_remain gt 0

action 2.1  cli command "enable"

action 2.2  cli command "show users"

action 2.3  regexp "[a-z]+\.[a-z]+" "$_cli_result"   username

action 2.4  syslog msg "hello $username"

action 2.5  syslog msg "Please don't shutdown loopback100!"

action 2.7  cli command "config t"

action 2.8  cli command "int lo100"

action 2.9  cli command "no shut"

action 3.0  cli command "end"

action 3.4 else

action 4.1  info type routername

action 5.0  mail server "$_email_server" to "$username$company"  from  "$_info_routername$company" subj "This email was generated by EEM  on $_info_routername"  body "Please will you stop trying to shutdown the  loopback100  interface!  It's not big or clever." source-int vlan1

action 5.1  syslog msg "email sent to $username"

action 6.0 end

event manager applet lo100counter

event counter name lo100cnt entry-op le entry-val 0 exit-val ge exit-val 0
action 1.0 counter name lo100cnt op set value 3

Applet variable treatment is fairly primitive.  So, you will not be able to keep some names of variables with certain characters.  The '!' is such a character.  You will need a space.

About the length of the command, at some point you will need to exit this Tcl book :-).  The applets are powerful, but that you begin to build more complex applications and larger, you will need a more fully functional programming language.

Tags: Cisco Network

Similar Questions

  • I just bought the last Apple TV - I can't seem to connect with the App Store and Siri is completely useless. This is an example of how Apple is unable to produce a useful product?

    I just bought the last Apple TV - I can't seem to connect with the App Store and Siri is completely useless. This is an example of how Apple is unable to produce a useful product?

    Hello

    Be sure to follow the instructions in this article to support > set up your Apple TV (4th generation) - Apple supported

  • When you install windows vista service Park 1, I have received an error code 80073712 with 13% downloaded only?. Can you help me to complete this process?

    When you install windows vista service Park 1, I have received an error code 80073712 with 13% downloaded only?. Can you help me to complete this process?

    Hi Gore EzekiahTongun

     

    You can see the steps in the below mentioned article Microsoft and verification.

    http://support.Microsoft.com/kb/947366

     

    I hope this helps.

  • Need help with Macbook

    Hello, I recently bought a Macbook from a friend and since I got the Mac it's very very slow at doing things like browsing the internet using Safari, it takes forever to load, web pages and all sorts of things that I'd like to get help with this problem maybe a few recommendations and also on how to speed up... If you need to care about Macbook, I can give these thx.

    To sell or transfer ownership of a Mac, even to a member of your family, you must follow these instructions. So far, you will have continuous problems.

    Refer to what to do before you sell or give away your Mac

    1. If you have enabled FileVault, disable it in system preferences > Security and privacy.
    2. "Remove" your iTunes account. Ditto for Audible if you have one.
    3. System Preferences > iCloud > deselect 'Back to My Mac' and 'find my Mac '.
    4. Disconnect from iCloud. Select "Delete from Mac" when it appears.

    Next: delete all of your personal information by erasing the internal storage of the Mac completely.

    1. If your Mac comes with a grey system installation DVD, start up your Mac with this disc in the optical drive, all holding the key c to boot from it instead of its internal volume, which must be erased before selling.
      • Apple stopped Macs shipment requiring these discs in August 2011.
    2. If your Mac does not comes with disks, boot OS X Internet Recovery:
      • using three fingers press on and hold the following keys: (command), optionand R.
      • With a fourth finger, press the power button to turn on the Mac.
      • Keep the other three fingers here where they are until you see the icon "spinning globe.
      • This method force the Mac to download BONES initially installed from Apple servers, that won't require not an Apple ID install.
    3. Remove any password Open Firmware, if you created a: select utility password firmware in the Utilities menu and remove.
    4. Select disk utility from the utilities menu.
    5. Delete all partitions that can be created.
    6. Select the icon for the hard drive to the Mac, and then select the tab "delete".
    7. Click on the 'Security Options' button and erase the drive.
      • More "robustly" you erase the disc, the longer it will.
      • The fastest method is sufficient, since all but the techniques more expensive and equipment will be able to recover data deleted safely.
    8. When he finishes, quit disk utility.
    9. In the utility menu, select Install Mac OS X .
      • An identifier Apple won't be necessary. If a prompt for an Apple ID, return to step 5.
      • Do not create user accounts.
    10. When he finishes, shut down the computer.
    11. If you want to install the bundled apps that have been included with your Mac, restart using your DVD Applications if it was included and install the bundled apps.
      • Apps, delivered with the new Macs sold without disks cannot be transferred. His new owner must buy them from the Mac App Store with its own Apple ID.

    If the Mac is sold to someone outside the family, consider the following additional information:

    1. System provided with your Mac installation DVD must stay with him forever and be included in the sale.
    2. Consider including your AppleCare certificate if you bought it, documents printed, same box if you have.
      • AppleCare remains with the equipment and can be transferred.
    3. Run an invoice indicating the serial number of the Mac.
    4. Once is no longer in your possession, remove the Mac of your devices in my support profile.
  • help with the beats on my envy 17-3270nr, n key

    help with the beats on my envy 17-3270nr key. recent Smart hard disk crash, replaced with exact same hitachi drive, same care extended warranty repairs covered of the Frys. Windows 7 Edition home premium w / service PAC 1 installed, drivers installed, except that now there is no volume of beats on screen graphic dial button, click the button on top button on the page does not call the beat of the application settings. Futhermore; the motion sensors of laser to activate the keyboard backlit keyboard do not work.  Are there drivers hp software to enable the missing features?

    Hello

    Download and install the following.

    HP OSD utility.

    Proximity sensor driver.

    Once completed, restart the laptop.

    Kind regards

    DP - K

  • Need help with photos

    How can I find the appropriate folder for download on a Page I manage?  Photos current pictures but when I download it is records, I can't open, review or post.  Thanks for any help.  I searched some tutorials help with photos, records and others, and I'm struggling with something that used to be so easy?  Thanks again!

    Hi Brandi Jo,.

    To access the photos you want to put on your page, you want to export from the Photos app. Select the photos, go to file > export > export x pictures. Enter the details of your export, and then click export. Choose a location and click the export again. Once exported, you can use all of the tools you want to use for downloading your page.

    Some sites such as Vimeo or Flickr, allow you to export directly from Photos. Select the photos you want, go to the file menu > share > select the service you are exporting to and complete the export.

    Good luck.

  • Need help with Tempo on U-series of satellites

    I installed tempo and try to download the last updae of bios it says that I need. but I get the following error message...

    + Unfortunately, your personalized list of drivers has expired. Please click on a link below for more information.

    Can anyone help with this? How to complete the download. (I am connected to ok)

    see you soon

    If you want to download a driver, update the BIOS or other Toshiba stuff you can do it directly. Visit http://eu.computers.toshiba-europe.com > download & support. Select your laptop model and you will find everything you need.

  • Need help with the port forwarding for a XBox remote Streaming

    I have a router R6200v2 and need help with port forwarding.

    I came across this set of instructions for setting up stream port forwarding XBox remotely from anywhere

    http://kinkeadtech.com/2015/07/how-to-stream-Xbox-one-to-Windows-10-from-anywhere-with-Internet/

    I have no idea when it comes to such things and I want to make sure I do it correctly without messing up my existing home network.

    Port Forwarding and triggering Port pages setup look very different from what the guy uses. Can someone walk me through what I do to set up please?

    Hi @varxtis,

    You must enter them in the field for a start external Port and external completion Port. You will need to send individually except for the range of 49000-65000. The steps are as follows.

    1. create a Service name (it could be something else that you cannot use the same service name twice. Ex. XBOX1, XBOX2 and so forth.)

    2. Select the type of service (TCP, UDP or both)

    3 entry 5050 times a start external Port and external endpoints.

    4. Select the IP address of your XBOX.

    5. Select apply.

    6 do the same for other port numbers. To the beach, use 49000 for the external departure Port and for the external completion Port 65000.

    Kind regards

    Dexter

    The community team

  • Need help with the error Code 80244019 Windows Update

    From: Doug

    I get code 80244019 whenever I try to use Windows Update. I tried to change the DWORD in regedit nothing helps... Norton has recently found and 'resolved' trojan.zlob in 128 files in the registry, 21 cases (10 of which were in system32) and 1 browser cache. Whenever I try to use IE to go to http://windowsupdate.microsoft.com I am redirected to msn.com.

    Any advice or solutions would be welcome.

    From: PA bear [MS MVP]

    Chances are that ZLOB was not completely removed and she was accompanied by infections Vundo and SDBot variant, all protected by a rootkit infection. You are going to need specialized assistance to clean this machine,

    Unexplained computer behavior may be caused by deceptive software

    http://support.Microsoft.com/kb/827315

    Run a check of /thorough/ for hijackware, including post your hijackthis on a proper forum log.

    Verification / help with Hijackware

    http://aumha.org/a/parasite.htm

    http://aumha.org/a/quickfix.htm

    http://aumha.NET/viewtopic.php?t=5878

    http://wiki.CastleCops.com/Malware_Removal_and_Prevention:_Introduction

    http://MVPs.org/winhelp2002/unwanted.htm

    http://inetexplorer.MVPs.org/data/prevention.htm

    http://inetexplorer.MVPs.org/tshoot.html

    http://www.MVPs.org/sramesh2k/Malware_Defence.htm

    http://defendingyourmachine2.blogspot.com/

    http://www.elephantboycomputers.com/page2.html#Removing_Malware

    When all else fails, HijackThis v2.0.2

    (http://aumha.org/downloads/hijackthis.exe) is the tool to use.

    It will help you to identify and remove any hijackware/spyware with

    assistance of an expert.  * Post your log to

    http://aumha.NET/viewforum.php?f=30,

    http://forums.Spybot.info/forumdisplay.php?f=22,

    http://CastleCops.com/forum67.html, or other appropriate review bodies

    by an expert in the field, not here.* *.

    If the procedures look too complex - and there is no shame in admitting

    isn't your cup of tea - take the local machine, good reputation and

    independent computer repair shop (i.e., not BigBoxStoreUSA).

    --

    ~ Robear Dyer (PA Bear)

    Another response of the community of Windows Vista discussion groups

  • Please help with this nightmare Yontoo

    Adding or deleting, I deleted Yontoo I have no idea how it it has been downloaded period, I'm at the wheel of a 'XL' that has served me well. My problem is I deleted this Yontoo and forggetaboutit. This program has created 6 file enties 1) %Temp%\Yontoo FFClient.xpi 2)%Temp%\Yontoo IEClient.dll

    3)%temp%\Yontoo Layers.crx 4)%Temp%\Yontoo Layers.pem 5)%Temp%\Yontoo Setup - Silent.exe 6) % Program Files%\Yontoo sleeping Runtime\Yontoo IEClient.dll... Then he then made 8 registry entries. If I can get these files removed from my machine, then I will devote my time to fix the registry. I say this because my nightmare does not stop there. Believe me when I tell you that this program "YONTOO" goes further because it created another register 16 subkeys. It's like something totally unknown to 'The Wild Wild West of the 21st Centuryt' someone would say enough is enough, but there is still a little to make this complete puzzle. This program goes further and creates and installs what they call 'Rage Page' it is a browser extension that changes the structure of the skin of the 'Facebook' and displays ads that seem to you guessed it "Facebook"... My main wish is that I will be able to get help with the "folders". I'm not a person notified with computers, but then I think that my say you I'm always pushing an "XP" in this era of high-tech a bit gave me there Yes... Anyway any help, you can afford to me will be greatly appreciated.  Thank you in advance.
    Respectfully * address email is removed from the privacy *.

    Hello

    Try the free version of revo uninstaller to completely remove all files and registry entries associated with YOONTOO.

     

    Revo Uninstaller. (free version)

    http://www.revouninstaller.com/revo_uninstaller_free_download.html

    When you are finished, download and run a full scan of Malwarebytes anti-malware from the link provided below.

    AV. Malwarebytes

    http://www.Malwarebytes.org/

    Also run a full scan of SuperAntispyware.

    SAS

    http://www.SUPERAntiSpyware.com/

    Remove any found object.

    Further reading

    http://www.ehow.com/how_8561545_delete-Facebook-pagerage.html

    Good luck and let us know if this helped.

  • help with updates/SP3 on XP

    just install XP Home on a computer and having some problems.

    use a disc of SP2, and then immediately installed the SP3 update. then, I installed IE8 .exe Microsoft site. After that, connected to Windows update and DLed all until was completely updated and there is no more updates.

    Well, it seems a little weird. one of the services is named wrong. "Human Interface Devices" Department is still called 'HIDDEN', when it should be the former since SP3 should change the name. and some updates seem to be missing from the Add/Remove. It just does not match when comparing it to another computer that has XP SP3 perfectly up-to-date. for example, IE8 has only 3 security updates listed (compared to my other computer 12 or so updates), is it because unless it is installed with the .exe file and it already included more updates?

    a little worried. you want to make sure that my computer is completely up to date and it is not all the current problems.

    Hi RoseBlush,

    Thanks for posting your query in the Microsoft Community Forum.

    Based on the information, you have installed Windows XP Home SP2 on a computer and immediately installed SP3, Internet Explorer 8 and other updates, however still face problems with the service Human Interface Devices and other updates are not installed.

    Usually, if you are installing the stand-alone package of SP3 more updates including security and critical updates are installed. This may also depend on the features and programs installed on the system.

    For more information, see the articles:

    Windows Update

    How to configure and use automatic updates in Windows

    You can also download a screen shot of the issue related to the Human Interface Devices (HID) service for more details on the issue.

    Download pictures and files

    Also check out the link:

    Use SkyDrive download collected files and post screen/image capture

    Let us know if you need help with Windows related issues. We will be happy to help you.

  • I have a mess of error. about microsoft Isatap adapter... plug and play id root\ * Isatap\0002 error tv-configmgrerr31 need help with drivers

    need help with this.is there a link for the drivers. The only changes to my system is a new modom.netgear wireless g54.thank you

    Hello

    (1) what is the complete error message you receive?

    (2) when exactly you get this error message?

    (3) how long have you been faced with this problem?

    You can ignore this error message. This error message does not indicate a problem with the adapter. The adapter will continue to function correctly.

    See the article below

    On a Windows Vista-based computer or on a Windows Server 2008-based computer, the Microsoft ISATAP map appears with a yellow exclamation mark next to it in Device Manager, and you also receive an error message
    http://support.Microsoft.com/kb/932520

  • Help with WRT54GS on FiOS (ethernet, no coaxial cable)

    Hey guys, I'm new here and just try to get help with this insoluble problem that I started having with my Linksys WRT54GS and Verizon FiOS last week.

    To simplify my story complete and real question here, I put it all points to try to make it simpler to understand:

    -In the fall of 2007, I switch from Comcast to Verizon FiOS after getting screwed on waiting for two weeks and never get a new router, that one was fried in a storm

    -Little brother spills the first Actiontec router and it breaks

    Actiontec wireless - replacement of the router is non-existent (MI42WR)

    -After trying fill the Linksys for the Actiontec, it turns out to be a pain much more than a real solution to the lack of wireless

    -Past of the coaxial cable to the full ethernet cat5 last year to use Linksys WRT54GS
    -Fortunately directly connected to ONTARIO to Linksys WRT54GS via ethernet cat5 for a year while the wireless is perfect for other computers

    (last week)

    -Off router Linksys for a night the week last to give him a night's rest
    N ' unable to connect to Verizon with WRT54GS old or new router WRT54GL (which I'm now back)

    -HAVE ethernet light outside still has a green light indicating that it is working
    -Do not fill the Actiontec and Linksys again
    -I don't want to go back to the use of the Actiontec for what anyone, but stuck with it for now
    -A reset the router, computer connection and DHCP has published many times, but nothing helps

    -A updated my WRT54GS firmware before you type this and still nothing

    -No connection to any Linksys router, but the works of Actiontec

    I can't think of a solution except maybe try one of another company, as D-Link... (sad face) I'm already back the new router Monday, since I don't believe that my WRT54GS is broken even if it is not connected. If I don't think that maybe Verizon has done something that is not allowing one of my Linksys routers to connect, because fortunately, they started to charge me an extra $10-12 on FiOS bill without notice. Although at this stage, I have a hard time believing that even switch to another router company and use their products will do everything for me...

    Right now, I am suffering with this router Verizon terrible stock and my parents and aunt are complained about these last two weeks. I hope that someone here knows what may be the real problem that can sound with little assistance.

    Ah, found the solution work for a guy who had exactly the same problem as me, but with a D-Link router.

    "The best solution is to go to the ethernet connections and click Cancel, the green light on the actiontec to go yellow, unplug it in this State." Disconnect the battery power and the BBU. Put the new router in place, reconnect battery and BBU, then taken power for the new router.

    Just releasing and switching router should work but if it is not these steps work. »

    Thank you for at least trying to help me to abandoned.

  • Need help with my Mail window. I can't export my message to the PST format. I keep getting the message error "an error occurred during initialization of MAPI".

    Hello

    Need help with my Mail window. I can't export my message to the PST format. I keep getting the message error "an error occurred during initialization of MAPI". Y at - it solution or another method?

    Hi ErikLee,

    Do you have MS Outlook installed on your computer?

    Windows mail import and export opportunities are limited to an Outlook .pst file or an Exchange Server mailbox. They are available only if MS Outlook is installed.
    If MS Outlook is not installed and you start an import or export action, the necessary support files are not present for Windows mail complete the operation. Then I suggest you to install Outlook temporarily and see if the problem is resolved.

    Follow the instructions below and check if the problem is resolved.

    1. reboot your computer, and then start Windows Mail.
    2. on the Tools menu, click Options.
    3. in the connection tab, click on edit to open the Internet Properties dialog box.
    4. in the tab programs, click on an application other than Windows mail e-mail in the e-mail list. Click on apply and then click OK.
    5. click OK again to close the Options dialog box.
    6. exit Windows mail and restart Windows mail.

    If this does not work, I suggest you upgrade to Windows Live Mail to import or export messages that may help you resolve the issue.

    To download Windows Live Mail, visit the following Microsoft Web site:
    http://get.live.com/wlmail/overview

    For more information about Windows Live Mail, see the Microsoft Web site at the following address:
    http://windowshelp.Microsoft.com/Windows/en-us/help/4b30d3d6-abe2-46d1-a5fd-4a1ba786a1381033.mspx

    Check whether the problem is resolved.

    Please post back and let us know if it helped to solve your problem.

    Kind regards
    KarthiK TP

  • Need help with Windows 7 key.

    I have a laptop that I had to change the HARD drive due to a complete failure.  I had a Windows 7 key I know has been good and have never used, purchased as part of a package of pc 3.   Now the installation tells me that this is not a valid key.  I paid almost $150.00 for this set of 3 installs for Windows 7, about 5 years ago.

    The old HDD is dead, I tried to connect with a USB key and nothing.   The laptop was working fine with WIndows 10, then the portable HARD drive is simply dead.  I need help with a new key, or at least the one I have to work.  The new drive HARD won't have not all partitions or any attached former windows key.  I can't get past the check of Windows screen.

    Need help please.

    You must use the product key located on the COA sticker (at the bottom of the laptop, sometimes inside the battery cover or access. Once you have located the product key, and then follow the instructions below to change the key of the key from the factory to the key on the sticker.

    How to change Windows 7 product key

    http://www.windowsvalley.com/how-to-change-product-key-in-Windows-7-and-Windows-Vista/

Maybe you are looking for

  • Unlock with Apple Watch does not

    Hello I'm running a MacBook Air mid-2013 with macOS Sierra, with a 2nd Gen Apple Watch watchOS3 running. I'm on the same Apple for my Air ID, see and iPhone (6 s). But unlock with Apple Watch does not work on my Air. I activated 2 factor authenticati

  • Drivers HP 1000-1205tx

    I want drivers of HP 1000-1205txPlease reaply fast!

  • OTP-S790 control through network, no remote control

    Is it possible to use the system at REST (or any other reasonable means) to use the home network to fight against it? Thank you someguyinKC

  • I can not instalar o windows 10

    Por favor, elem. initialization use o ao, ja no final do processo cylindrical um erro: erro seu nao pode ser particionado hd

  • Installation of 8.6 and 8.6.1 8.6.4 VDM

    Hello When VDM released 8.6, the Vision Assistant has a bug of not being able to apply the filter particle visually thereon, this has been fixed by a patch 8.6.1. Recetnly, NOR also relaeased 8.6.4 VDM that is about 500 MB. They mentioned that it doe