Overview
This article provides instructions for setting up an automated monitoring script that checks BlackboxTCP4 health status on a regular schedule. The script runs the BlackboxTCP4.exe -test command and logs the results to a file, alerting you if the system reports "not ready for processing."
Requirements
- Windows Server with BlackboxTCP4 installed.
- Administrator access to the server.
- PowerShell execution permissions (or ability to bypass via Task Scheduler).
Procedure
Step 1 - Create the Script
- Press
Windows Key + R, typenotepad, and hit Enter. - Paste the following into Notepad:
Set-Location "C:\MagicLogic\BB4"
$output = & ".\BlackboxTCP4.exe" -test
$logFile = "C:\MagicLogic\BB4\Scripts\blackbox_log.txt"
$timestamp = Get-Date -Format "MM/dd/yyyy HH:mm"
if ($output -like "*not ready for processing*") {
Add-Content $logFile "[$timestamp] ALERT: Not ready for processing"
} else {
Add-Content $logFile "[$timestamp] OK: $output"
}- Click File → Save As.
- Change "Save as type" to All Files.
- Name it
blackbox_monitor.ps1. - Save it to
C:\MagicLogic\BB4\Scripts\.
Note: If BlackboxTCP4 is installed in a different location, update the path in the first line of the script.
Step 2 - Allow Scripts to Run (Optional)
If you want to manually test the script before scheduling it, you'll need to enable PowerShell script execution:
- Right-click PowerShell and choose Run as Administrator.
- Type
Set-ExecutionPolicy RemoteSignedand hit Enter. - Type
Yand hit Enter.
Note: In corporate environments with Group Policy restrictions, this setting may revert. The scheduled task in Step 4 includes a bypass parameter to work around this issue.
Step 3 - Test the Script (Optional)
- In the PowerShell Administrator window, type
C:\MagicLogic\BB4\Scripts\blackbox_monitor.ps1and hit Enter. - Navigate to
C:\MagicLogic\BB4\Scripts\and openblackbox_log.txt. - You should see a line like:
[date/time] OK: Self-test... Test Completed.
Step 4 - Schedule the Monitoring Task
- Press
Windows Key + R, typetaskschd.msc, and hit Enter. - Click Create Basic Task on the right panel.
- Name it
BlackboxTCP4 Monitorand click Next. - Select Monthly and click Next.
- Select all 12 months and enter days 1 and 16, then click Next.
- Select Start a program and click Next.
- In Program/script enter:
powershell.exe. - In Add arguments enter:
-ExecutionPolicy Bypass -File "C:\MagicLogic\BB4\Scripts\blackbox_monitor.ps1"
- Click Next then Finish.
Note: The -ExecutionPolicy Bypass parameter ensures the script runs even if Group Policy restrictions are in place.
Step 5 - Checking the Log File
- Navigate to
C:\MagicLogic\BB4\Scripts\. - Open
blackbox_log.txt. - Each line shows the date, time, and result of each check.
- If you see
ALERT: Not ready for processing, BlackboxTCP4 needs attention. - If you see
OK, the system is running normally.
The script will run automatically on the 1st and 16th of every month and append results to the log file.
Assistance
If any further assistance is needed, please contact our Support team.