Forum Discussion
You could do a scripted datasource using powershell that invokes the ping command with the -l argument. I recommend a multi-instance script (not batchscript) datasource with property based discovery.
Meaning; set a property called ping.targets with a comma separated list of names/IPs you want to ping. Your AppliesTo becomes simply "ping.targets". Your Groovy discovery script would look like this:
hostProps.get("ping.targets").replaceAll(" ","").tokenize(",").each{
println(it + "##" + it)
}
return 0
Then your script would look like this:
$result = ping -l X ##WILDVALUE## # replace X with your desired MTU size
# do something with $result to get the output to be a number representing what you want to know
# write it out using Write-Host
return 0
I'm not a powershell guy, so i'm not much help with the collection script. You'd need to take the result and manipulate it into one or more datapoints. Each datapoint would be written to the host using "Write-Host datapointname: Y" where datapointname is the name you want to call the datapoint and Y is the numeric value.
Related Content
- 9 months ago
- 2 years ago