0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-15 14:00:42 +00:00
Commit graph

22 commits

Author SHA1 Message Date
Austin S. Hemmelgarn
63114bcedd Handle disconnected sockets in unbound collector. ()
* Handle disconnected sockets in unbound collector.

This adds an explicit check for the case of a socket that's already
disconnected and skips logging an error message.  The conditionn
technically is an error, but it's one that we can recover from trivially
by just doing nothing in this case (we were trying to disconnect the
scoket anyway, so if it's already disconnected, we don't need to change
anything).

This uses Python's `errno` module so that we can detect this situation
in a system-agnostic manner.

Fixes 
2019-07-30 23:21:39 +03:00
Ilya Mashchenko
c4e259985a
UrlService: add min required version check ()
* check urllib3 version on init
2019-06-13 10:32:40 +03:00
Ilya Mashchenko
48e9c9cc6d
UserService self._get_raw_data except fix () 2019-05-12 22:12:50 +03:00
Ilya Mashchenko
339d334129
SocketService: set socket operation timeout before connecting ()
* set socket operation timeout before connecting

* add connect, read, write timeouts

* remove .setblocking calls

* set default timeouts to 2
2019-04-25 11:16:47 +03:00
Andrey Galkin
d242e02452 NEW: allow additional name argument passing to urllib3 request in UrlService ()
- This solves monitoring of endpoints which require POST data (allows passing "body")
2019-04-18 21:50:37 +03:00
胡玮文
01b91117ca Add memory free and per process memory usage to nvidia_smi ()
<!--
Describe the change in summary section, including rationale and degin decisions.
Include "Fixes #nnn" if you are fixing an existing issue.

In "Component Name" section write which component is changed in this PR. This
will help us review your PR quicker.

If you have more information you want to add, write them in "Additional
Information" section. This is usually used to help others understand your
motivation behind this change. A step-by-step reproduction of the problem is
helpful if there is no related issue.
-->

##### Summary

Add memory free
Add per process memory usage

##### Component Name

nvidia_smi

##### Additional Information
2019-04-05 10:59:14 +03:00
Ilya Mashchenko
3cf9ddd933
python.d.plugin: allow delete dimension in runtime ()
##### Summary
Fixes: 

add `del_dimension` method to Chart class.

method does:
 - sets dimension `hidden` option
 - sets dimension `obsolete` option
 - pushes chart to netdata (write to stdout)
 - deletes dimension from chart.dimensions

##### Component Name

[`/collectors/python.d.plugin/python_modules/bases/charts.py`](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/python_modules/bases/charts.py)

##### Additional Information
2019-04-04 11:30:46 +03:00
Ilya Mashchenko
56336f5acf
py stuff: change l2isbad to ilyam8 ()
* change l2isbad to ilyam8

* change l2isbad to ilyam8
2019-03-21 12:35:44 +03:00
Ilya Mashchenko
d6d7cb59fe
mysql module add ssl connection support ()
<!--
Describe the change in summary section, including rationale and degin decisions.
Include "Fixes #nnn" if you are fixing an existing issue.

In "Component Name" section write which component is changed in this PR. This
will help us review your PR quicker.

If you have more information you want to add, write them in "Additional
Information" section. This is usually used to help others understand your
motivation behind this change. A step-by-step reproduction of the problem is
helpful if there is no related issue.
-->

##### Summary

Fixes:  

Add ssl connection support to MySQLService

> python-mysqlclient connection

```
        :param dict ssl:                                                                            
            dictionary or mapping contains SSL connection parameters;                               
            see the MySQL documentation for more details                                            
            (mysql_ssl_set()).  If this is set, and the client does not                             
            support SSL, NotSupportedError will be raised.
```

[SSL connection parameters:](https://dev.mysql.com/doc/refman/5.6/en/mysql-ssl-set.html)

 - **key**: The path name of the client private key file.
 - **cert**: The path name of the client public key certificate file.
 - **ca**: The path name of the Certificate Authority (CA) certificate file. This option, if used, must specify the same certificate used by the server.
 - **capath**: The path name of the directory that contains trusted SSL CA certificate files.
 - **cipher**: The list of permitted ciphers for SSL encryption.

##### Component Name

[`collectors/python.d.plugin/python_modules/bases/FrameworkServices/MySQLService`](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/python_modules/bases/FrameworkServices/MySQLService.py)

___

@woosley please test it

```yaml
tcp:
  name     : 'local'
  user     : 'user'
  pass     : 'pass'
  host     : 'localhost'
  port     : '3306'
  ssl:
    key:   'path/to/key'
    cert:  'path/to/cet'
    ca:    'path/to/ca'
```
2019-03-12 13:10:04 +03:00
Ilya Mashchenko
28e0d7526d
python loaders cleanup ()
<!--
Describe the change in summary section, including rationale and degin decisions.
Include "Fixes #nnn" if you are fixing an existing issue.

In "Component Name" section write which component is changed in this PR. This
will help us review your PR quicker.

If you have more information you want to add, write them in "Additional
Information" section. This is usually used to help others understand your
motivation behind this change. A step-by-step reproduction of the problem is
helpful if there is no related issue.
-->

##### Summary
python loaders module cleanup
 - move `load_module` to `python.d.plugin`
 - use `load_config` in unbound module instead of YamlOrderedLoad class
 - remove all classes from `loaders.py` - no longer used

##### Component Name
[`collectors/python.d.plugin/python_modules/bases/loaders`](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/python_modules/bases/loaders.py)
##### Additional Information
2019-03-11 16:58:00 +03:00
Ilya Mashchenko
0c0534b92e
SimpleService cleanup: do not inherit from OldVersionCompatibility ()
<!--
Describe the change in summary section, including rationale and degin decisions.
Include "Fixes #nnn" if you are fixing an existing issue.

In "Component Name" section write which component is changed in this PR. This
will help us review your PR quicker.

If you have more information you want to add, write them in "Additional
Information" section. This is usually used to help others understand your
motivation behind this change. A step-by-step reproduction of the problem is
helpful if there is no related issue.
-->

##### Summary
python SimpleService cleanup 1 - remove OldVersionCompatibility

##### Component Name

[`collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService`](collectors/python.d.plugin/python_modules/bases/FrameworkServices)


##### Additional Information

it is dead code, no longer supported
2019-03-10 22:20:43 +03:00
Ilya Mashchenko
2175673e29
python.d.plugin: use separate process for initial module checking ()
##### Summary

This PR adds (major) changes only to `python.d.plugin` file.

Fixes: 

`pyhton.d.plugin` imports a lot of additional packages during initial module initialization/job creating/checking and there is no way to unimport them, even if they arn't needed. It consumes relatively a lot of ram.

___
Memory utilization comparing before/after the PR (one job `example` module, py3.7.2):

> 21.1 => 8.8 MiB

![screenshot_20190305_111837](https://user-images.githubusercontent.com/22274335/53791147-c27a6e00-3f39-11e9-8eaf-8ac3809a3b6e.png)


##### Component Name
[`collectors/python.d.plugin`](https://github.com/netdata/netdata/blob/master/collectors/python.d.plugin/python.d.plugin.in)

##### Additional Information

This PR adds separate process for initial module checking. 

Logic:
 - main process spawns checker process
 - checker process loads every module, loads module config, creates jobs and runs job.check() for every job, if check success it adds the job to the list.
 - checker process returns list of modules and jobs.
 - main process loads only active modules, etc.
2019-03-07 13:49:56 +03:00
Adam Pardyl
c649de8e68 fix - LogService._get_raw_data under python3 fails on undecodable data ()
* Fix LogService._get_raw_data under python3

* Move python version check to init

* Mark open_args as private
2019-02-20 10:13:57 +03:00
Ilya Mashchenko
0b946686b3
fix some python codacy errors ()
* debug error instead of continue

* portcheck: remove unused variable

* postgres: remove unused variable

* SocketService: log error on disconnect instead of pass

* SocketService: add ssl_version opt to ssl.wrap_socket call

* minor
2019-02-05 15:36:43 +03:00
Andre Lehmann
2c565d4415 Remove deprecated API call ()
Using `with connection as cursor` has been deprecated in 2017 and now with 1.4.0 the API call has been removed. Therefore the cursor needs to be created and closed "manually"
2019-02-05 00:09:14 +03:00
Ilya Mashchenko
d5fb2be8ae
UrlService dont respect Retry-After header by default ()
* disable respecting retry_after_header

* fix
2019-01-02 13:28:53 +03:00
Ilya Mashchenko
5286dae8eb python.d.plugin update ()
<!--
Describe the change in summary section, including rationale and degin decisions.
Include "Fixes #nnn" if you are fixing an existing issue.

In "Component Name" section write which component is changed in this PR. This
will help us review your PR quicker.

If you have more information you want to add, write them in "Additional
Information" section. This is usually used to help others understand your
motivation behind this change. A step-by-step reproduction of the problem is
helpful if there is no related issue.
-->

##### Summary
Fix: 

`python.d.plugin` updates:
  * remove `retries` option 
  * make `penalty` configurable (enabled by default, max is 10 minutes)

> penalty indicates whether to apply penalty to update_every in case of failures.
> Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
> penalty: yes

##### Component Name

`python.d.plugin`

##### Additional Information
2018-12-07 10:15:03 +01:00
Ilya Mashchenko
44eef8d103
python.d: use real time for calc sinceLast ()
* use real time clock to calc since last update

* python.d: remove unused attr from RuntimeCounters
2018-11-26 12:43:44 +03:00
Austin S. Hemmelgarn
0f7f3d811d Fix typo and py2 compatibility issue. ()
PR  accidentally introduced a py2 compatability issue and a typo,
both of which break the sensors module.  This fixes both.
2018-11-21 07:58:00 +02:00
Austin S. Hemmelgarn
9a071dea2d
Update lm_sensors and catch specific errors. ()
This updates our copy of the libsensors Python bindings to the most
recent upstream copy, which provides proper errors instead of just
raising bare Exceptions, and updates our code to catch those errors
instead of catching bare exceptions.
2018-11-15 14:19:42 -05:00
Paweł Krupa
d47ca7429d
remove unused variables ()
##### Summary
<!--- Describe the change below, including rationale and design decisions -->
Removing variables which are not used in Python code
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->

##### Component Name
<!--- Write the short name of the module or plugin below -->
- python.d.plugin
- portcheck python module
- postgres python module

##### Additional Information
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->

<!--- Paste log output below, e.g. before and after your change -->
```paste below

```
2018-10-19 10:29:56 +02:00
Costa Tsaousis
8fbf817ef8
modularized all source code ()
* modularized all external plugins

* added README.md in plugins

* fixed title

* fixed typo

* relative link to external plugins

* external plugins configuration README

* added plugins link

* remove plugins link

* plugin names are links

* added links to external plugins

* removed unecessary spacing

* list to table

* added language

* fixed typo

* list to table on internal plugins

* added more documentation to internal plugins

* moved python, node, and bash code and configs into the external plugins

* added statsd README

* fix bug with corrupting config.h every 2nd compilation

* moved all config files together with their code

* more documentation

* diskspace info

* fixed broken links in apps.plugin

* added backends docs

* updated plugins readme

* move nc-backend.sh to backends

* created daemon directory

* moved all code outside src/

* fixed readme identation

* renamed plugins.d.plugin to plugins.d

* updated readme

* removed linux- from linux plugins

* updated readme

* updated readme

* updated readme

* updated readme

* updated readme

* updated readme

* fixed README.md links

* fixed netdata tree links

* updated codacy, codeclimate and lgtm excluded paths

* update CMakeLists.txt

* updated automake options at top directory

* libnetdata slit into directories

* updated READMEs

* updated READMEs

* updated ARL docs

* updated ARL docs

* moved /plugins to /collectors

* moved all external plugins outside plugins.d

* updated codacy, codeclimate, lgtm

* updated README

* updated url

* updated readme

* updated readme

* updated readme

* updated readme

* moved api and web into webserver

* web/api web/gui web/server

* modularized webserver

* removed web/gui/version.txt
2018-10-15 23:16:42 +03:00