Page 1 of 1

speedtest cli - basic_string::_M_construct null not valid

Posted: Sat Sep 05, 2020 9:45 am
by mr-manuel
Hello to all,

I'm trying to run a custom speedtest check through Nagios Core with the new Speedtest CLI, but when executing through Nagios Core I get this error:

Code: Select all

(No output on stdout) stderr: terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_M_construct null not valid
I created a custom command with only that line that is causing the error (shown above) in my script:

Code: Select all

define command {
    command_name	  check_internet_speed2
    command_line	  /usr/bin/speedtest -f csv --accept-license --accept-gdpr
}
The strange thing is, when I manually run the command with

Code: Select all

su nagios -c "/usr/bin/speedtest -f csv --accept-license --accept-gdpr"
then all works like expected and I get the correct result.

Code: Select all

"Internet Provider","9999","55.992","0.033","0","6100795","3089863","81891360","38620800","https://www.speedtest.net/result/c/5f1d488d-4669-48f8-ad0c-xxxxxxxxxxxxx"
I'm running a Linux Debian Buster machine with Nagios Core 4.4.6.

Anyone have some thought how I can solve this?

Let me know if you need further details.

Cheers,
Mr Manuel