Sponsored Content
Top Forums Shell Programming and Scripting Perl telnet to cisco router and compare the ping ms Post 302133492 by optimus on Thursday 23rd of August 2007 02:35:38 PM
Old 08-23-2007
robotronic thanks ...

Thanks for robotronic 's help.
but i was mistake the result i obtain from the router must be look like this

"Router#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 104/104/104 ms
Router#"


there must be 7 lines how can i get the middle average value

in addition, how i can handle the non standard reply , (e.g the remote cannot be ping)

Router#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
U.U..
Success rate is 0 percent (0/5)
Router#

anyway, thanks for robotronic 's help as I had already search for a very long time for nothing.

Last edited by optimus; 08-23-2007 at 03:59 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cisco Router command to get hostname

Hi All, I am connected to a cisco router and I want to know the hostname of this router. I connect as telnet <IPADDRESS> and the prompt shows vpnaccess-bristol> But I want to know the full hostname of the router how can i do that. When i type the hostname command the following... (3 Replies)
Discussion started by: rahulrathod
3 Replies

2. IP Networking

Linux behind a cisco router

Dear All, I have worked with xDSL routers working in bridged mode, and linux behind them working as a Firewall utilizing IPTABLES. My question is, how this will change if the xDSL router is replaced with a Cisco Router? I mean to ask that, can I assign a public ip on the linux machine, which... (0 Replies)
Discussion started by: tmm
0 Replies

3. IP Networking

isc dhcpd and cisco router

Hello all, I have set up dhcpd on a linux box for serving subnets on multiple vlans configured on a Cisco 6500 with ip helper of the dhcp server. Servers get dhcp leases just fine, however, some machines lose their connection for reboot or what not and I can not get their lease back even though... (0 Replies)
Discussion started by: closedown
0 Replies

4. Shell Programming and Scripting

perl telnet issue with cisco

Hi Experts, I am using perl to telnet on cisco boxes. We have this stupid cisco node which does not support "terminal Length0" command. Since I am using Net::Telnet and capturing output with @output = $telnet->cmd('cmd'); Say @output = $telnet->cmd('show version'); Now problem... (2 Replies)
Discussion started by: mtomar
2 Replies

5. Shell Programming and Scripting

Perl variables inside Net::Telnet::Cisco Module doesn't work

I am writing perl script to configure Cisco device but Variables inside Net::Telnet::Cisco Module doesn't work and passed to device without resolving. Please advise. here is a sample of script: use Net::Telnet::Cisco; $device = "10.14.199.1"; ($o1, $o2, $o3, $o4) = split(/\./,$device);... (5 Replies)
Discussion started by: ahmed_zaher
5 Replies

6. Shell Programming and Scripting

Animation Ping on Solaris Like Cisco Ping

Hi, I develop simple animation ping script on Solaris Platform. It is like Cisco ping. Examples and source code are below. bash-3.00$ gokcell 152.155.180.8 30 Sending 30 Ping Packets to 152.155.180.8 !!!!!!!!!!!!!.!!!!!!!!!!!!!!!. % 93.33 success... % 6.66 packet loss...... (1 Reply)
Discussion started by: gokcell
1 Replies

7. Shell Programming and Scripting

Perl Telnet cisco routers

Hi all i have little problem finding solution about simple telnet script .... i have 250 routers and on some i have different password and on some they ask just for password no username. So for example 1,2,3 have username and password (user,password) 4, and 5 have different username and password... (0 Replies)
Discussion started by: IvanMP
0 Replies

8. Shell Programming and Scripting

Perl telnet to router run commands from file

I have a perl script that is called with a router name command list file and output file. The command file can be very large, up to 3k of commands. At first I dumped the command list file to an array and ran the entire file on the router and captured the output. It worked ok for a command list in... (1 Reply)
Discussion started by: numele
1 Replies

9. IP Networking

Need help configuring Cisco 892-k9 router

I bought a Cisco 892-k9 router and I am having in issue trying to setup the initial configuration. Does someone have a sampl configuration for a single subnet that I can use for my configuration? Thanks. (0 Replies)
Discussion started by: gandolf989
0 Replies
Smokeping_probes_TelnetJunOSPing(3)				     SmokePing				       Smokeping_probes_TelnetJunOSPing(3)

NAME
Smokeping::probes::TelnetJunOSPing - Juniper JunOS Probe for SmokePing SYNOPSIS
*** Probes *** +TelnetJunOSPing forks = 5 offset = 50% packetsize = 100 step = 300 timeout = 15 # The following variables can be overridden in each target section junospass = password # mandatory junosuser = user # mandatory pings = 5 psource = 192.168.2.129 source = 192.168.2.1 # mandatory # [...] *** Targets *** probe = TelnetJunOSPing # if this should be the default probe # [...] + mytarget # probe = TelnetJunOSPing # if the default probe is something else host = my.host junospass = password # mandatory junosuser = user # mandatory pings = 5 psource = 192.168.2.129 source = 192.168.2.1 # mandatory DESCRIPTION
Integrates Juniper JunOS as a probe into smokeping. Uses the telnet protocol to run a ping from an JunOS device (source) to another device (host). This probe basically uses the "extended ping" of the Juniper JunOS. You have the option to specify which interface the ping is sourced from as well. VARIABLES
Supported probe-specific variables: forks Run this many concurrent processes at maximum Example value: 5 Default value: 5 offset If you run many probes concurrently you may want to prevent them from hitting your network all at the same time. Using the probe- specific offset parameter you can change the point in time when each probe will be run. Offset is specified in % of total interval, or alternatively as 'random', and the offset from the 'General' section is used if nothing is specified here. Note that this does NOT influence the rrds itself, it is just a matter of when data acqusition is initiated. (This variable is only applicable if the variable 'concurrentprobes' is set in the 'General' section.) Example value: 50% packetsize The (optional) packetsize option lets you configure the packetsize for the pings sent. Default value: 100 step Duration of the base interval that this probe should use, if different from the one specified in the 'Database' section. Note that the step in the RRD files is fixed when they are originally generated, and if you change the step parameter afterwards, you'll have to delete the old RRD files or somehow convert them. (This variable is only applicable if the variable 'concurrentprobes' is set in the 'General' section.) Example value: 300 timeout How long a single 'ping' takes at maximum Example value: 15 Default value: 5 Supported target-specific variables: junospass The junospass option allows you to specify the password for the username specified with the option junosuser. Example value: password This setting is mandatory. junosuser The junosuser option allows you to specify a username that has ping capability on the JunOS Device. Example value: user This setting is mandatory. pings How many pings should be sent to each target, if different from the global value specified in the Database section. Note that the number of pings in the RRD files is fixed when they are originally generated, and if you change this parameter afterwards, you'll have to delete the old RRD files or somehow convert them. Example value: 5 psource The (optional) psource option specifies an alternate IP address or Interface from which you wish to source your pings from. Routers can have many many IP addresses, and interfaces. When you ping from a router you have the ability to choose which interface and/or which IP address the ping is sourced from. Specifying an IP/interface does not necessarily specify the interface from which the ping will leave, but will specify which address the packet(s) appear to come from. If this option is left out the JunOS Device will source the packet automatically based on routing and/or metrics. If this doesn't make sense to you then just leave it out. Example value: 192.168.2.129 source The source option specifies the JunOS device to which we telnet. This is an IP address of an JunOS Device that you/your server: 1) Have the ability to telnet to 2) Have a valid username and password for Example value: 192.168.2.1 This setting is mandatory. AUTHORS
S H A N <shanali@yahoo.com> based HEAVILY on Smokeping::probes::TelnetIOSPing by John A Jackson <geonjay@infoave.net> based on Smokeping::probes::JunOSPing by Paul J Murphy <paul@murph.org> based on Smokeping::probes::FPing by Tobias Oetiker <tobi@oetiker.ch> NOTES
JunOS configuration The JunOS device should have a username/password configured, as well as the ability to connect to the VTY(s). Some JunOS devices have a maximum of 5 VTYs available, so be careful not to hit a limit with the 'forks' variable. Requirements This module requires the Net::Telnet module for perl. This is usually included on most newer OSs which include perl. Debugging There is some VERY rudimentary debugging code built into this module (it's based on the debugging code written into Net::Telnet). It will log information into three files "TIPreturn", "TIPoutlog", and "TIPdump". These files will be written out into your current working directory (CWD). You can change the names of these files to something with more meaning to you. Password authentication You should be advised that the authentication method of telnet uses clear text transmissions...meaning that without proper network security measures someone could sniff your username and password off the network. I may attempt to incorporate SSH in a future version of this module, but it is very doubtful. Right now SSH adds a LOT of processing overhead to a router, and isn't incredibly easy to implement in perl. Having said this, don't be too scared of telnet. Remember, the original JunOSPing module used RSH, which is even more scary to use from a security perspective. Ping packet size The FPing manpage has the following to say on the topic of ping packet size: Number of bytes of ping data to send. The minimum size (normally 12) allows room for the data that fping needs to do its work (sequence number, timestamp). The reported received data size includes the IP header (normally 20 bytes) and ICMP header (8 bytes), so the minimum total size is 40 bytes. Default is 56, as in ping. Maximum is the theoretical maximum IP datagram size (64K), though most systems limit this to a smaller, system-dependent number. 2.6.8 2013-03-17 Smokeping_probes_TelnetJunOSPing(3)
All times are GMT -4. The time now is 09:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy