Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Directory

TheMichi44

Reviews(1)
byTheMichi44, December 10, 2014
here is the first problem:

###########################
$status = 0;
$desc = "";

test-activesyncconnectivity | ForEach-Object {
[snippet]
elseif ($status -eq "0") {
Write-Host "OK: ActiveSync Connectivity OK"
###########################

if you have an error on "test-activesyncconnectivity" the status will be "OK" at the end.

i would do the following as a fast fix:

###############
$status = 2; # 2 = critical
$desc = "";

test-activesyncconnectivity | ForEach-Object {
if($_.Result -like "Success") {
$status = 0;
###############

So you would get a "critical" output at the end if you have a problem at "test-activesyncconnectivity".


fast hint for other languages:

######################
elseif($_.Result -like "Failure") {
######################

in german it would be:

######################
elseif($_.Result -like "Erfolgreich") {
######################

greetz