EEM on N3K with regexp / foreach like function

Hi
I noticed that ISR-G2 with IOS can support the subjected function. Actually, I build a function on ISR-G2 with EEM Applet to monitor local interface status. If syslog returns interface down then it will telnet to other device to no shut interface as network resiliency
event manager applet TSET
event syslog pattern "Line protocol on Interface.*changed state to down"
action 1.0 regexp "Interface ([^,]+), changed state to down" "$_syslog_msg" match intf state
action 2.0 syslog msg "$intf is down"
action 3.0 cli command "enable"
action 3.1 cli command "config t"
action 3.2 cli command "interface $intf"
action 3.3 cli command "shut"
action 4.1 cli command "telnet 2.2.2.2" pattern ">"
action 4.2 cli command "enable" pattern "Password:"
action 4.3 cli command "cisco" pattern "#"
action 4.4 cli command "config t" pattern "#"
action 4.5 cli command "inter $intf" pattern "#"
action 4.6 cli command "no shu" pattern "#"
action 4.7 cli command "end" pattern "#"
But when I move to N3K, it seems N3K doesn't provide "regexp", instead it provides "Python" engine. Can someone give me hints to perform such function call on N3K by translating my code on EEM Applet to EEM Python or VSH on NXOS?
Tks
Leon

There is no comparable EEM capability on the N3K for what you have here.  While it is possible to call a Python or Tcl script from an EEM applet on the N3K, such an action has not been tested and thus is not officially supported.  Additionally, I believe you will have to use a socket API in Tcl or Python to do what you want.  Wrapping the telnet command is probably not going to work as you don't have the same CLI library capabilities that you do in IOS.
I don't have any familiarity with sockte programming Python, but perhaps others can offer some guidance there.  In terms of resources, there are plenty of Python courses and documentation out there.  My favorite is
http://www.codecademy.com/tracks/python .

Similar Messages

  • Websheet like functionality

    Hi all,
    I am getting ready to embark on a project for a client where they want to minimize the pasing of spreadsheets via email. They are finally tired of getting burned when someone they have sent the spreadsheet to changes data theay shouldn't have or re-arranges columns, or .......
    They would like to use websheets but can't as they aren't available in a runtime apex environment. I read an article recently that talks about how to get them to work in the runtime environment but that's just not feasible for this client.
    Baring some miracle that runtime websheets become available in the near term I am faced with creating "websheet like" functionality.
    Here are the basics of what I am thinking about and I would appreciate any comments or suggestions;
    Create a generic file uploader that allows the user to push a file into the database.
    - Using the file browse functionality upload the file into a staging table
    - validate the data in the staging table based on basic data type provided by the user
    - allow the user to specify a table name and push the data into the table
    All of this is similar to something I've done before and don't expect the few changes to be an issue. The next part is where I am most interested in suggestions and comments.
    Now that the spreadsheet has been loaded I want to create a generic tabular form that will allow the users to review / edit the data. I've done this before using a collection and can do so again but it just doesn't seem like the best solution this time. Is there another method of accomplishing this?
    Once I have the form then I need reports. I know I can do a standard report and retrieve a query to generate the report but would prefer an interactive report. If I go for an IR then to the best of my knowledge I am forced down the collection path again. Is there another method of accomplishing this?
    The last piece would be allowing the person that uploaded the spreadsheet to download the finished product. I've seen some examples of creating your own download procedure and assume that is the way I will go with this as well.
    All told I see this application havind no more than 6 - 8 pages even if I do the upload as a wizard based approach. Any suggestions would be appreciated.
    Thanks
    Tom

    Hi all,
    Just one last check to see if anyone has a suggestion before I get started.
    Thanks
    Tom

  • Java networking library with RMI-like functionality?

    Is anyone aware of a Java networking library, that provides RMI like functionality and TCP/IP with an intuitive API and minimal coding required? I'm working on a prototype, but I'm having difficulty getting Java's RMI functionality working through Netbeans, so while I'm prototyping I'm looking for alternatives so I can code more and frustrate less!
    Thanks

    BobCrivens wrote:
    Thanks ejp.
    I guess I'll re-phrase the original question. Is there a small open-source Java networking library that doesn't include RMI, but gives a simple API for TCP/IP connections (higher level than sockets) and includes file transfer? I don't know if I need things like FTP/HTTP/POP/SMTP support etc for now.
    ThanksI gotta be honest with you here. I think you need to stop coding for now and get your requirements in hand with a better grasp on how network programming works.
    Not being insulting here but your questions show your current knowledge level on the subject to be not really sufficient for success with whatever it is you want to do.
    There is the networking tutorial available here http://java.sun.com/docs/books/tutorial/networking/index.html but it might do you well to tell us exactly what you are trying to do. Are you trying to build an FTP client? Are you trying to build a whole client/server program of some sort?
    Because everything now is very vague. You seem to be looking for protocols or API's between TCP and things like FTP for example and none exist because these sit directly on top of TCP. So you either deal directly with the Sockets or you deal with some library that deals with the protocol in question. There isn't an "in-between" layer here.

  • How to use LIKE function with a parameter in Oracle REPORT builder??

    how could i use parameter inside a LIKE function in Oracle reports builder?
    it works in SQL plus, but not in report builder!!
    Example:
    select code,desc from item_master where desc
    like '%&give_desc%'; ---works in SQL
    like '%:give_desc%' ---doesn't work in report builder!!

    Hi Renil,
    You will need to use the wildcard character (%) and the concatenation character (||) to join to your user parameter.
    i.e. like '%'||:give_desc||'%'
    Regards,
    John

  • How to use variable in the LIKE function along with % operators

    Hi,
    Is there any way i can use the variable in the Like function. That means i have query like
    SELECT * FROM Device WHERE DeviceName LIKE %v_MediaName%;
    Here "v_MediaName" is the userdefined variable which contains string. I want to retrieve all the records from the "DEVICE" table whose DeviceName LIKE %v_MediaName%;
    If i put it in a single quotes '%v_MediaName%' then the v_MediaName will be treaded as a string instead of a variable. I am using this query in a Procedure.
    please help me out to resolve the issue.
    thanks

    LIKE '%'||v_MediaName||'%';
    Will not make use of the indexes though.
    Message was edited by:
    satishkandi

  • Is there any hope of apple adding a 're-link with media folder'-type function to iTunes?

    Is there any hope of apple adding a 're-link with media folder'-type function to iTunes?
    I have 1000s of broken links after installing the latest version of iTunes and updating some files in my media folder. The location of my itunes library has not changed, and all the files are there (I know because I've just waited several hours for the files to be updated by my ultra-slow computer) - by my logic, there should be some menu option that simply re-synchronises with the media folder, just like itunes would do with an ipod - it can't be that hard can it? The only way I can restore a link is by clicking every song (I have over 28,000) and locating the file in the folder that iTunes claims to use as its media folder - the new version 10 option of then using this location to restore all broken links doesn't work because it only looks in the specific album file, and after a couple of times this dialog box no longer even comes up, so I couldn't ask it to do this even if I wanted to. At the moment the only option I can see is to completely wipe iTunes and re-load all my music from scratch - using my tired and over-worked computer this will realistically take around 15 hours that I don't have, and my computer will melt in the process. I wish I'd never tried to 'tidy up' my iTunes library...
    PLEASE Apple, how hard can it be to have a function that searches for and restores broken links by itself????? I've told you where the music is - just flipping look for it yourself instead of getting me to do it!

    You don't have to re-rip, re-import or re-download all your content. You can clear the iTunes library, either by selecting all in the libary and pressing the Delete key, saying "no" when it asks if you want to remove the files themselves, and then use the Add To Library command, selecting the iTunes Media folder (or iTunes Music folder, as applicable to your situation), and that will add back all your content. It shouldn't take more than a few minutes; if it does, something may be amiss with your hard drive or the library file is corrupted (in which case just delete the library file and re-do the Add To Library command).
    Regards.

  • Is it possible to create a tree with drag-and-drop functionality using ajax

    I saw these samples;
    Scott Spendolini's AJAX Select List Demo
    http://htmldb.oracle.com/pls/otn/f?p=33867:1:10730556242433798443
    Building an Ajax Memory Tree by Scott Spendolini
    http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    Carl Backstrom ApEx-AJAX & DHTML examples;
    http://htmldb.oracle.com/pls/otn/f?p=11933:5:8901671725714285254
    Do you think is it possible to create a tree with drag-and-drop functionality using ajax and apex like this sample; http://www.scbr.com/docs/products/dhtmlxTree/
    Thank you,
    Kind regards.
    Tonguç

    Hello,
    Sure you can build it, I just don't think anyone has, you could also use their solution as well in an APEX page it's just a matter of integration.
    Carl

  • Problem using LIKE function

    Hi Guyz,
    I am having small problem using LIKE function . The problem is I am using LIKE function in the WHERE clause
    to compare a column to a particular value, which gets this value from the front end. If the user has a single quote in the string he entered then the LIKE function is not working because of the single quote. Is there any way I can escape the single quote like we escape '%' and '_'.
    Thankyou.

    Mod_plsql supports bind variables, as do almost all front-end tools that deal with Oracle (and most other databases). I do not code mod pl/sql myself, but others here do, and I see bind variables in their code all the time (if I don't, they hear from me :-)).
    If you pass a bind variable, the quote problem goes away. As far as I know (which is not very far), you should be able to take the string with the quote directly from your input field, bind it to the variable in your query and have no problems.
    I suspect that the reson you are having issues is that you are just gluing strings together to create a sql statement. this is the wrong approach.
    The java term for what you are looking for is prepared statement, I'm not sure what the equivalent is i mod plsql, but that should give you a start.
    John

  • Proxy Server asking for username and password almost 6 times for every page I load, but the same doesn't happen with other browsers like chrome

    The same question keeps popping up again and again "The proxy moz-proxy://proxy.iitm.ac.in:3128 is requesting a username and password. The site says: "moz-proxy://proxy.iitm.ac.in:3128""
    Even after i give the right details, it asks me like 5 more times before it completely loads the page. Some times it happens only 2 times.
    With other browsers like chrome, it asks only in the beginning. it doesn't occur after that.
    This started occurring only recently. i upgraded to firefox 9.0 and it functioned properly for more than 12 hours before it started occuring. i tried downgrading back to 8.0.1 but the problem still continued.

    i'm afraid i need to use proxy settings to connect to internet. The settings are all fine because it used to work properly all this time. i specify the proxy address and the port, which is correct, i am very confident. it is so because the page actually loads on firefox, but not before it asks for my user name and password for it a lot of times, and for every page. for other browsers, it asks only in the beginning, that is, when i start the browser.
    i've put three pics here. under the first two settings, the third image showing the user name and password thingy popping up. this happens a lot of times for every page.

  • Windows 2008 R2 domain controllers with Windows 2003 forest functional level Supported after Windows 2003 support ends in July 2015

    Hi
    Anyone knows whether Windows 2008 R2 domain controllers with Windows 2003 forest functional level will still be Supported after Windows 2003 support ends in July 2015 ?
    Thanks

    When Windows Server 2003 support ends, you should not have a Windows Server 2003 Domain Controller running if you would like to be supported by Microsoft. This means that there will be no reason to have a DFL or FFL that is lower than Windows Server 2008.
    So, if you are keeping Windows Server 2003 FFL to keep DCs running Windows Server 2003 then this is not supported.
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • Any RunningApplications-like function for non-windowed processes?

    Am I missing any RunningApplications-like function for non-windowed processes like Unix executables? To start with I'd settle for processes in user-space but would ultimately like to list processes like Activity Monitor does. Even comparing RunningApplications results to user space Activity Monitor results will show the difference.
    As far as I can tell you need to go all the way down to kauth and kernel space to watch for non-windowed processes being launched. Is there somethig in-between I'm missing? A notification device about launching apps would be perfect if it cover all processes.
    Thanks,
    =Tod

    I think kqueue may be able to do what you want. Look at the EVFILT_PROC filter. You may have to watch a number of processes - perhaps all of them. But that would tell you any time you get a fork and whenever a process is reaped.
    I looked at kqueue at it does what I want but you need to register it on a by process/file basis which is great for a very specific set of things but not for overall system watching. (I also looked at fsevents but it is designed as a post-event notification system.) While NSWorkspace has the usual Cocoa model notifcation willlaunchApp, didlaunchApp, etc it seems that you need to get the kernel to watch the launch lifecycle of non-windowed functions.
    I actually did manage to get a comprehensive list of running apps out of parsing sysctl output with much less trouble than I expected. So far I have managed to get the pid, uid and abbreviated processname and the list seems to match the Activity Monitor list - at least at this testing printf stage. Getting the username from uid should be trivial and the full file name is doable it just requires some struct length and offset math. I'd like the launch path information but I can live without it for monitoring purposes if I can't figure out how to get it.
    This means that the monitoring part of the running system seems relatively straight forward - wrapping the call in an NSTimer and watching for changes in the returned results. But the watching of the actual starting and stopping of all processes remains some deeper work.
    Thanks for all the suggestions,
    =Tod

  • Statistical calc with MDX question (Mode function as an excel)

    Hi All,
      I need to create an MDX Calc to Returns the most frequently occurring, or repetitive, value in an array or range of data.
      For example, the mode of 2, 3, 3, 5, 7, 10 is 3.
      In Excel I use the MODE() function but I don't know how to do this in MDX and add it as a measure in Universe.
      I can't do the formula in WEBI because we have big data volume and I can't retrieve all the customers in WEBI.
      We have SAP BW 7.0 and SAP BusinessObjects XI 3.1 fix pack 1.3
    Thanks in advance.

    Hi,
    it looks like you created the entry twice so I would suggest you close on of them:
    Statistical calc with MDX question (Mode function as an excel)
    I don't think that those kind of statistical functions are available in MDX. you can always go to se37 and use the bapi_get_functions to see the list of supported functions.
    Ingo

  • RFC call ended with "Communication Failure" exception (Function call failed; could not find the function

    Hi All,
    I am getting error while executing oDATA service from SAP Netweaver Gateway
    Error details:
    RFC call ended with "Communication Failure" exception (Function call failed; could not find the function
    I am using SAP NG 740
    Project is created in Gateway system using SEGW having Map to Datasource option used.
    in SPRO manage alias, I had seleted Local App option. Screen attached
    I had tried all troubleshooting like delete and add service and alias in "/IWFND_MAINT_SERVICE".
    but still getting same error for all service.
    Kindly advise.
    Regards
    Vivek

    Hello Vivek,
    Service builder would have also generated code for RFC Exception handling to catch exceptions raised when communication fails between your GW and BE for some reasons.
    Handling is done for 1. System Failure 2. Communication Failure & 3. Business Failure;
    Put a BP in your DPC or DP_EXT class where exception code is written to check what exactly is has caused communication failure.
    Check if that RFC is existing in that destination or not.
    For your reference  : Code would be something like this. Put BP here and check the problem.
    * Error and exception handling
    IF lv_subrc <> 0.
    * Execute the RFC exception handling process
       me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(
         EXPORTING
           iv_subrc            = lv_subrc
           iv_exp_message_text = lv_exc_msg ).
    ENDIF.
    Go inside this method and check to get info on what has to be done to resolve issue.
    Check carefully what has gone wrong and fix it accordingly.
    No need of adding service & deleting as problem is not because of that.
    Regards,
    Ashwin

  • Sitegrinder-like Functionality Native to Photoshop

    I'm wondering if Adobe has any plans of adding Sitegrinder-like functionality to Photoshop or perhaps as another Adobe product. This plugin is used by a lot of professionals and with its price tag it's obviously something I think Adobe should look into as a revenue stream. (Sitegrinder creates HTML/CSS from PSD files)
    In addition, the new Divine Plugin is going to allow PSD directly into Wordpress themes.
    These two plugins seem right up Adobe's alley, I'd love to see them included in PS or as a new program.

    I thought about the same thing years back when I first tried SG and didn't have the desire to fuss with DreamWeaver. I hope Adobe buys SG so the MediaLab team can retire in style.

  • Problem with active noise cancellation function : ...

    My nokia 6720 have problem with active noise cancellation function. It seem not working because it also have noise when this function is active. So, I try to disable this function and found that the noise is reduce (but still not clear). How do I correct this problem?
    Thanks.
    P.S. Firmware version is 012.008

    "I must must achive a segnificant attenuation of the noise in a closed volume using some NI devices ..."
    At first glance I would say "probably can be done using an FPGA as a target" since the FPGA can close a very fast loop.
    But to do that with a microphone input on a PC running Windows...
    I suspect that would be an exercise in futility.
    Anyone out there been able to turn around a microphone input fast enough to something like this?
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for