Commit c4e9badf by JR Dalrymple

Made NRPE friendly - at least for OK return code

parent f7351c4c
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
# #
# Release Hitory: # Release Hitory:
# #
# 10/28/2015 - Initial Release. It works. Could use a usage or something. # 0.1 - 10/28/2015 - Initial Release. It works. Could use a usage or something.
# 0.2 - 10/28/2015 - Upon actually trying to use it I decided it needed to be NRPE friendly, so now it is.
################################################################################# #################################################################################
$nscpBinary = "c:\program files\NSClient++\nscp.exe" $nscpBinary = "c:\program files\NSClient++\nscp.exe"
...@@ -17,7 +18,7 @@ $returnCode = "3" #Unknown by default ...@@ -17,7 +18,7 @@ $returnCode = "3" #Unknown by default
$nagiosHost = "mn-lx9.gsellc.local" # this is the host running the NSCA daemon $nagiosHost = "mn-lx9.gsellc.local" # this is the host running the NSCA daemon
$encryption = "3des" # set this to match nsca.cfg on the Nagios host $encryption = "3des" # set this to match nsca.cfg on the Nagios host
$payloadLength = "4096" # set this to match your nsca daemon, the default is 512 $payloadLength = "4096" # set this to match your nsca daemon, the default is 512
$nscaPassword = "somepassword" # set this to match nsca.cfg on the Nagios host $nscaPassword = "password" # set this to match nsca.cfg on the Nagios host
$sourceHost = "CitrixFarm" # This needs to match the host you have configured in Nagios for these passive checks $sourceHost = "CitrixFarm" # This needs to match the host you have configured in Nagios for these passive checks
$userStringArray = @() $userStringArray = @()
...@@ -27,9 +28,6 @@ function nagiosExit($returnCode, $statusOutput) { ...@@ -27,9 +28,6 @@ function nagiosExit($returnCode, $statusOutput) {
Exit $returnCode Exit $returnCode
} }
function sendNscaExit($returnCode, $statusoutput) {
}
if ( (Get-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue) -eq $null ) { if ( (Get-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue) -eq $null ) {
Add-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue Add-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue
if ( (Get-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue) -eq $null) { if ( (Get-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue) -eq $null) {
...@@ -58,6 +56,8 @@ foreach ($user in $userStringArray) { ...@@ -58,6 +56,8 @@ foreach ($user in $userStringArray) {
"payload-length=$payloadLength", "payload-length=$payloadLength",
"password=$nscaPassword", "password=$nscaPassword",
"source-host=$sourceHost") "source-host=$sourceHost")
&$nscpBinary $nscpArgs &$nscpBinary $nscpArgs | out-null
} }
nagiosExit "0" "It seems everything finished OK!"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment