First of all thanks for the fast response.
And yes Iam using the "Shell Script" test method.
In the Hostmonitor Script Manager Box "Script" I wrote
$statusAlive = "ScriptRes:Alive:127.0.0.2"
$statusDead = "ScriptRes:127.0.0.1:"
$statusUnknown = "ScriptRes:Unknown:"
$statusNotResolved = "ScriptRes:Unknown host:"
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
$statusBadContents = "ScriptRes:Bad contents:"
Nothing else. (I also was wondering if the Script is supposed to be also there but I guess it shouldn't)
I also already changed the Alive variable to "Host Alive" or only "Alive" but it didn't work.
So Iam wondering if maybe the the 127.0.0.* response causes this?
[15:31:42] HostMonitor is going to execute "RBL" script ...
[15:31:43] Script started, invalid result received:
----------
127.0.0.55
ScriptRes:Host Alive
----------
Is the Script supposed to ONLY write out the Host Alive message or is it ok if it also writes the 127.0.0.*
In case it might help you to see the Script:
$statusAlive = "ScriptRes:Host Alive"
$statusDead = "ScriptRes:127.0.0.1:"
$statusUnknown = "ScriptRes:Unknown:"
$statusNotResolved = "ScriptRes:Unknown host:"
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
$statusBadContents = "ScriptRes:Bad contents:"
(
$IP = '127.0.0.55'
)
$reversedIP = ($IP -split '\.')[3..0] -join '.'
$blacklistServers = @(
'b.barracudacentral.org'
'spam.rbl.msrbl.net'
'zen.spamhaus.org'
'bl.spamcannibal.org'
)
$blacklistedOn = @()
foreach ($server in $blacklistServers)
{
$fqdn = "$reversedIP.$server"
try
{
$null = [System.Net.Dns]::GetHostEntry($fqdn)
$blacklistedOn += $server
}
catch { }
}
if ($blacklistedOn.Count -gt 0)
{
# The IP was blacklisted on one or more servers; send your email here. $blacklistedOn is an array of the servers that returned positive results.
Write-Host "$statusDead"
}
else
{
Write-Host "$statusAlive"
}