Open riahc3 opened 4 years ago
Is there something that prevents you from using that now?
$Results = Invoke-Testimo -ReturnResults
if ($Results.Status -contains $false) {
Write-Host "Errors happend"
Exit 2
} else {
Exit 0
}
Or is there something I'm missing?
Is there something that prevents you from using that now?
$Results = Invoke-Testimo -ReturnResults if ($Results.Status -contains $false) { Write-Host "Errors happend" Exit 2 } else { Exit 0 }
Or is there something I'm missing?
There is a lot of code but entering a few .ps1 files I dont see anywhere where there is a "final" Write-Host and Exit
Besides, looking at the code I doubt "Exit 0" would be used and it would be "Exit $LastStatusCode" or "$StatusOK=0 ; Exit $StatusOK"
I think the best way to is to setup a additional .ps1 with all the test but ending in a Nagios plugin logic.
I mean you don't have to modify code. I'm trying to say, what you can do is do Install-Module Testimo, and then create your own .ps1, and then run the code I pasted. When you plug that into Nagios it should work as expected as far as I understand what you said? Testimo will deliver results, and you just need to "deliver" whatever you want to Nagios.
I can, of course, incorporate this at some point, but just trying to understand if the above would work?
I mean you don't have to modify code. I'm trying to say, what you can do is do Install-Module Testimo, and then create your own .ps1, and then run the code I pasted. When you plug that into Nagios it should work as expected as far as I understand what you said? Testimo will deliver results, and you just need to "deliver" whatever you want to Nagios.
I can, of course, incorporate this at some point, but just trying to understand if the above would work?
I think you mean that I make a wrapper where inside I just call your functions and depending what they reply, I handle it to reply to Nagios.
There are a lot of checks you do so Im not sure which are critical or not, sorry.
I understand. I have some ideas for that. Will take a while but hopefully will get implemented.
Hello
I think this is a great script. Really thorough checking.
That being said, I think it should be Nagios compatible (or even fork it, although sync issues might occur). The script should be ran from a domain controller.
You can read the entire documentation here: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html but the TL;DR is that your last line should be:
Write-Host "Whatever you want Nagios to display as text" exit $variableholdingexitcode # 0 for OK, 1 for WARNING, 2 for CRITICAL and 3 for UNKNOWN
$variableholdingexitcode should be:
0 - OK 1 - WARNING 2 - CRITICAL 3 - UNKNOWN
OK is obviously that all checks have gone fine.
I think WARNING and CRITICAL should be defined by you and/or the user. You can, for example, decide that if there are six domain controllers and two cannot be reached, it is a WARNING status but if it cannot reach four, it should be a CRITICAL.
Not being able to resolve DNS against DCs should be a CRITICAL automatically with no WARNING state possible.
etc, etc....
And the user should also be able to -IncludeAsWarnings and pass a string array with checks he wants to be warnings if they fail or -ExcludeAsWarnings with again a string array with check he wants to ignore if they fail
Same with -IncludeAsCritical and -ExcludeAsCritical
Also -CompletelyInclude and -CompletelyExclude
UNKNOWN is mainly if the script fails for some reason out of your control....Running it on a 2003 DC if it isnt supported, should return a UNKNOWN for example.
I hope this gives you some ideas and Im sure plently more with input with even better ideas.
Thanks!