Community forum

Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
Offline kbrady  
#1 Posted : Tuesday, March 17, 2015 5:12:43 AM(UTC)

Rank: No customer

Joined: 3/17/2015(UTC)
Posts: 1


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?

Offline ErikC  
#2 Posted : Tuesday, March 17, 2015 7:56:22 AM(UTC)

Rank: Paid support

Joined: 2/26/2008(UTC)
Posts: 1,437
Location: Amsterdam

Thanks: 95 times
Was thanked: 187 time(s) in 163 post(s)
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.
Offline Support  
#3 Posted : Tuesday, March 24, 2015 3:15:45 PM(UTC)

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 9,499

Thanks: 588 times
Was thanked: 329 time(s) in 317 post(s)
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!
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2017, Yet Another Forum.NET
This page was generated in 0.319 seconds.
Scroll to Top