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

Shift variables, add some stuff to test-checkBackend.ps1

Changeset 8d22278a2086

Parent a4abfa5b6196

by Profile picture of User 476Ben McCormack <benm@fogcreek.com>

Changes to 2 files · Browse files at 8d22278a2086 Showing diff from parent a4abfa5b6196 Diff from another changeset...

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
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
 . C:\code\checkKiln\checkBackend.ps1  $sRepoGUID = 'B530EC64-82BE-473A-82E1-569464B1074A'  $sChangeset1 = 'f181ad06356697b8676868fec36fbe13167081dd'  $sChangeset2 = 'ed5f14291c3ab9d9bf24dee8e1b4761799509d15'  $logFile = "C:\code\checkKiln\checkBackend.log"  $kilnRepositories = "C:\KilnRepositories" +$maxMiniRedisSize = 3000000 #3MB  $smtpServer = "testmail.example.com"  $from = "ben@example.com"  $to = "ben@example.com" -$maxMiniRedisSize = 3000000 #3MB    Get-ProcessStats "backend" $logFile  Get-ProcessStats "memcached" $logFile  Get-ProcessStats "QueueService" $logFile  Get-ProcessStats "redis-server" $logFile  $passed = Check-KilnBackend $sRepoGUID $sChangeset1 $sChangeset2 $logFile  if (-not $passed) {   Send-MailMessage -From $from -To $to -SmtpServer $SmtpServer -Subject "The Kiln Backend Had To Be Restarted" #-Attachment $logFile  }  $lenMiniRedis = Get-MiniRedisSize $kilnRepositories $logFile  $intLenMiniRedis = 0  if ([System.Int64]::TryParse($lenMiniRedis, [ref]$intLenMiniRedis)) {   if ($intLenMiniRedis -gt $maxMiniRedisSize) {   $strLenMiniRedisKb = "{0:N0}" -f ($intLenMiniRedis / 1024)   Send-MailMessage -From $from -To $to -SmtpServer $SmtpServer -Subject "The Kiln MiniRedis.db is too large" -Body "MiniRedis.db is $strLenMiniRedisKB KB"   }  }
 
3
4
5
 
 
6
7
8
 
 
 
 
 
3
4
5
6
7
8
9
 
 
10
11
 
@@ -3,6 +3,9 @@
 $sChangeset1 = 'f181ad06356697b8676868fec36fbe13167081dd'  $sChangeset2 = 'ed5f14291c3ab9d9bf24dee8e1b4761799509d15'  $logFile = "C:\code\checkKiln\checkBackend.log" +$kilnRepositories = "C:\KilnRepositories" +$maxMiniRedisSize = 3000000 #3MB    Test-KilnVersion -Test-KilnDiff $sRepoGUID $sChangeset1 $sChangeset2 \ No newline at end of file
+Test-KilnDiff $sRepoGUID $sChangeset1 $sChangeset2 +Get-MiniRedisSize $kilnRepositories \ No newline at end of file