cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1355
Views
0
Helpful
9
Replies

Remotely triggering EEM applet !

illusion_rox
Level 1
Level 1

hi all. I have created eem applets with event none on two routers. Now from HUB i want them to be triggered on demand. Like if i issue a particular cli command then in result eem is triggered remotely on those routers as well. How is this possible, can someone pls provide me a simple working example of it ?

1 Accepted Solution

Accepted Solutions

The advantage of languages like Perl and PHP is platform independence. Your programs should behave the same on any platform provided you do not rely on any native OS APIs (e.g. the Win32 Perl API).

Working with CiscoWorks, I have worked with Perl on both Windows and Solaris. The programs generally work the same on both. Where native interaction is required, conditional tests are used. For example:

if ($^O eq "MSWin32") {

# Do Windows things

} elsif ($^O eq "freebsd") {

# Do FreeBSD things

} elsif ($^O eq "solaris") {

# Do Solaris things

}

View solution in original post

9 Replies 9

Joe Clarke
Cisco Employee
Cisco Employee

This is easily doable assuming your EEM router is running EEM 2.4 or higher. In that case, you have two choices. One is to use the SNMP trap event detector. Then you can send an SNMP trap to the device, and trigger the applet. The other is by using the XML RPC event detector. I wrote a Perl API for interfacing with this API (including examples) which I've attached.

Documentation for both features can be found at http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6555/ps6815/whitepaper_c11-492226.html .

Dear Sir, thanks alot for the feedback, i will surely be rating it but there is one thing i want to ask bit OT. Sir as i mentioned in my other post about my development project, i am confused as to which language and/or platform shall i use. Since your caliber and expertise are too high, kindly suggest me which language to follow for building such network applications !. I thought of using C# but was surprised to see there is no lib for SSH client !!, i am totally confused now where to start. In my university days i have worked only with C and C#. I will be grateful if you could provide suggestion to me like a student, i will be grateful to you. Just point me to the right direction as to which platform you would like me to stick with.

Thanks in advance sir

Well, seeing as since I have an API for EEM RPC in Perl, Perl is a good choice. When I am deciding a language to use, I typically weigh all of the requirements. If SSH is a requirement, and there is no SSH client for C#, that kind of eliminates that option unless you're willing to write one.

C might be a bit of overkill for this project unless you require the performance. However, if C is the only other language you know, it certainly will be made to work.

The reason I did a Perl API is that most people writing tools to manage Cisco devices seem to be using Perl.

Dear Sir, what i actually wanted to ask is which language you as an expert will prefer. I dont mind learning something totally new, which helps me to write network based applications, like ssh and sending configurations to routers and all, so i am still bit confused as to which path i shall be taking. Hope you understand my confusion

For this type of thing, I would certainly use Perl. In addition to the EEM API, there are modules like Cisco::Net::Telnet, Cisco Perl Tools (http://sourceforge.net/projects/cipat/); plus, Perl even offers expect interaction if you need to interact with CLI commands with the Perl Expect module (http://search.cpan.org/~rgiersig/Expect-1.15/).

For me, I typically use Perl when I need to build CLI-based applications that don't require native performance. If I need to write a web-based application, I will typically use PHP. If I need a GUI-based application, I go with Java.

If I require an application requiring native performance, I will go with C. Some people would recommend C++, but I never did get into it.

Thanks alot sir, this was kinda feedback i expected from you, thanks again. Which platform you work from ? linux or windows ?

Neither. I prefer FreeBSD.

Dear Sir, you mean running perl and php on freebsd ? do you think it will be fine for starter like me to start with windows for now ? i have also heard that network programming is bit different for both platforms (windows and linux flavours) so sir what you think ?

The advantage of languages like Perl and PHP is platform independence. Your programs should behave the same on any platform provided you do not rely on any native OS APIs (e.g. the Win32 Perl API).

Working with CiscoWorks, I have worked with Perl on both Windows and Solaris. The programs generally work the same on both. Where native interaction is required, conditional tests are used. For example:

if ($^O eq "MSWin32") {

# Do Windows things

} elsif ($^O eq "freebsd") {

# Do FreeBSD things

} elsif ($^O eq "solaris") {

# Do Solaris things

}

Review Cisco Networking for a $25 gift card