forked from MattHodge/Graphite-PowerShell-Functions
-
Notifications
You must be signed in to change notification settings - Fork 1
/
StatsToGraphiteConfig.xml
78 lines (78 loc) · 3.92 KB
/
StatsToGraphiteConfig.xml
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
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<Graphite>
<CarbonServer>yourCarbonServerNameOrIP</CarbonServer>
<CarbonServerPort>2003</CarbonServerPort>
<MetricPath>datacenter1.servers</MetricPath>
<NodeHostName>$env:COMPUTERNAME</NodeHostName>
<MetricSendIntervalSeconds>5</MetricSendIntervalSeconds>
<SendUsingUDP>False</SendUsingUDP>
</Graphite>
<PerformanceCounters>
<Counter Name="\Network Interface(*)\Bytes Received/sec"/>
<Counter Name="\Network Interface(*)\Bytes Sent/sec"/>
<Counter Name="\Network Interface(*)\Packets Received Unicast/sec"/>
<Counter Name="\Network Interface(*)\Packets Sent Unicast/sec"/>
<Counter Name="\Network Interface(*)\Packets Received Non-Unicast/sec"/>
<Counter Name="\Network Interface(*)\Packets Sent Non-Unicast/sec"/>
<Counter Name="\Processor(_Total)\% Processor Time"/>
<Counter Name="\Memory\Available MBytes"/>
<Counter Name="\Memory\Pages/sec"/>
<Counter Name="\Memory\Pages Input/sec"/>
<Counter Name="\System\Processor Queue Length"/>
<Counter Name="\System\Threads"/>
<Counter Name="\PhysicalDisk(*)\Avg. Disk Write Queue Length"/>
<Counter Name="\PhysicalDisk(*)\Avg. Disk Read Queue Length"/>
</PerformanceCounters>
<MetricCleaning>
<!-- These will be found and replaced in the order they appear here -->
<MetricReplace This="physicaldisk\(.* (.*)\:\)" With="physicaldisk.#{CAPTUREGROUP}-drive"/>
<MetricReplace This="^\\\\" With=""/>
<MetricReplace This="\\\\" With=""/>
<MetricReplace This="\/" With="-"/>
<MetricReplace This=":" With="."/>
<MetricReplace This="\\" With="."/>
<MetricReplace This="\(" With="."/>
<MetricReplace This="\)" With=""/>
<MetricReplace This="\]" With=""/>
<MetricReplace This="\[" With=""/>
<MetricReplace This="\%" With=""/>
<MetricReplace This="\s+" With=""/>
<MetricReplace This="\.\." With="."/>
<MetricReplace This="_" With=""/>
<MetricReplace This="\#" With="num"/>
<MetricReplace This="\.processor\." With=".cpu."/>
<MetricReplace This="\.cpu\.total\.processortime" With=".cpu.usage"/>
<MetricReplace This="\.networkinterface\." With=".nic."/>
<MetricReplace This="\.physicaldisk\." With=".hdd."/>
<MetricReplace This="\.intel[a-zA-Z0-9]+\." With=".intel."/>
<MetricReplace This="\.realtek[a-zA-Z0-9]+\." With=".realtek."/>
<MetricReplace This="\.memory\." With=".mem."/>
</MetricCleaning>
<Filtering>
<MetricFilter Name="isatap"/>
<MetricFilter Name="teredo tunneling"/>
</Filtering>
<MSSQLMetics>
<MetricPath>datacenter1.sqlmetrics</MetricPath>
<MetricSendIntervalSeconds>60</MetricSendIntervalSeconds>
<SQLConnectionTimeoutSeconds>5</SQLConnectionTimeoutSeconds>
<SQLQueryTimeoutSeconds>5</SQLQueryTimeoutSeconds>
<SQLServers>
<!-- A SQL Server Connection Using SQL Authentication -->
<SQLServer ServerInstance="(localdb)\v11.0" Username="sa" Password="PASSWORD1!">
<Query Database="mydb" MetricName="mydb.userlist.rowcount" TSQL="select count(userListID) From [dbo].[userList]"/>
<Query Database="mydb" MetricName="mydb.userlist.ukemails" TSQL="select count(userListID) From [dbo].[userList] Where Emails like '%.uk%'"/>
</SQLServer>
<!-- A SQL Server Connection Using Windows Authentication. The credentials from the running PowerShell session will be used. -->
<SQLServer ServerInstance="MSSQLServer" Username="" Password="">
<Query Database="citydb" MetricName="citydb.cities.navadwipkota" TSQL="Select COUNT (city) from [dbo].[cities] Where City = 'Navadwip' OR City = 'Kota'"/>
<!-- An example query SQL query using a greater-than symbol. The symbol must be replaced with an XML Entity References. List here - http://msdn.microsoft.com/en-us/library/windows/desktop/dd892769%28v=vs.85%29.aspx -->
<Query Database="addressbook" MetricName="people.ages.over30" TSQL="Select COUNT (personid) from [dbo].[tblAddressBook] Where Age > 30"/>
</SQLServer>
</SQLServers>
</MSSQLMetics>
<Logging>
<VerboseOutput>True</VerboseOutput>
</Logging>
</Configuration>