Kiln » KilnSupportScripts Powershell Scripts to help monitor a Kiln environment. Contact Fog Creek support before using.
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

Made parameters compatible with PS 2.0

Changeset a003225a0599

Parent f2974d8da963

by Profile picture of User 1563Quentin Schroeder <quentin@fogcreek.com>

Changes to one file · Browse files at a003225a0599 Showing diff from parent f2974d8da963 Diff from another changeset...

 
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
 
165
166
167
168
 
169
170
 
 
171
172
173
 
227
228
229
230
 
231
232
233
 
249
250
251
252
 
253
254
255
256
257
258
 
259
260
 
261
262
263
 
295
296
297
298
 
299
300
301
 
83
84
85
 
 
 
 
86
87
 
 
 
88
 
 
 
89
 
 
 
90
 
 
 
91
 
 
92
 
 
93
 
 
94
 
 
95
 
 
96
 
 
97
 
 
98
 
 
99
100
101
 
134
135
136
 
137
138
 
139
140
141
142
143
 
197
198
199
 
200
201
202
203
 
219
220
221
 
222
223
224
225
226
227
 
228
229
 
230
231
232
233
 
265
266
267
 
268
269
270
271
@@ -83,50 +83,19 @@
      -param([Parameter(ParameterSetName="noemail")] - [string]$kilnURL = "http://localhost/fogbugz/kiln", - - [Parameter(ParameterSetName="email", Mandatory=$true)] +param([string]$kilnURL = "http://localhost/fogbugz/kiln",   [string]$smtpServer = "", - - [Parameter(ParameterSetName="email", Mandatory=$true)] - [Parameter(ParameterSetName="noemail")]   [string]$from = "", - - [Parameter(ParameterSetName="email", Mandatory=$true)] - [Parameter(ParameterSetName="noemail")]   [string]$to = "", - - [Parameter(ParameterSetName="email", Mandatory=$true)] - [Parameter(ParameterSetName="noemail")]   [string]$username = "", - - [Parameter(ParameterSetName="email", Mandatory=$true)] - [Parameter(ParameterSetName="noemail")]   [string]$password = "", - - [Parameter(ParameterSetName="email")]   [switch]$smtpSsl, - - [Parameter(ParameterSetName="email")]   [string]$smtpPort = 587, - - [Parameter(ParameterSetName="noemail")]   [string]$backendVersionUrl = "http://localhost:56783/version", - - [Parameter(ParameterSetName="noemail")]   [string]$esUrl = "http://localhost:9200/", - - [Parameter(ParameterSetName="noemail")]   [string]$queueStatsUrl = "http://localhost:56785/stats.json", - - [Parameter(ParameterSetName="noemail")]   [string]$iisSiteName = "", - - [Parameter(ParameterSetName="noemail")]   [switch]$noRestart, - - [Parameter(ParameterSetName="noemail")]   [string]$reenqueuePath = ".\reenqueue_2.9_tasks.ps1"   )   @@ -165,9 +134,10 @@
  Write-WithTime " Unable to send email, an error occurred.`n$exceptionMessage" $true   }   } - elseif ($smtpServer -or $from -or $to -or $username -or $password -or $smtpSsl) + elseif ($smtpServer -or $from -or $to -or $username -or $password -or $smtpSsl -or ($smtpPort -ne 587))   { - Write-WithTime " Unable to send email, some required parameters are missing!" $true + Write-WithTime " Unable to send email, some required parameters are missing! Writing to std-out." $true + Write-WithTime " $msg" $true   }   else   { @@ -227,7 +197,7 @@
  {   $exceptionMessage = $_.Exception.Message   Handle-Error("Critical Kiln Server error. Could not reach URL [$url]`n$exceptionMessage") - $serviceNeedsRestart = $true + $serviceNeedsRestart.value = $true   }  }   @@ -249,15 +219,15 @@
    Write-WithTime ""   Write-WithTime "--Queue Stats Information--" - Write-WithTime " Time reported: $timeDiff seconds from now" + Write-WithTime " Time Accuracy: within $timeDiff seconds"   Write-WithTime " Queue Length: $queueLength"   Write-WithTime " Running Task Count: $runningTaskCount"   Write-WithTime " Age of oldest task: $oldestTaskAge seconds"     - if (($timeDiff -gt 5) -or ($timeDiff -lt 5)) + if (($timeDiff -gt 5) -or ($timeDiff -lt -5))   { - $serviceNeedsRestart = $true + $serviceNeedsRestart.value = $true   }     @@ -295,7 +265,7 @@
  {   $exceptionMessage = $_.Exception.Message   Handle-Error("Error obtaining or processing Kiln Queue Stats`n$exceptionMessage") - $serviceNeedsRestart = $true + $serviceNeedsRestart.value = $true   }  }