Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
JR Dalrymple
/
check_citrix_user
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c4e9badf
authored
Oct 28, 2015
by
JR Dalrymple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made NRPE friendly - at least for OK return code
parent
f7351c4c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
check_citrix_user.ps1
+6
-6
No files found.
check_citrix_user.ps1
View file @
c4e9badf
...
@@ -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
=
"
some
password"
# 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!"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment