Supress API DLL output - VisualCron - Forum

Community forum


I have written a powershell script that connects via the visualcron api dll to query job status - this will be an input to a Nagios/Icinga check.
The problem I have is that when I connect to the server, the visual cron connection method always outputs the below text to screen:

Socket connected.
License status: Activated

Nagios see's the first line (Socket connected.), and because it is not WARNING or CRITICAL, marks it as green and goes on its way.
This means however, that the script cannot pass the error details of what I want to monitor to Nagios as it will always say that.

I am wondering if there is a method to suppress this connection status info? Redirecting the object results in making it null and powershell complaing.

Relevant code snippet is:

function Get-VCServer{
param ([string]$ComputerName)

$apiPath = Get-VCAPIPath
if (!(Test-Path $apiPath)) { Throw "VisualCron does not appear to be installed. API library not found at `"$apiPath`"." }
[Reflection.Assembly]::LoadFrom($apiPath) | Out-Null
$conn = New-Object VisualCronAPI.Connection
$conn.Address = "localhost"
$client = New-Object VisualCronAPI.Client

I just want the script to output a further part of the script, which has job status details - does any one have any ideas?

Hi Kirk,

I don't know if you can change the output of the dll.

You might add a new task reading the output of the powershell task and suppress the 1st line. Modify it so Nagios can handle it.
Use the output of that task for Nogios.

Uses Visualcron since 2006.
You cannot suppress that output but I think in later versions >7.6.2 you do not have that output to console at all.
Please like  VisualCron on facebook!
Scroll to Top