HI all. I have a series of workday urls that I’d like to monitor using Squared Up. A couple are just basic website hits but a few others actual require a login and then download a json file that contains data.
What’s the best route to go about hitting these 3 sites that require a login?
Then lastly, is there a way for the success of this monitor to be determined if the json file is retrieved or not?
as far I understand SquredUp v4 with EAM Plus would be a perfect match.
If you don’t have Plus, I would create Unit Monitors in the SCOM console that leverage Squared Ups PowerShell MP.
In Powershell would then use Invoke-Restmethod which gives a convinient way to work with JSON that is returned by web-services. I used it for several scenarios in the last months.
hmm I don’t really know if I have EAM Plus or not. I have v4. How do I know if I have plus? How would that be done in Plus? I see where on the availability tab of a new app in SUP I can put in a url and then a content match setting, etc.
# Perform some sort of test here
try {
$response = Invoke-WebRequest -Uri $config.url -UseBasicParsing -UseDefaultCredentials -ErrorAction Stop
}
catch{
# If the script throws an error, we'll automatically treat it as a failing test and use the exception message as the Description
throw "Error attempting to access '$($config.url)': $($_.Exception.Message)"
}
# Simply return a bool indicating success
# return $response.StatusCode -eq 200
# Or return an object with a Success & Description property (and anything else you want in the Alert Context)
$result = New-Object -TypeName PSobject -Property @{
# Set the monitor result, must be true/false
'Success' = $response.StatusCode -eq 200
# Set the description shown in the alert message.
'Description' = "Response code from querying $($config.url) was $($response.StatusCode)"
# Include any extra properties, which will be shown in the Alert Context.
'ContentLength' = $response.RawContentLength
# If you want the monitor to be in a warning state
# 'Level' = 'warning'
}
return $result
The commenting should provide enough info to know what the script needs to be returned so SCOM can make a health state out of it.
ok I have an EAM Plus license now. So Jelly, are you saying use the script above to try to pull this off?
Basically, what I’ve been told is if the website url hit generates a json file that has anything other than an error or [] means everything is hunky dory.