Blog

Archive for May, 2013

Cleanup Site Concentrator

Hey Guys,

I’ve had a number of site concentrators not clearing the cache properly.
According to http://www.allthingsmax.com/2011/12/saving-time-headaches-by-saving.html,

The Site Concentrator is self-cleaning, so in 30 days or less after download, the patches, etc. will be removed from the cache path automatically.

I have not found this to be the case, so have had to write a script to do it for me.
Paremeters to be passed are:
/ConcentratorPath: for where the cache Directory is located.
/ReportOnly: if you want to see how many files are over 30 days without deleting them.

Parameter Example:
/ConcentratorPath:”c:\UpdateCache” /ReportOnly:true

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
Option Explicit  
Dim FSO, Folder, File, DateRange, CurrentFolder, TotalSize, FileSize, Path, bDebug, ReportOnly
 
Set FSO = CreateObject("Scripting.FileSystemObject") 
 
Path = WScript.Arguments.Named("ConcentratorPath")
ReportOnly = WScript.Arguments.Named("ReportOnly")
 
If FSO.FolderExists(Path) = false Then
	WScript.echo "Concentrator Path not found."
	WScript.Quit(1)
End If
 
If lcase(ReportOnly) = "true" Then 
	bDebug = true
	if bDebug = true Then WScript.echo "*** No Files Deleted, ReportOnly Enabled ***"
End If 
 
DateRange = dateadd("d", -30, Now)
ProcessDirectory(Path) 
 
If TotalSize = 0 then
	WScript.echo "No Old Updates Found."
ElseIf TotalSize > 1024 then
	TotalSize = TotalSize / 1024
	WScript.echo "Total Size: " & FormatNumber(int(TotalSize * 100) / 100, 2) & "Gb"
Else
	WScript.echo "Total Size: " & FormatNumber(int(TotalSize * 100) / 100, 2) & "Mb"
End If
 
if bDebug = true Then WScript.echo "*** No Files Deleted, ReportOnly Enabled ***"
WScript.Quit(0)
 
Sub ProcessDirectory(Directory)
Set CurrentFolder = FSO.GetFolder(Directory) 
 
For Each File in CurrentFolder.Files
	If File.DateLastModified < DateRange then
		FileSize = File.Size / 1024 / 1024
		WScript.Echo File.Name & " last modified at " & File.DateLastModified
		WScript.Echo "File Size: " & FormatNumber(int(FileSize * 100) / 100, 2) & "Mb"
 
		If bDebug = false Then 
			On Error Resume Next 'Dirty Error Handleing :)
			File.Delete
			On Error goto 0
		End if
 
		TotalSize = TotalSize + FileSize
	End if
Next
 
For Each Folder in CurrentFolder.Subfolders
	ProcessDirectory(Directory & Folder.Name)
Next
 
End Sub

Posted in: Scripts

Leave a Comment (0) →

Install Minicom on XCP

Minicom is a serial communication program. It is a Unix clone of the well-known MS-DOS Telix program. It has ANSI color, a dialing directory, dial-a-list, and a scripting language.

Its handy to some times use the serial port on the Xenserver box.

To install minicom run

yum –enablerepo=base install minicom

and then run minicom -s (for setup and setup your serial port)
Here are my settings for getting in to a cisco router.

x A – Serial Device : /dev/ttyS0 x
x B – Lockfile Location : /var/lock x
x C – Callin Program : x
x D – Callout Program : x
x E – Bps/Par/Bits : 9600 8N1 x
x F – Hardware Flow Control : No x
x G – Software Flow Control : No x

Posted in: Blog

Leave a Comment (0) →

XCP Security Update

XCP is Open Source Xenserver. There are some security update for it so you should run
yum –enablerepo xcp –nogpgcheck update

and then reboot your server for the updates to take effect.

Source

Hi all,

I’ve just set up a yum repo for XCP 1.6. In this repo I’ve included an
updated Xen hypervisor, which will resolve the issues mentioned in this
Citrix security advisory: http://support.citrix.com/article/CTX135777

Unfortunately, I haven’t signed the rpms in this repo, so you’ll have to
disable gpg checking when you update. If you would like to update your
hosts, run the command ‘yum –enablerepo xcp –nogpgcheck update’. Since
this is a Xen hypervisor update, you’ll have to reboot your hosts for
this to take effect.

Mike
http://lists.xen.org/archives/html/xen-api/2012-12/msg00123.html

Posted in: Blog

Leave a Comment (0) →