Sign in to follow this  
Followers 0
jeebz

Need help with monitoring a continuous ping

4 posts in this topic

Hello,

I am having some trouble reading the output from a certain type of ping tool I use (http://www.cfos.de/en/ping/ping.htm).

The command in question is : hrping <IP> -s 130 -l 30 -t -y

post-67577-0-09341000-1357937841_thumb.j

Above is a screenshot of the output (with IPs removed)

My goal is to have a look at this output and continuously monitor the average ping as well as the packet loss % and give me a warning when they go beyond a certain threshold.

I am not looking for someone to make this for me really, but I am having trouble getting AutoIT to get anything out of this application.

#include <Constants.au3>
Local $testhrping = Run(@ComSpec & " /k c:\temp\hrping\hrping.exe 192.168.0.1 -s 130 -l 30 -t -y", "", @SW_SHOW, 0x8)
Local $line, $line2
While 1
$line = StdoutRead($testhrping)
$line2 = StderrRead($testhrping)
MsgBox(0, "", $line & @CRLF & $line2 & @CRLF)
WEnd

This is what I have attempted so far to try and get something out of here but I am having no luck.

I have tried some other variations, including trying to output to a text file and just keep checking the text file as it overwrites itself. Again no luck.

Any help on the matter would be greatly appreciated!

Thanks!

post-67577-0-09341000-1357937841_thumb.j

Share this post


Link to post
Share on other sites



It appears that the program in question doesn't output to the standard streams, I ran the script (once I got it working) and never saw anything on either stream. Also, when piped to save to a file, all I got was this in the file.

This is hrPING v5.04 by cFos Software GmbH -- http://www.cfos.de

Source address is 192.168.2.3; using ICMP echo-request, ID=e00e

Pinging 192.168.2.1 [192.168.2.1]

with 30 bytes data (58 bytes IP):

[Aborting...]

Packets: sent=131, rcvd=131, error=0, lost=0 (0.0% loss) in 16.901643 sec

RTTs in ms: min/avg/max/dev: 1.199 / 3.731 / 88.283 / 10.191

Bandwidth in kbytes/sec: sent=0.449, rcvd=0.449


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Thanks for giving it a shot.

That's exactly what I get as well. I was hoping someone had some way of working around this :(

Thanks again!

Share this post


Link to post
Share on other sites

I found this concept which might work. What do you think?

It pretty much selects all from the cmd.exe, dumping it to clipboard. You then search the clipboard for what you are looking for.

Unfortunately, I don't believe AutoIT will let me do this in the background as it uses the Send function to get everything in to the clipboard.

I would appreciate you opinion, as you seem to be pretty good at AutoIT (I have been reading these forums for 2 days straight and you post all over the place).

Thanks in advance!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0