BLOG     |     FORUM
Welcome, Guest
Username: Password: Remember me
All your questions answered real quick by Unleash Networks Engineers.
  • Page:
  • 1

TOPIC: how to stop and automatically save the usnf files.

how to stop and automatically save the usnf files. 7 years 9 months ago #3778

  • Andy
  • Andy's Avatar
  • OFFLINE
  • Karma: 0
I have followed you sample script to start unsniff from a command line and start monitoring traffic.

I see in the "Specify Capture Stop Conditions" where time, packet count, byte count, and/or file size may be used as triggers to stop the capture....

1) Is there a way we can trigger the "stop capture" from an external trigger such as a script file?

2) is there a way we can trigger saving of the capture data to a usnf file automatically or programmatically?

Thus far we really like unsniff, but we do need to fully automate the process.

Thanks,
Andy
The administrator has disabled public write access.

how to stop and automatically save the usnf files. 7 years 9 months ago #3779

Hi Andy,

Currently the stop conditions are limited to the ones you listed.

We would need to add support for a non interactive way to stop capture and save the USNF file and exit cleanly. It shouldnt be that hard to implement. Please check back this thread in a couple of days.

BTW: This method would start the User Interface, are you looking to run the capture silently or is this okay ?

Thanks,
Vivek R
Unleash Networks
Support : www.unleashnetworks.com/forums
The administrator has disabled public write access.

how to stop and automatically save the usnf files. 7 years 9 months ago #3780

  • Andy
  • Andy's Avatar
  • OFFLINE
  • Karma: 0
Hello Vivek,

"support for a non interactive way to stop capture and save the USNF file and exit cleanly" would be fantastic.

Running the capture silently would be nice, but not essential.

I'll keep an eye on this thread.

Thanks,
Andy
The administrator has disabled public write access.

how to stop and automatically save the usnf files. 7 years 9 months ago #3789

Hi Andy,

Can you use the Windows Script Host SendKeys method to automate the stopping process ? This is the way to go until we enable scripting of the capture process itself in the next release. See support.microsoft.com/kb/259103



The following script finds a running Unsniff App, Stops the capture, saves it into a file, and quits the application. I've added messages to help you understand what its doing.
Set WshShell = CreateObject("wscript.Shell")

WScript.stdout.WriteLine "Activating running instance of Unsniff"
WshShell.AppActivate("Unsniff Network Analyzer")
WScript.Sleep(2000)


WScript.stdout.WriteLine "Stopping the capture Menu: Capture -> Stop "
WshShell.SendKeys("%cp") 
WScript.Sleep(2000)

WScript.stdout.WriteLine "Saving the file Menu: File -> Save"
WshShell.SendKeys("%fs") 
WScript.Sleep(2000)


WScript.stdout.WriteLine "Supplying a file name to save i"
WshShell.SendKeys("mysavedfile-999.usnf") 
WScript.Sleep(1000)
WshShell.SendKeys("{ENTER}") 
WScript.Sleep(10000)


WScript.stdout.WriteLine "Stopping Unsniff Alt+F4"
WshShell.SendKeys("%{F4}") 


Whenever you determine it is time to stop Unsniff just run the above script. You may wish to increase the 10000 ms (10sec) timeout if your files are big and need more than 10 secs to save.
cscript  stopunsniff.vbs



I've tested the above and it works fine. Let me know how this goes !

Thanks,
Vivek R
Unleash Networks
Support : www.unleashnetworks.com/forums
Last Edit: 7 years 9 months ago by vivek [unleash]. Reason: incomplete and typos
The administrator has disabled public write access.

how to stop and automatically save the usnf files. 7 years 9 months ago #3796

  • Andy
  • Andy's Avatar
  • OFFLINE
  • Karma: 0
Thank you sir!

It works.
I did make one small adjustment...

I changed (File Save):
WshShell.SendKeys("%fs")
to (File Save As):
WshShell.SendKeys("%fa")

Which allows us to specify a fully qualified path to the where we want to save the file.

Andy
Software Validation Engineer
The administrator has disabled public write access.

how to stop and automatically save the usnf files. 3 years 11 months ago #4646

  • JimmyDoor
  • JimmyDoor's Avatar
Thank you one more time. forum.iezvu.com/phpBB3/viewtopic.php?f=2...41&p=126111#p126111. You also will like this forum, enjoy.
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: vivek [unleash]
Time to create page: 0.044 seconds