-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_XenappLB.ps1
145 lines (141 loc) · 6.96 KB
/
check_XenappLB.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
function lboffline {
$lboffline = qfarm /lboff | findstr /i CTX;
if ($lboffline -eq $null) {
$global:lboffline_status = "ok"
}
ELSE
{
$thisserver_lboffline = $lboffline.contains("$env:computername")
if ($thisserver_lboffline -eq $true) {
$global:lboffline_status = "critical"
}
ELSE
{
$global:lboffline_status = "ok"
}
}
}
function offline {
$offline = qfarm /offline | findstr /i CTX;
if ($offline -eq $null) {
$global:offline_status = "ok"
}
ELSE
{
$thisserver_offline = $offline.contains("$env:computername")
if ($thisserver_offline -eq $true) {
$global:offline_status = "critical"
}
ELSE
{
$global:offline_status = "ok"
}
}
}
lboffline;
offline;
if ($lboffline_status -eq "ok") {
if ($offline_status -eq "ok") {
write-host OK - Server is participating in load balancing
exit 0
}
ELSE
{
write-host CRITICAL - Server is offline in QFARM
exit 2
}
}
ELSE
{
write-host CRITICAL - Server has been removed from Xenapp load balancing
exit 2
}
# SIG # Begin signature block
# MIIQIQYJKoZIhvcNAQcCoIIQEjCCEA4CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUz5nC6WwAraoTfMi/YPRMmPhR
# nT6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