What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Difference between "speednet" and "bytesbandwith" unit types

Votes:

0

Hi, I have created a python script to return data to PRTG. The scripts reads a json string containing upload and download bandwith values. In my Python script I use the following settings to send them to PRTG: ... csr.add_primary_channel(name="Download", value=d_b, unit=ValueUnit.SPEEDNET, speed_size=ValueSize.MEGABIT, is_float=False) csr.add_channel(name="Upload", value=u_b, unit=ValueUnit.SPEEDNET, speed_size=ValueSize.MEGABIT, is_float=False) ...

When I use the above code, the values in PRTG always show as "nnn /s" although I set the ValuSize in my script to MEGABIT. Also on the sensor Channel settings in PRTG I have no option to change that to Mbps.

When I use the ValueUnit.BYTESBANDWITH, with the same ValueSize.MEGABIT, the values show up as Kbit/s in PRTG, but I do have the option in PRTG to change them to Mbit/s

1) is this a bug in the Python PRTG module that it doesn't use the correct ValueSize?
2) What's the difference between SpeedNet and BytesBandwith unit options?
3) What is best used to keep track of up- and downloadspeeds of a connection?

Thanks a lot for your input.

bandwidth-speed custom-sensor python

Created on Apr 19, 2021 7:22:34 PM

Last change on Apr 20, 2021 7:58:01 AM by  Felix Wiesneth [Paessler Support]



17 Replies

Votes:

0

What's the actual output of your script when run manually? SpeedNet and BytesBandwidth are measuring speed and throughput. The latter also allows for reporting on throughput over a certain timespan. The first one is best for what you're intending to do. iirc, the right value to use would be bytes for this in order for PRTG to calculate correctly :)

Created on Apr 27, 2021 11:38:23 AM by  Stephan Linke [Paessler Support]



Votes:

0

Stephan,

When I use SpeedNet as ValueUnit, it always shows up in bytes and I can't use the ValueSize option (actually I can but it doesn't change anything). I can also not change it using the PRTG channel settings When I use BytesBandwidth as ValueUnit, I can also set the ValueSize option and the values show as MBit/s in PRTG in stead of in bytes/s.

I'm actually running the speedtest.net cli program and parse the output in the python script to get an (hourly) update of my internet connection speed. That's why I also thought SpeedNet was the one to use, but then I only get values in bytes/s and I actually wont the see it in a more human-readable format (the times of 56k modem connections are long behind us already, we're measuring in Mbps now :-))

Created on Apr 27, 2021 12:00:13 PM



Votes:

0

Well speednet would work for that, you can configure the channel unit configuration in the device settings, have you tried that one? :)

Created on May 3, 2021 7:52:09 AM by  Stephan Linke [Paessler Support]



Votes:

0

On the device settings, it says: No configurable channels...

Created on May 3, 2021 8:05:45 AM



Votes:

0

But your sensor clearly has channels, right? Could you post a screenshot of the device settings, at the very bottom where it states that? I have yet to see this message :)

Created on May 3, 2021 8:08:32 AM by  Stephan Linke [Paessler Support]



Votes:

0

See screenshot. Sensor is currently paused, so no live data visible. Channels Download en Upload are setup with SpeedNet unit.

Created on May 3, 2021 8:15:39 AM



Votes:

0

Still the same when resuming it?

Created on May 3, 2021 12:14:07 PM by  Stephan Linke [Paessler Support]



Votes:

0

Yes. Just started the sensor again, values are updated correctly, but only showing in bits /s and no way to change it to Mbps.

Created on May 3, 2021 12:29:54 PM



Votes:

0

When you're in the Sensor, open up its settings tab. At the bottom, there should be a section "Channel Unit Configuration" where you can set this - is that not the case here?

Created on May 3, 2021 1:00:14 PM by  Stephan Linke [Paessler Support]



Votes:

0

No. It says: no configurable channels. On the other senor, using the BytesBandwidth as Unit, I do have an option to change it to Kbps/Mbps/...

Created on May 3, 2021 1:03:10 PM



Votes:

0

What happens if you click in the gear icon of the Channels? Can you send me a screenshot of that?

Created on May 7, 2021 2:02:23 PM by  Miguel Aikens [Paessler Technical Support]



Votes:

0

Created on May 7, 2021 3:38:59 PM



Votes:

0

Hi,

Have you tried changing the Channel Unit directly from the device? Please review the following document: https://www.paessler.com/manuals/prtg/device_settings#channel

Another option is to change the script so that it reports BytesBandwidth (unit) without a customunit, SpeedSize or VolumeSize.

Hope this helps.

Created on May 11, 2021 8:54:44 PM by  Miguel Aikens [Paessler Technical Support]



Votes:

1

Hi,

When using the BytesBandwidth type I can change it to KB/MB/GB without any problem. It's when using SpeedNet as unit that I always get it in bytes/s and there's no way to change it to mega- or gigabytes/s. I just created a new sensor with the script only specifying SPEEDNET as Unit and no other options, but in PRTG I have no way to change it to MB/GB/... Not in the settings, nor in the channel configuration.

Created on May 12, 2021 12:05:51 PM



Votes:

0

Hi,

I believe the best option is to open up a ticket with us and if needed gather logs for analysis. To open up a ticket you can do it directly from the Contact Support option in the Core Server web interface.

Created on May 17, 2021 6:01:42 PM by  Miguel Aikens [Paessler Technical Support]



Votes:

0

Hello Mickeybyte. Did you get any support?

I am experiencing the same issue with a similar sensor. The whole sensor is in the code snippet below.

I would expect that simple SpeedNet unit with SpeedSize Byte will show it as simple as in Byte/s and allow me to change it in the channel unit configuration. But there is nothing about the SpeedNet in channel unit sensor settings. I tried byte, bit, in VolumeSize, SpeedSize, SpeedTime, nothing lead to success.

So question to the Paessler:

How does this work? What is expected result? How we can reach the state when we can configure the Bytes/s to be Megabytes/s (or alternative) from the UI same as for Bandwidth?

Sensor

Sensor Settings > Channel units

Also from help from speedtest cmd: Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision

So the $cosi.download.bandwitdth is Byte/s

#!/usr/bin/env pwsh
param([Switch] $Push)

$cosi = '{ "server": { "name": "ahoj", "location": "loc" }, "result": { "url": "url" } }'
#$cosi2 = '{"type":"result","timestamp":"2022-01-02T15:27:25Z","ping":{"jitter":0.71499999999999997,"latency":26.661000000000001},"download":{"bandwidth":1129525,"bytes":14619008,"elapsed":15011},"upload":{"bandwidth":1129272,"bytes":10069392,"elapsed":9003},"packetLoss":0.67796610169491522,"isp":"K-net Technical International Group, s.r.o.","interface":{"internalIp":"....","name":"eth0","macAddr":"DC:A6:32:74:F0:9F","isVpn":false,"externalIp":"...."},"server":{"id":29593,"host":"speed2.brno.master.profihost.cloud","port":8080,"name":"PROFI CLOUD SERVICES s.r.o.","location":"Brno","country":"Czech Republic","ip":"77.93.201.229"},"result":{"id":"57f71161-a25e-4a25-a782-563ed2ec4fde","url":"https://www.speedtest.net/result/c/57f71161-a25e-4a25-a782-563ed2ec4fde","persisted":true}}'
# $cosi = & speedtest --format="json" --accept-license --accept-gdpr
$cosi = $cosi | ConvertFrom-Json

$server = $cosi.server
$server = $server.name + ' - ' + $server.location
$resultURL = $cosi.result.url

$result = @{
	'prtg' = @{
		'text'   = "$server ($resultURL)"
		'result' = @(
			@{
				'Channel'         = 'Download Speed'
				'Value'           = 2125027
				# 'Value'           = ($cosi.download.bandwidth ?? 0)
				'Float'           = 1
				'DecimalMode'     = 'All'
				'Unit'            = 'SpeedNet'
				'VolumeSize'      = 'Byte'
				'SpeedSize'       = 'Byte'
				'LimitMode'       = 1
				'LimitMinWarning' = 1
			},
			@{
				'Channel'     = 'Downloaded Data'
				'Value'       = ($cosi.download.bytes ?? 0)
				'Float'       = 1
				'DecimalMode' = 'All'
				'Unit'        = 'BytesBandwidth'
			},
			@{
				'Channel'     = 'Upload Speed'
				'Value'       = 2167276
				# 'Value'       = ($cosi.upload.bandwidth ?? 0)
				'Float'       = 1
				'DecimalMode' = 'All'
				'Unit'        = 'SpeedNet'
				'VolumeSize'  = 'Bit'
				'SpeedSize'   = 'Bit'
			},
			@{
				'Channel'     = 'Uploaded Data'
				'Value'       = ($cosi.upload.bytes ?? 0)
				'Float'       = 1
				'DecimalMode' = 'All'
				'Unit'        = 'BytesBandwidth'
			},
			@{
				'Channel'     = 'Latency'
				'Value'       = $cosi.ping.latency ?? 0
				'Float'       = 1
				'DecimalMode' = 'All'
				'Unit'        = 'TimeResponse'
			},
			@{
				'Channel'     = 'Latency Jitter'
				'Value'       = $cosi.ping.jitter ?? 0
				'Float'       = 1
				'DecimalMode' = 'All'
				'Unit'        = 'TimeResponse'
			},
			@{
				'Channel'         = 'Packet Loss'
				'Value'           = ($cosi.packetloss ?? 0)
				'Float'           = 1
				'DecimalMode'     = 'All'
				'Unit'            = 'Percent'
				'LimitMode'       = 1
				'LimitMaxError'   = 60
				'LimitMaxWarning' = 30
			}
		)
	}

} | ConvertTo-Json -Depth 20 -Compress

if ($Push) {
	$ProgressPreference = 'SilentlyContinue'
	Invoke-WebRequest '<Redacted>' -Method 'Post' -Body $result -Headers @{
		'Content-Type' = 'application/json'
	} | Out-Null
} else {
	return $result
}

Created on Jan 2, 2022 4:21:41 PM



Votes:

0

This issue has been in the freezer for some time now. Never opened a support ticket for it. Sorry.

Created on Feb 21, 2022 10:37:18 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.