EEM script to find a pattern and send an alert of some sort

Hello folks, can someone suggest why the script below is not returning anything?
My goal is to execute 'show hsrp detail', if HSRP output contains pattern indicated below, I should be able to generate an alert somehow.
Please let me know what I am missing.
event manager applet HSRP
  event syslog pattern "Standby router is unknown"
  action 1.0 cli show hsrp detail
  action 2.0 syslog msg HSRP ISSUE  
  action 3.0 cli end
This is the output I want to find pattern from:
SWITCHTEST# show hsrp detail
Ethernet2/1 - Group 101 (HSRP-V2) (IPv4)
  Local state is Initial(Interface Down), priority 90 (Cfged 90), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 90
  Hellotime 3 sec, holdtime 10 sec
  Virtual IP address is 10.17.173.1 (Cfged)
  Active router is unknown
  Standby router is unknown
  Authentication text "cisco"
  Virtual mac address is 0000.0c9f.f065 (Default MAC)
  6 state changes, last state change 04:18:02
  IP redundancy name is hsrp-Eth2/1-101 (default)

What you want to do is not possible on NX-OS yet.  While you can get the syslog message "HSRP ISSUE" the output of the command will not display.  You could store it on flash by redirecting the output to a local file, but it will not appear in the syslog message.

Similar Messages

  • To convert Sap Script output to PDF format and send it via email.

    Hi Friends,
    Could any one please tell me, how to convert the Sap Script output to PDF format and send it via email. If any one have the code, kindly mail me to [email protected]
    Thanks & Regards,
    John

    Plese check this sample code from other thread.
    REPORT zzz_jaytest .
    Types Declaration
    TYPES : BEGIN OF ty_pa0001,
    pernr TYPE pa0001-pernr,
    bukrs TYPE pa0001-bukrs,
    werks TYPE pa0001-werks,
    END OF ty_pa0001.
    Internal Table Declaration
    DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
    i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
    i_content_txt TYPE soli_tab, "Content
    i_content_bin TYPE solix_tab, "Content
    i_objhead TYPE soli_tab,
    Work Area Declaration
    w_pa0001 TYPE ty_pa0001, "For pa0001 Details
    w_res TYPE itcpp, "SAPscript output
    "parameters
    w_otf TYPE itcoo, "For OTF
    w_pdf TYPE solisti1, "For PDF
    w_transfer_bin TYPE sx_boolean, "Content
    w_options TYPE itcpo, "SAPscript output
    "interface
    Variable Declaration
    v_len_in TYPE so_obj_len,
    v_size TYPE i.
    Constants Declaration
    CONSTANTS : c_x TYPE c VALUE 'X', "X
    c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
    c_otf TYPE sx_format VALUE 'OTF', "OTF
    c_pdf TYPE sx_format VALUE 'PDF', "PDF
    c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
    c_bin TYPE char10 VALUE 'BIN', "BIN
    c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
    "File Name
    c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
    START-OF-SELECTION.
    Selecting the records from pa0001
    SELECT pernr bukrs werks FROM pa0001
    INTO TABLE i_pa0001 UP TO 10 ROWS.
    Setting the options
    w_options-tdcopies = 1 ."Number of copies
    w_options-tdnoprev = c_x."No print preview
    w_options-tdgetotf = c_x."Return of OTF table
    w_options-tddest = c_locl."Spool: Output device
    Opening the form
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    form = c_form
    device = c_printer
    language = sy-langu
    OPTIONS = w_options
    IMPORTING
    RESULT = w_res.
    LOOP AT i_pa0001 INTO w_pa0001.
    Writting into the form
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    element = 'MAIN'
    window = 'MAIN'.
    ENDLOOP.
    Closing the form
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
    RESULT = w_res
    TABLES
    otfdata = i_otf
    EXCEPTIONS
    unopened = 1
    bad_pageformat_for_print = 2
    send_error = 3
    spool_error = 4
    codepage = 5
    OTHERS = 6.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Converting OTF data to single line
    LOOP AT i_otf INTO w_otf.
    CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
    INTO w_pdf.
    APPEND w_pdf TO i_content_txt.
    ENDLOOP.
    Converting to PDF Format
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
    EXPORTING
    format_src = c_otf
    format_dst = c_pdf
    devtype = c_printer
    CHANGING
    transfer_bin = w_transfer_bin
    content_txt = i_content_txt
    content_bin = i_content_bin
    objhead = i_objhead
    len = v_len_in
    EXCEPTIONS
    err_conv_failed = 1
    OTHERS = 2.
    v_size = v_len_in.
    Downloading the PDF File
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = v_size
    filename = c_name
    filetype = c_bin
    TABLES
    data_tab = i_content_bin.
    The extension is put the it_mailpack-obj_name parameter of 'SO_NEW_DOCUMENT_ATT_SEND_API1'.

  • Script to find out table and index candidates to keep in the buffer pool

    I am looking for a script to find out tables and indexes to keep in the buffer pool.
    Could you help me on this ?
    thanks...
    Markus

    this is more of a open question. As you know ur data well. We do not know whats ur data. cachin tables in buffer pool is okay, but it might age out after not being used...instead you can use the KEEP POOL...to cache small tables/popular tables into the keep pool...as keep pool guarantees full caching .....
    here are some links on keep pool cacheing
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/memory.htm#sthref410
    http://www.dba-oracle.com/oracle_tips_cache_small_fts.htm
    http://www.dba-oracle.com/t_script_automate_keep_pool_tables_indexes.htm
    http://www.dba-oracle.com/oracle_news/news_caching_keep_pool_large_objects_clob_blob.htm
    Edited by: user630084 on Apr 8, 2009 5:48 AM

  • Doubt about difference between "Send to sap" and "Send EWA Alerts to SAP"

    Hello All
    I hope that you can help me is juts a doubt about 2 check boxes
    I'm on setup of a EWA but when i´m on the configuration (dates, transfers ewa to sap, archiving of EWA etc) i see 2 check boxes
    that i don't know what is the difference
    The path is the following
    Tcode = DSWP --> Select the solution --> (the left column) Operations Setup --> Solution Monitoring --> EarlyWatch Alert  --> Setup EarlyWatch Alert
    Could you tell me what is the difference between "Send to SAP" and "Send EWA alerts to SAP" boxes?
    Thanks and have a nice day

    Hello Cherios,
    The "Send to SAP" check box is used when you want to sent a Production or Test (Quality) systems EWA data to SAP for analysis.
    Currently the "Send EWA Alerts to SAP" is not used at this time, and actually cannot be selected, and saved.
    There should now be no doubt about the two check box fields .
    Hope this information is helpful.
    Regards,
    Paul

  • Script to find duplicate index and how can we tell if an index is REALLY a duplicate?

    Does any one have script to find duplicate index? and how can we tell if an index is REALLY a duplicate?
    Rahul

    One more written by Itzik Ben-Gan
    The first query finds exact matches. The indexes must have 
    the same key columns in the same order, and the same included columns but in any order. 
    These indexes are sure targets for elimination. The only caution would be to check for index hints. 
    -- exact duplicates
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols,
    (select case keyno when 0 then colid else NULL end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by colid
    for xml path('')) as inc
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'exactduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and c1.cols = c2.cols
    and c1.inc = c2.inc;
    The second variation of this query finds partial, or duplicate, indexes 
    that share leading key columns, e.g. Ix1(col1, col2, col3) and Ix2(col1, col2) 
    would be considered duplicate indexes. This query only examines key columns and does not consider included columns. 
    These types of indexes are probable dead indexes walking. 
    -- Overlapping indxes
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'partialduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and (c1.cols like c2.cols + '%' 
    or c2.cols like c1.cols + '%') ;
    Be careful when dropping a partial duplicate index if the two indexes differ greatly in width. 
    For example, if Ix1 is a very wide index with 12 columns, and Ix2 is a narrow two-column index 
    that shares the first two columns, you may want to leave Ix2 as a faster, tighter, narrower index.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Script to find a user and restart two services

    I am looking to make a script to first find a user that is connected to a server (list) the to stop Spooler, then stop cpsvc. Once the services are stopped, the script would then clear out the folder on "C:\Windows\System32\spool\PRINTERS"
    Directory. Once that was done, the script would then start Spooler and cpsvc. At the end it would echo the services were restarted and to try to print now.
    Lee Mossolle

    A user cannot stop and start services and cannot delete files in the system folders.
    There is no need to look for the services in that way  You will have to do this remotely.  Just find the services if they exisit and stop them then remotely delete the contents of the spooler folder.
    PowerShell remoting would be the easies way to do this.
    strComputer = WScript.Arguments(0)
    WScript.Echo "Running Against Remote Computer Named: " & strComputer
    set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name = 'cpsvc' OR Name = 'spooler'")
    for Each objService in colListOfServices
    objService.StopService()
    objService.StartService()
    Next
    Until you understand how yor code will work avoid over coding.  It just adds confusion and errors.   The above is functionally equivalent to what you posted. 
    I suspect there may be a dependency between cpsvc and spooler.  In that casr yo can only kill them in the correct order.  This will require to loops of a more sophisticated scripting approach.
    We can also use the 'Forse' argument and retriev the master service (spooler) and force it to stop all dependent services.  We would then retrive all services and start them. We can also just retrieve the dependency list and use that.
    The code is simple and will allow the dependencies to be added if needed.
    You can also use PowerShell which is much easier.
    Get-Service spooler -computer remotepc | Stop-Service -force
    Get-Service spooler -computer remotepc | Start-Service
    We can wrap this in a function for convenience.
    ¯\_(ツ)_/¯

  • Script to monitor database and send email alerts

    Dear Gurus,
    We have databases running on WIN2000 server. Can anyone provide me with a script (VBScript) or a batch file script which can check the database status and send an email alert depending upon the status of the database. Thanks in advance for the help!!

    Hi,
    I don't think this is the right forum for this.
    The Oracle Scheduler can certainly schedule such a script to run regularly but the issue of creating such a script is more to do with general database maintenance. It seems as though a web search should reveal some similar scripts that can be used as a base.
    Thanks,
    Ravi.

  • Script to find OU name and object name in AD

    Hi , can any one help me on this, I need a script to find OU name along with object name in entire domain.
    Regards, Triyambak

    Hi Triyambak,
    As DexterPOSH mentioned, Get-ADObject can be used here.
    To list all OUs and the relevant objects of each OU in domain, please try the script below:
    Import-Module ActiveDirectory
    Get-ADOrganizationalUnit -Filter *|foreach{
    Get-ADObject -SearchBase $_.DistinguishedName -Filter *}
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • Looking for Pages script to find "return" "return" and delete 2nd one only

    Looking for a Pages Applescript to find "return" "return" and delete 2nd one only. Perform on entire document.
    Thanks

    Funny, the same question was asked on 2011/11/12 in http://macscripter.net/viewtopic.php?id=37477
    Nigel Garvey posted a neat answer :
    --{code}
    tell application "Pages"
       delete (paragraphs of front document whose length is 1)
    end tell
    --{code}
    Yvan KOENIG (VALLAURIS, France)  lundi 14 janvier 2011 11:01:29
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Script to find the service and manage its state

    We have a service that runs with different names on different machines like
    Bomgar-scadsadccd, Bomgarsdscchfn, Bomgarscnkfkdk
    So, here we need to write a VB script that will find this service with partial name "Bomgar" and check it's status like
    1) Not present, then should install from a shared folder like "start \10.216.16.245\Bomgar.exe"
    2) Installed but not running, then start the service.
    3) Installed and running then quit.
    How can we achieve this? This is what i have tried..
    "strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service
    where Name='bomgar*'")
    nItems = colRunningServices.Count
        If nItems > 0  Then
    For Each objItem in colRunningServices
        If objItem.State = "Stopped" Then objItem.startservice            
                ElseIf objItem.State = "Running" Then exit
    End If
        Next
    Else
            start \\10.18.23.245\Shared\Bomgar.exe
    End If

    We have a service that runs with different names on different machines like
    Bomgar-scadsadccd, Bomgarsdscchfn, Bomgarscnkfkdk
    So, here we need to write a VB script that will find this service with partial name "Bomgar" and check it's status.
    Instead of re-inventing the wheel with a script you could these existing console commands:
    net  start  |  find  /i  "Bomgar"
    (to find out which Bomgar services exist)
    sc  query "Bomgar-scadsadccd"
    (to check the status of this service)
    net start "Bomgar-scadsadccd"
    (to start the service)

  • Script to find specific font and copy to a new document

    I am working on a scripting solution to help break out files for production. What I need to do is search through a PSD, find any text objects that are in a specific font, and if they match, copy them to a new document. Can anyone help me with this? I've been able to make parts work, but I am very green, and could use a little bit of direction.
    thanks!

    Yeah so far I've been having trouble checking the layers, identifying the fonts, and the creating the new text object on a new file So pretty much the whole thing is broken at the moment.  Any help you could offer would be greatly appreciated. I'm just now really starting to learn javascript just to be able to automate photoshop.

  • Please please please will someone find a way to tell itunes to put some sort of 'undo' button on their notes app!? if they just did that one simple thing, people wouldnt be so angry or sad about deleting something. they can just press undo to get it back!

    If iTunes could add this to an update then I (and surely many others) would be extremely happy that it would be easier to get back your accidently deleted notes right then and there so you wouldnt have to stress about the fact that you have to delete everything off of your ipod and restore the whole thing just to get your notes back (though most of the time, if you're willing to do this, then the notes are very important and you may need them). I have accidently deleted my important notes twice and it takes a long time to get them back and even then, you dont get them all back, you just get back what you synced to your computer last. there is a good chance that the way you accidently deleted your notes is while you were working on them and how would you get all of that back if it was completely new? you can't. you just have to redo absolutely everything you just did, if you can even remember all of it. i know i cant remember half the stuff i have on my important notes because all of the things i have on there are specifically there TO remind me of things. im sure you can see how this would make the itunes world a much easier place to navigate in and you wouldnt have to go to places like this one and try to find out how to get only half the notes you might really need.

    We are just users here, just like you, and Apple does not follow these discussions. But you can suggest this to Apple directly, using this link:
    Apple - iPod touch - Feedback

  • There is a large flashing advertisement at the top of pages that shouldn't have one, such as this Mozilla page. How can I get rid of this, and is it malware of some sort?

    There is a large flashing advertisement at the top of the page. Problem is, this is appearing on pages that shouldn't have any advertising.
    == This happened ==
    Not sure how often

    Hello Jim.
    You may be having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not coming from one of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] and select ''Disable all add-ons''. If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and theme. You can troubleshoot plugins the same way.
    If you want support for one of your add-ons, you'll need to contact its author.

  • My computer is new and i need to burn some sort of recovery info how do i

    do i actually have to type that all over again

    The Recovery Disks are used to boot from and reinstall your OS and drivers/software in the event of failure to boot or replacing the hdd.
    Use good quality DVD+R, I have good results with Sony. This page should help:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01867124&tmp_task=solveCategory&lc=en&dlc=en&cc...
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • Find and send solution urgent

    I have encountered the following exception when I run the
    following program using runtime.exec() in solaris. If you have
    some idea about it, please let me know.
    Thanks.
    ========= Exception Information ======
    java.io.IOException: Too many open files
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.forkAndExec(Compiled Code)
    at java.lang.UNIXProcess.<init>(Compiled Code)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.execInternal(Compiled Code)
    at java.lang.Runtime.exec(Compiled Code)
    at java.lang.Runtime.exec(Compiled Code)
    at java.lang.Runtime.exec(Compiled Code)
    at TestPro.run(Compiled Code)
    at TestPro.main(TestPro.java:29)
    ========= My Program ============
    I wrote the program in JSP on UNIX platform using tomcat server.
    Runtime.getRuntime.exec("sh coc.sh "+filename+" "+fileexec);
    it is successful execute and create the executefile of the filename(Example : filename.c)
    how to execute the fileexec file.
    i can use again Runtime.getRuntime.exec("fileexec");
    it is give above errors.
    please find out solution and send me immediatly.
    mail to : [email protected]

    It looks like Solaris cannot assign you a new file descriptor since all available descriptors are already in use. We have experienced the same problem under Solaris 7. A possible solution is to adjust the maximum number of open files in the /etc/system configuration file. Search for the following entry (or add it)
    * JVM often reports errors about too many open files
    set rlim_fd_cur=1024
    set rlim_fd_max=4096
    I think you will have to reboot the machine after changing the file.

Maybe you are looking for

  • Daily demand forecast report

    Hello, can you please help with the report design on Bex, I am a fresher on SAP BI. I have a requirement to design Daily demand tracker, report is published weekly, i have to show the fields in report as sunday, monday... soon, overall week total dem

  • Enabling Journal approval in 11.5.10.2

    Hi all, We have to enable journal approval in Oracle General Ledger on 11.5.10.2 .Can anyone suggest the steps for implementing this process. Regards, Sushank Vashishtha

  • Too large of file   ?

    My cs5 illustrator is having a really hard time running. I think that part of it is my laptop since it is only a 32bit but I've never so many problems with it before. I made a 20"x30" board layout and imported revit-rendered images into the file. The

  • HT201210 I have tried everything and can not get IPad 2 to restore, keeps giving me error message please help!!!!

    I had my IPad 2 jailbroken and deleted Cydia from it but still have some apps that are still on my IPad and no way to delete them. I have tried to restore it several times and it just keeps giving me an error message. I have tried deisabling firewall

  • Ipad Dropbox app cannot open some pdf files

    my Ipad Dropbox app cannot open some pdf files. The blue download bar appears and when download is complete, the wheel spins and spins and nothing happens. Some files are password protected. until recently, the password window would open. Now it does