Scheduling start/stop of PingPlotter Pro tracing
Is there any way to set up PingPlotter Pro to start tracing at a certain time during the day (7:00 am, say) and stop tracing later (22:00/10:00 pm)?
PingPlotter Pro does not have a scheduler built in, but you can use the Windows scheduler to do this.
There are a few requirements for making this work
- You must be running PingPlotter Pro as a service.
- You must want to start / stop all targets at the same time (if you have other requirements, we can probably help you achieve them, but this documentation only covers starting / stopping all targets)
- You must use the Windows Scheduler for this
This is a relatively comprehensive instruction set for setting up monitoring during a time period only, but going on for an indefinite period of time (example: 7am to 10pm every day, forever).
Configuring the service
These instructions work only in if you're using PingPlotter Pro as a service, so make sure you follow the instructions on doing that:
You'll want to have the service running and tracing while you work on this - as this gives you a way to test things. Check to make sure you're working with the service instance by checking the 'File' menu and make sure the 'Exit' command is disabled (if you're using Windows terminal services, see here.
Create a workspace, set everything up. If you want to test things out, stop and then restart the PingPlotter service. You can do this from the command line like this:
net stop pingplotter
net start pingplotter
If PingPlotter Pro starts tracing again and has all the history in memory, then you know everything is working. This is very nice because you'll be able to reboot during the day if you need to and PingPlotter Pro will resume after the reboot, plus automatically start without logging off.
Setting the memory footprint
OK, so now we need to change the methods for starting and stopping the trace on schedule. The following instructions will leave all history in memory, but it will stop the trace at the scheduled time and restart it again at the scheduled start time. You'll want to set your 'Maximum samples to hold in memory' to something reasonable. See here for details.
Extracting the new scripts.
Download the start and stop scripts from here:
Extract these to a directory of your choice. The PingPlotter install directory will work fine. You can test these scripts by double-clicking them once you get them extracted. You'll notice only that running the 'Stop' script will stop everything in PingPlotter (the stop/start/resume button will change to 'Resume'). Running the 'Start' script will resume whatever targets you have there.
Note that these scripts work on all targets, so you can run multiple traces and all of them will be stopped and restarted.
History will not be cleared. We can clear the history, but following the instructions above on long-term monitoring will keep your memory footprint low, so this isn't necessary.
Creating the new schedule
We use the Windows Task Scheduler to set up the schedule for starting and stopping - a relatively powerful, easy way to schedule things in Windows. To access this, go to your control panel and open the 'Scheduled Tasks' entry.
- Create a couple of new entries. Double-click on 'Add Scheduled Task'. A wizard should appear - hit the 'Next' button. If your machine has as lot of applications on it, this will take a while.
- When you see a list of applications, hit the 'Browse' button. Browse to the directory with 'StopAllTraces.vbs' and pick it.
- Pick 'Daily', and the appropriate start time to stop tracing (19:00 to stop tracing at 7pm), Every Day, Starting today. Hit 'Next'.
- Now, you need to pick a user context to run under. You can use your user account, but if you're running on a domain, it's probably best to do a local account (Administrator? Something similar?) that won't have its password changed regularly, since you'll have to change it here too (this is where WinAT was better, but it offered no troubleshooting capabilities, which makes this better). You can change this later, so you can enter your username / password if you want to here, for testing.
- 'Finish' through the rest.
- Repeat for 'StartAllTraces.vbs', and pick your start time (07:00, or whatever is appropriate for your trace start time).
There is also a script included called 'ResetAllTraces.vbs' which can be run if you want to delete all collected data and start a new data set at some scheduled time. Maybe you want each week in its own data file - schedule a call to the 'ResetAllTraces.vbs' at the time you want it to happen.
OK, we're all configured. You can test this out by right-clicking on the task and selecting 'Run'. Check in PingPlotter Pro and make sure things are stopped / started appropriately. Of course you won't know if things work on time correctly unless you wait through the right time period, but I'm sure you can find creative ways around this to test if needed.
Hopefully, this should get things working the way you expect. If it doesn't work, or if it should work differently, let us know at firstname.lastname@example.org.
There are some security issues with using the Windows Scheduler - you have to specify a user account, along with password. If you regularly change your password, there are a couple of possiblities for this. 1) You can create a local account on your computer that has a non-changing password or 2) you can use AT (or WinAT) instead of the Windows Scheduler. It's not as user friendly, but it will work with a service.
If you want to create a local account, that's a pretty straightforward task and we're not going to give step-by-step instructions on how to do this. We will, though, give some basic instructions on WinAT.
How to use WinAT instead of Windows Scheduler
Any tasks that you set up using WinAT can be seen in the Windows Scheduler GUI, but not edited. You can also use the AT command from the command prompt, but it can be challenging to use. We always use WinAT here to configure this.
We're using WinAT instead of Windows scheduler because WinAT defaults to using the SYSTEM account, and does not require you to specify a username and password, so this means you don't have to set up an additional security account to make this work. WinAT is just a utility that configures Windows - the scheduler itself is built into Windows and you don't need to run WinAT once your tasks are configured.
WinAT comes in the the Windows NT 4.0 Resource Kit. This utility can also be found online, by searching for WinAT.
Create the scheduled events listed above. Make sure you put quotes around the filename!. The WinAT command was built before there were long filenames, and it makes things more reliable to 'quote' your filename.
Once you've configured it, go to the Scheduled Tasks lists to test your scheduled events. You won't be able to edit them from here, but you can test them - which is important! Newly created tasks often fail for us because we forget the quotes, testing it makes sure you've got it right.