I have a new favourite toy at work. It hasn’t quite overtaken ConfigMgr as my absolute favourite but it’s close. I’m having fun with it though, and that’s the main thing. Apart from, you know, its entire business function, but that’s minor, right? My new toy is called PRTG which is written by a company called Paessler. It’s a monitoring platform in the same vein as System Center Operations Manager, SolarWinds, Nagios, WhatsUp Gold et al.
One of the neat things that PRTG does is sFlow monitoring, where the platform takes an sFlow from a switch and presents a nice graphical analysis of the data it receives. sFlow is an analysis protocol which takes a sample of the traffic that your switch is processing, logs its source, destination, the port that it’s using and the size of the packet then passes it on to a collector. The collector then does clever things with it. This is a screenshot of the data being collected about one of our busier core switches:

However, the first time I installed one of these sensors on PRTG, I was quite disappointed with it. The amount of channels with different types of protocols that it was showing was minimal; it could distinguish HTTP(S), FTP, a couple of different email protocols, some IM protocols, NETBIOS, DNS, DHCP, SSH, RDP and Citrix. Everything else was lumped under “Various”.
The screenshot above is a “Custom sFlow Sensor”, where you can define your own channels for different protocols. That’s great for a one off, or where you want to look for specific types of traffic, but doing that for multiple sensors is rather labourious. It would be better if all of the channels you want are in the default sFlow sensor.
Luckily, PRTG provide you with a method of doing that. In the “%programfiles(x86)%\PRTG Network Monitor” folder, there is a file called FlowRules.osr, which is an XML file with the rules definition in it. Copy that file into one called CustomFlowRules.osr and open it in your favourite text editor (I like Notepad++ and Programmers Notepad. Now, in theory you could edit the FlowRules.osr file instead of the custom one, but Paessler recommend against it as your hard work will most likely be undone when PRTG gets updated.
You’ll see that the file is bog standard 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 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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
<?xml version="1.0" encoding="ISO8859-1"?> <groups> <group id="3001" name="WWW"> <caption>Web</caption> <help>WWW Traffic</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1001" name="HTTP"> <rule> Protocol[TCP] and ( SourcePort[80] or DestinationPort[80] or SourcePort[8080] or DestinationPort[8080]) </rule> </channel> <channel id="1023" name="HTTPS"> <rule> Protocol[TCP] and (SourcePort[443] or DestinationPort[443]) </rule> </channel> </channels> </group> <group id="3002" name="FTP/P2P"> <caption>File Transfer</caption> <help>File Transfer</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1024" name="FTP (Control)"> <rule> Protocol[TCP] and (DestinationPort[20-21] OR SourcePort[20-21]) </rule> </channel> </channels> </group> <group id="3003" name="Mail"> <caption>Mail</caption> <help>Mail Traffic</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1006" name="IMAP"> <rule> (Protocol[TCP] or Protocol[UDP]) and ( DestinationPort[143] or SourcePort[143] or DestinationPort[220] or SourcePort[220] or DestinationPort[993] or SourcePort[993] ) </rule> </channel> <channel id="1008" name="POP3"> <rule> Protocol[TCP] and (SourcePort[110] or DestinationPort[110] or SourcePort[995] or DestinationPort[995]) </rule> </channel> <channel id="1011" name="SMTP"> <rule> Protocol[TCP] and (SourcePort[25] or DestinationPort[25]) </rule> </channel> </channels> </group> <group id="3004" name="Chat"> <caption>Chat</caption> <help>Chat, Instant Messaging</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1007" name="IRC"> <rule> Protocol[TCP] and (SourcePort[6667] or DestinationPort[6667]) </rule> </channel> <channel id="1025" name="AIM"> <rule> Protocol[TCP] and (SourcePort[5190] or DestinationPort[5190]) </rule> </channel> </channels> </group> <group id="3005" name="Remote Control"> <caption>Remote Control</caption> <help>Remote Control</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1009" name="RDP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (SourcePort[3389] or DestinationPort[3389]) </rule> </channel> <channel id="1014" name="SSH"> <rule> Protocol[TCP] and (SourcePort[22] or DestinationPort[22]) </rule> </channel> <channel id="1016" name="Telnet"> <rule> Protocol[TCP] and (SourcePort[23] or DestinationPort[23]) </rule> </channel> <channel id="1017" name="VNC"> <rule> Protocol[TCP] and (SourcePort[5800] or DestinationPort[5800] or SourcePort[5900] or DestinationPort[5900]) </rule> </channel> </channels> </group> <group id="3007" name="Infrastructure"> <caption>Infrastructure</caption> <help>Network Services</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1003" name="DHCP"> <rule> Protocol[UDP] and ((SourcePort[68] and DestinationPort[67]) or (SourcePort[67] and DestinationPort[68]) ) </rule> </channel> <channel id="1004" name="DNS"> <rule> (Protocol[TCP] or Protocol[UDP]) and (SourcePort[53] or DestinationPort[53]) </rule> </channel> <channel id="1005" name="Ident"> <rule> Protocol[TCP] and (SourcePort[113] or DestinationPort[113]) </rule> </channel> <channel id="1018" name="ICMP"> <rule> Protocol[ICMP] </rule> </channel> <channel id="1012" name="SNMP"> <rule> Protocol[UDP] and (SourcePort[161-162] or DestinationPort[161-162]) </rule> </channel> </channels> </group> <group id="3008" name="NetBIOS"> <caption>NetBIOS</caption> <help>NetBIOS</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1019" name="NETBIOS"> <rule> (Protocol[TCP] OR Protocol[UDP]) AND (DestinationPort[137-139] OR SourcePort[137-139]) </rule> </channel> </channels> </group> <group id="3010" name="Citrix"> <caption>Citrix</caption> <help>Citrix</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1026" name="Citrix"> <rule> Protocol[TCP] and (Port[1494] or Port[2598] or Port[2512]) </rule> </channel> </channels> </group> <group id="3009" name="Various"> <caption>Other Protocols</caption> <help>Various</help> <defaultvalue>1</defaultvalue> <channels> <channel id="1021" name="Other UDP"> <rule> Protocol[UDP] </rule> </channel> <channel id="1022" name="Other TCP"> <rule> Protocol[TCP] </rule> </channel> </channels> </group> </groups> |
The structure is simple enough. The root element is called Groups. Underneath that, there is another element called Group, in which you’re supposed to group different types of channel together, so you could have a “File Services” Group with SMB, NFS and AppleTalk in it for example. You need to give the group a unique numerical ID and a name. There are a couple of attributes in Group element:
- Caption – A display name for the group (e.g. “File Access”)
- Help – A more detailed description of the group (e.g. “These protocols are used for accessing files on servers”)
- DefaultValue – This attribute tells PRTG whether to show all of the protocols in the group as one channel, to show each of the protocols in the group as their own channel or hide the group entirely. Values are:
- 0 – Hide group entirely
- 1 – Group protocols in one channel
- 2 – Show all protocols as separate channels
You then define the channels for the protocols with the Channels and Channel elements. Each channel needs a separate element with a unique ID and name. In the Channel element, there’s an attribute called Rule where you define what the channel is looking for, so for SMB you would put:
|
1 |
Protocol[TCP] and (Port[445]) |
There is full documentation on the filter rules at the PRTG website
Anyway, you can see from that file above that it’s rather limited. With that, the vast majority of traffic that passes my switches was lumped under “Various”, which ain’t especially helpful. I suspect PRTG put such a limited file in there because sFlow monitoring is rather computationally expensive and the more filters and rules it has to process, the harder it has to work. That said, there’s no reason why you shouldn’t try and push these things!
This is my CustomFlowRules.osr file:
|
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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
<?xml version="1.0" encoding="ISO8859-1"?> <groups> <group id="3001" name="WWW"> <caption>Web</caption> <help>WWW Traffic</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1101" name="HTTP"> <rule> Protocol[TCP] and ( Port[80] or Port[8080] or Port[81]) </rule> </channel> <channel id="1102" name="HTTPS"> <rule> Protocol[TCP] and (Port[443] or Port[441]) </rule> </channel> </channels> </group> <group id="3002" name="FTP/P2P"> <caption>File Transfer</caption> <help>File Transfer</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1201" name="FTP (Control)"> <rule> Protocol[TCP] and (Port[20-21]) </rule> </channel> <channel id="1202" name="SMB"> <rule> Protocol[TCP] and (Port[445]) </rule> </channel> <channel id="1203" name="AppleTalk"> <rule> Protocol[TCP] and (Port[548]) </rule> </channel> </channels> </group> <group id="3003" name="Mail"> <caption>Mail</caption> <help>Mail Traffic</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1301" name="IMAP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[143] or Port[220] or Port[993] ) </rule> </channel> <channel id="1302" name="POP3"> <rule> Protocol[TCP] and (Port[110] or Port[995]) </rule> </channel> <channel id="1303" name="SMTP"> <rule> Protocol[TCP] and (Port[25]) </rule> </channel> </channels> </group> <group id="3004" name="Chat"> <caption>Messaging and Telephony</caption> <help>Chat, Instant Messaging, IP Phones</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1401" name="IRC"> <rule> Protocol[TCP] and (Port[6667]) </rule> </channel> <channel id="1402" name="AIM"> <rule> Protocol[TCP] and (Port[5190]) </rule> </channel> <channel id="1403" name="Teams"> <rule> (Protocol[UDP] and (Port[3478..3481]) </rule> </channel> </channels> </group> <group id="3005" name="Remote Control"> <caption>Remote Control</caption> <help>Remote Control</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1501" name="RDP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[3389]) </rule> </channel> <channel id="1502" name="SSH"> <rule> Protocol[TCP] and (Port[22]) </rule> </channel> <channel id="1503" name="Telnet"> <rule> Protocol[TCP] and (Port[23]) </rule> </channel> <channel id="1504" name="VNC"> <rule> Protocol[TCP] and (Port[5800] or Port[5900]) </rule> </channel> <channel id="1505" name="Citrix"> <rule> Protocol[TCP] and (Port[1494] or Port[2598] or Port[2512]) </rule> </channel> </channels> </group> <group id="3006" name="Infrastructure"> <caption>Infrastructure</caption> <help>Network Services</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1601" name="DHCP"> <rule> Protocol[UDP] and ((SourcePort[68] and DestinationPort[67]) or (SourcePort[67] and DestinationPort[68]) ) </rule> </channel> <channel id="1602" name="DNS"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[53]) </rule> </channel> <channel id="1603" name="Ident"> <rule> Protocol[TCP] and (Port[113]) </rule> </channel> <channel id="1604" name="ICMP"> <rule> Protocol[ICMP] </rule> </channel> <channel id="1605" name="SNMP"> <rule> Protocol[UDP] and (Port[161-162]) </rule> </channel> <channel id="1606" name="RCP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[135]) </rule> </channel> <channel id="1607" name="LDAP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[389] or Port[3268]) </rule> </channel> <channel id="1608" name="LDAPS"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[636] or Port[3269]) </rule> </channel> <channel id="1609" name="Kerberos"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[88]) </rule> </channel> <channel id="1610" name="WinRM"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[5985] or Port[5986]) </rule> </channel> <channel id="1611" name="mDNS"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[5353]) </rule> </channel> <channel id="1612" name="NTP"> <rule> Protocol[UDP] and (Port[123] ) </rule> </channel> <channel id="1613" name="MSSQL"> <rule> Protocol[TCP] and (Port[1433]) </rule> </channel> <channel id="1614" name="MS Cluster Comms"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[3343]) </rule> </channel> <channel id="1615" name="Smoothwall Comms"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[222]) </rule> </channel> <channel id="1616" name="NETBIOS"> <rule> (Protocol[TCP] OR Protocol[UDP]) AND (Port[137-139]) </rule> </channel> <channel id="1617" name="IPSEC"> <rule> (Protocol[TCP] OR Protocol[UDP]) AND (Port[4500]) </rule> </channel> <channel id="1618" name="IKE"> <rule> (Protocol[TCP] OR Protocol[UDP]) AND (Port[500]) </rule> </channel> <channel id="1619" name="RADIUS"> <rule> (Protocol[TCP] OR Protocol[UDP]) AND (Port[1812-1813]) </rule> </channel> <channel id="1620" name="SSDP"> <rule> (Protocol[TCP] OR Protocol[UDP]) AND (Port[1900]) </rule> </channel> <channel id="1621" name="Link-Local Multicast Name Resolution"> <rule> Protocol[TCP] AND Port[5355] </rule> </channel> </channels> </group> <group id="3007" name="Security"> <caption>Physical Security Protocols</caption> <help>CCTV, Access Control etc Protocols</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1701" name="RTSP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[554]) </rule> </channel> <channel id="1702" name="SDNSKMP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[558]) </rule> </channel> <channel id="1703" name="Generic CCTV"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[5656]) </rule> </channel> <channel id="1704" name="Salto"> <rule> Port[1100] or Port[5000] </rule> </channel> <channel id="1705" name="CCTV AP"> <rule> (Protocol[UDP] and (Port[47806]) </rule> </channel> </channels> </group> <group id="3008" name="Avaya Telephony"> <caption>Avaya Telephony</caption> <help>Protocols used for IP Phones</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1801" name="H323"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[1719-1720]) </rule> </channel> <channel id="1802" name="SIP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[5060-5061]) </rule> </channel> <channel id="1803" name="RTCP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[5005-5045]) </rule> </channel> <channel id="1804" name="XMPP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[5222-5223]) </rule> </channel> <channel id="1805" name="RTP"> <rule> (Protocol[TCP] or Protocol[UDP]) and (Port[6000-6011]) </rule> </channel> <channel id="1806" name="MPEG 4"> <rule> Port[6970-6974] </rule> </channel> <channel id="1807" name="DVTEL"> <rule> Port[8200-8202] or Port[8200] </rule> </channel> </channels> </group> <group id="3009" name="Aruba"> <caption>Aruba Protocols</caption> <help>Aruba Protocols</help> <defaultvalue>2</defaultvalue> <channels> <channel id="1901" name="PAPI"> <rule> Port[8211] OR Port[8209] </rule> </channel> <channel id="1902" name="AirWave"> <rule> Port[4343] </rule> </channel> <channel id="1903" name="Aruba SDN"> <rule> Port[6633] </rule> </channel> <channel id="1904" name="GRE"> <rule> Port[47] </rule> </channel> </channels> </group> <group id="3999" name="Various"> <caption>Other Protocols</caption> <help>Various</help> <defaultvalue>1</defaultvalue> <channels> <channel id="3901" name="Other UDP"> <rule> Protocol[UDP] </rule> </channel> <channel id="3902" name="Other TCP"> <rule> Protocol[TCP] </rule> </channel> </channels> </group> </groups> |
I’ve done a few things here. I’ve renumbered the group and channel IDs as the ones in the default ones were tricky to keep track of. I’ve changed some of the groupings, Citrix no longer has a group to itself and has been put under Remote Control. I’ve added services like IPSEC, SMB, SIP, Kerberos, various streaming protocols for CCTV and more. It’s a lot more useful now.
One other interesting thing to take note of – when you send flows from multiple switches to the same collector, you have to be careful to set up your sensor properly, namely the Sender IP field. If you don’t the sensor will display data from all of the flows which are being sent to that collector. That in itself is an interesting exercise (In these lockdown times, the CCTV system by far the heaviest user of the network, followed by SMB, HTTP(S) and IPSEC) but might not what you’re trying to achieve.
Comments