SSHMon Samples Collector - Getting ParseException: Unparseable number

258 views
Skip to first unread message

Manoj Kapuganti

unread,
Sep 15, 2020, 6:23:07 AM9/15/20
to jmeter-plugins
Hi All,

I am using SSHMon Samples Collector listener to monitor CPU utilization.
When I execute the test on JMeter, getting below error. Tried executing from Powershell and its properly returning the value as expected.

Powershell command in the file:
Get-Counter -Counter "\processor(_total)\% processor time" -SampleInterval 1 -MaxSamples 1 | Foreach-Object {$_.CounterSamples[0].CookedValue}

Exception details:
2020-09-15 15:44:27,754 ERROR n.c.b.j.v.s.SSHMonSampler: Sample failure for A...@127.0.0.1:22
java.text.ParseException: Unparseable number: " [2J [?25l [m [H
[H ]0;c:\windows\system32\cmd.exe [?25h [?25l [80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C [H [?25h [?25l [80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C [H [?25h [?25l ]0;Administrator: c:\windows\system32\cmd.exe [?25h [?25l7.23394417804343 [?25h [?25l
[?25h [?25l [H7.23394417804343 [64X [64C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C [2;1H [?25h [?25l [H7.23394417804343 [64X [64C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C
[80X [80C [2;1H [?25h"
at java.text.NumberFormat.parse(Unknown Source) ~[?:1.8.0_261]
at nz.co.breakpoint.jmeter.vizualizers.sshmon.SSHMonSampler.generateSamples(SSHMonSampler.java:86) [jmeter-sshmon-1.2.jar:?]
at kg.apc.jmeter.vizualizers.MonitoringResultsCollector.processConnectors(MonitoringResultsCollector.java:215) [jmeter-plugins-cmn-jmeter-0.6.jar:?]
at kg.apc.jmeter.vizualizers.MonitoringResultsCollector.run(MonitoringResultsCollector.java:122) [jmeter-plugins-cmn-jmeter-0.6.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
2020-09-15 15:44:30,127 ERROR n.c.b.j.v.s.SSHMonSampler: Sample failure for A...@127.0.0.1:22


Thank you,
Manoj

till.n...@gmail.com

unread,
Sep 28, 2020, 9:27:18 PM9/28/20
to jmeter-plugins
Hi Manoj,

It would be helpful if you could describe exactly what your setup looks like, i.e. how your server (or local host) is running the SSH server, and what exactly is configured in the plugin in JMeter.

As for your issue, I imagine that those characters the plugin receives from the server are exactly what is returned by Powershell.
However they are not visible if you run this in a Powershell command window, as the characters would be interpreted as terminal control sequences (e.g. changing colour, cursor location, etc.)

I'm keen to understand this better as I have been looking for a way to monitor Perfmon counters on Windows servers without the need for any monitoring agent running on those servers.
Perhaps then a feature can be added to the plugin that optionally filters out or interprets the control characters, unless the can be turned off on the Powershell side.

Till
Message has been deleted

Doug Stewart

unread,
Oct 2, 2020, 1:06:03 PM10/2/20
to jmeter-plugins

Hi Till,
I am trying to do the same thing as Manoj and obtaining the same results. I have a WIn10 VM with JMeter installed and a Win 2016 server (setup on a VM also) that I am trying to get the performance numbers from. I tried running the Perfmon sampler with the agent running on the server but am having issues there so I opted to try using the SSHMon sampler based on what I was seeing in an article on the following website: 
I have OpenSSH set up on the server and am able to run the Powershell script (cpu.ps1 from the above article) from my Win10 machine just fine using ssh.

Capture.PNG
The win10 VM is set up as follows:
Java: 1.8.0_261
JMeter: 5.3
SSHMon: 1.2

The Win 2016 server is the standard edition version 1607 with OpenSSH-Win64 installed.

When running JMeter this is typically what I am getting:
tempsnip.png
Also, using a command as simple as "echo %RANDOM%", which also works via SSH from the command line, returns the same result which would indicate that it is not necessarily a Powershell issue. The question then is why would it work fine via SSH on the same machine that I am running JMeter on but not when running through JMeter?  There must be something different about how the sampler sets up the SSH request verses running it on the command line. Any help would be appreciated. Thanks, Doug

till.n...@gmail.com

unread,
Oct 5, 2020, 12:30:42 AM10/5/20
to jmeter-plugins
Hi Doug,

Thanks for those details.

I imagine it has something to do with how the two clients configure the connection, explicitly (config file, ~/.ssh/config), or implicitly (e.g. environment variables).
For example, the Windows SSH client could be using a different TERM value so the server sends back something different than to the jsch-based Java client.

Or it may be the WIndows CMD window it runs from, that interprets the control characters/escape sequence whereas the plugin does not.

To diagnose this a bit further, can I suggest the following:
1. Try again with the 1.3-SNAPSHOT version of the plugin as this changes the underlying SSH client library (don't forget to provide the new jar file dependencies),
2. Run the SSH command line with -vvv for extra verbose output, perhaps that reveals something,
3. Wireshark the bytes that are sent back from the server to the Windows client to confirm that the escape characters are in fact not sent rather than just not showing (interpreted).

Till

till.n...@gmail.com

unread,
Oct 7, 2020, 1:56:04 AM10/7/20
to jmeter-plugins
I have replicated the issue locally (ssh to localhost) with version 1.2 of the plugin (Windows Server 2012 R2, Win32-OpenSSH v8.1, Java 8, JMeter v5.1.1).

However, with 1.3-SNAPSHOT it seems to work fine, so I'd suggest you give this a try.

Till

sshmon.png

Doug Stewart

unread,
Oct 7, 2020, 10:54:39 AM10/7/20
to jmeter-plugins
Hi Till,
Thanks for the 1.3 snapshot. It does indeed correct the problem for me. Thanks again for your help.
Doug

Shamanth Nellikere

unread,
Oct 30, 2020, 7:05:41 AM10/30/20
to jmeter-plugins
Spent almost two days trying to debug with 1.2, installed 1.3 it worked like magic, thanks a lot. 
Reply all
Reply to author
Forward
0 new messages