jonwitts / nagios-speedtest Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://www.jonwitts.co.uk/archives/315
License: GNU General Public License v3.0
Home Page: http://www.jonwitts.co.uk/archives/315
License: GNU General Public License v3.0
Hi!
During the last period, I observed that the Servers available for the test is changing continuously.
So, if you writhe the server ID into a NAGIOS\ICINGA command, in case this server will change - the command does not work anymore.
Is possible to select the best server automatically?
As you do, when you run the script manually?
THX
Hi!
I have run into an issue and hoping you can assist. I have installed the plugin but now getting this in the nagios service output.
"You do not have the expected number of indices in your output from SpeedTest. Is it correctly installed? Try running the check with the -V argument to see what is going wrong."
Looking at the previous issue raised. I tested the output from the terminal of the host using..
./check_speedtest-cli.sh -w 40 -c30 -W 40 -C 30 -l e -s 5161 -V
.. And it works perfectly!
Any ideas what it could be? Your help would be greatly helped.. fyi bit of a noob.
Hi,
Thanks for the very useful plugin.
I am having trouble wiht the -p option breaking the script both on the command line and when used in a nagios service both work without the -p though.
I have also setup a fresh install of nagiosgraph and it sees all the other service checks on the host bar this one... would this have something to do with not using the -p?
I'm using ubuntu 18.04.3
Any help would be most appreiciated.
Thanks.
Hi all,
I have installed speedtest-cli script and I get this error
You do not have the expected number of indices in your output from SpeedTest. Is it correctly installed? Try running the check with the -V argument to see what is going wrong.
What should I do to fix that?
Thanks in advance and regards
The Nagios Plugin Development Guidelines (https://nagios-plugins.org/doc/guidelines.html#THRESHOLDFORMAT) inform us that a warning threshold configured as
-w 35
means that any returned value higher than 35 wil issue a warning. For check_speedtest-cli.sh however lower values are worse than higher values. Officially (according to the plugin development guidelines)
warning and critical thesholds for download should be configured like this:
-w 35: -c 25:
The script fails with:
Download Warning Level with a value of: 35: is not a number!
and I can imagine that it will make it extra complex for relative new users of your plugin. So I can understand that the current situation is:
-w 35 -c 25
However it has a negative side affect on the gauge dashlets available in the commercial version of Nagios; Nagios XI. The current performance data for one of the data sources looks like this:
|'download'=39.59;35;25 '
So the actual value is 39.59 (just on de safe side from warning and critical thresholds, respectively 35 and 25). The gauge looks like this:
A corrected version of an upload datasource (instead of download) with warning=25 and critical=10 may look like this:
'upload'=38.55;25:;10:;0;100
now the gauges shows this behaviour:
I intentionally made the maxiumum scale four times the warning threshold (4*25)
The code I used:
'upload'=$upload;$ULw:;$ULc:;0;$(echo $ULw*4|bc)"
So I suggest changing
perfout="|'download'=$download;$DLw;$DLc 'upload'=$upload;$ULw;$ULc"
to
perfout="|'download'=$download;$DLw:;$DLc:;0;$(echo $DLw4|bc) 'upload'=$upload;$ULw:;$ULc:;0;$(echo $ULw4|bc)"
Please let me know your feedback on this.
Hello,
Running speedtest --simple return the following:
Traceback (most recent call last):
File "/usr/bin/speedtest", line 1843, in
main()
File "/usr/bin/speedtest", line 1832, in main
shell()
File "/usr/bin/speedtest", line 1729, in shell
secure=args.secure
File "/usr/bin/speedtest", line 1009, in init
self.get_config()
File "/usr/bin/speedtest", line 1042, in get_config
uh, e = catch_request(request, opener=self._opener)
File "/usr/bin/speedtest", line 650, in catch_request
uh = _open(request)
File "/usr/lib64/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.6/urllib2.py", line 429, in error
result = self._call_chain(*args)
File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib64/python2.6/urllib2.py", line 616, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib64/python2.6/urllib2.py", line 391, in open
response = self._open(req, data)
File "/usr/lib64/python2.6/urllib2.py", line 409, in _open
'_open', req)
File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/bin/speedtest", line 489, in https_open
req
File "/usr/lib64/python2.6/urllib2.py", line 1136, in do_open
h = http_class(host, timeout=req.timeout) # will parse host:port
File "/usr/bin/speedtest", line 444, in inner
return connection(host, **kwargs)
TypeError: init() got an unexpected keyword argument 'source_address'
It was working in the past!
Regards,
Hello there so i put my script in :
/usr/lib/nagios/plugins
i add on the script :
########### End of functions ########################################
# Set up the variable for the location of the speedtest binary.
# Edit the line below so that the variable is defined as the location
# to speedtest on your system. On mine it is /usr/local/bin
# Ensure to leave the last slash off!
# You MUST define this or the script will not run!
STb=/usr/local/bin
# Set up the variables to take the arguments
DLw=800
DLc=500
ULw=250
ULc=100
Loc=e
SEs=23884
PerfData=
MaxDL=
MaxUL=
debug=
`
```
i verify in /usr/local/bin the presence of speedtest-cli :
```
root@debian:/usr/lib/nagios/plugins# ls /usr/local/bin/speedtest
/usr/local/bin/speedtest
```
but when i lunch it i got this :
`root@debian:/usr/lib/nagios/plugins# ./check_speedtest-cli.sh -c 500 -w 800 -C 100 -W 250 -l e -s 23884 -p TRUE -m 1000 -M 300
******************************************************************************************
Nagios speedtest-cli plugin - Version: 1.2 2017122011:01
OPTIONS:
-h Show this message
-w Download Warning Level - *Required* - integer or floating point
-c Download Critical Level - *Required* - integer or floating point
-W Upload Warning Level - *Required* - integer or floating point
-C Upload Critical Level - *Required* - integer or floating point
-l Location of speedtest server - *Required * - takes either "i" or "e". If you pass "i" for
Internal then you will need to pass the URL of the Mini Server to the "s" option. If you pass
"e" for External then you must pass the server integer to the "s" option.
-s Server integer or URL for the speedtest server to test against - *Required* - Run
"speedtest --list | less" to find your nearest server and note the number of the server
or use the URL of an internal Speedtest Mini Server
-p Output Performance Data
-m Download Maximum Level - *Required if you request perfdata* - integer or floating point
Provide the maximum possible download level in Mbit/s for your connection
-M Upload Maximum Level - *Required if you request perfdata* - integer or floating point
Provide the maximum possible upload level in Mbit/s for your connection
-v Output plugin version
-V Output debug info for testing
This script will output the Internet Connection Speed using speedtest-cli to Nagios.
You need to have installed speedtest-cli on your system first and ensured that it is
working by calling "speedtest --simple".
See here: https://github.com/sivel/speedtest-cli for info about speedtest-cli
First you MUST define the location of your speedtest install in the script or this will
not work.
The speedtest-cli can take some time to return its result. I recommend that you set the
service_check_timeout value in your main nagios.cfg to 120 to allow time for
this script to run; but test yourself and adjust accordingly.
You also need to have access to bc on your system for this script to work and that it
exists in your path.
Your warning levels must be higher than your critical levels for both upload and download.
Performance Data will output upload and download speed against matching warning and
critical levels.
Jon Witts
******************************************************************************************
`
if i lunch with no parametre works :
```
root@debian:/usr/lib/nagios/plugins# ./check_speedtest-cli.sh
CRITICAL - Ping = 38.715 ms Download = 7.36 Mbit/s Upload = 0.96 Mbit/s
```
what is wrong with parameter
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.