0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-08 07:10:12 +00:00
Commit graph

714 commits

Author SHA1 Message Date
Austin S. Hemmelgarn
b95971fe21
Fix broken claiming via kickstart on some systems. () 2024-10-15 14:09:16 -04:00
Ilya Mashchenko
d8c5963e0b
fix(netdata-updater.sh): ensure --non-interactive flag is passed during self-update () 2024-10-15 14:59:11 +03:00
Austin S. Hemmelgarn
0a16c36fe8
Add Ubuntu 24.10 and Fedora 41 to CI. ()
* Add Ubuntu 24.10 and Fedora 41 to CI.

* Fix broken DNF package install checking in dependency handling script.

* Force usage of DNF on Fedora for dependency handling.
2024-10-11 11:27:21 -04:00
Fotis Voutsas
7332919cf5
Docs fixes () 2024-10-04 12:23:00 +03:00
Fotis Voutsas
1ddbc6610d
Docs lint on packaging/ dir ()
* docker readme pass

* installer/methods docs pass

* installer/ docs pass

* maintainers dir docs pass

* rest of packaging dir md docs pass
2024-10-03 12:07:25 +03:00
thiagoftsm
59d806e23b
Windows Installer (Silent mode) () 2024-10-01 18:24:01 +00:00
Austin S. Hemmelgarn
3c91cb0066
Use temporary file for commit date check. () 2024-10-01 06:50:43 -04:00
vkalintiris
7d4f9c58d5
Move plugins.d directory outside of collectors ()
* Move plugins.d out of collectors

It's being used by streaming as well.

* Move ndsudo and local_listeners back to collectors.
2024-09-30 13:14:26 +00:00
eya46
a270a04b6f
Update kickstart.sh ()
use "echo -e"
2024-09-20 19:46:16 +03:00
Austin S. Hemmelgarn
d837a629fb
Assorted build cleanup for external data collection plugins. ()
* Make Python collectors optional at build time.

Given the general shift of most data collectors to the Go plugin, it’s
no-longer the case that users ‘always’ need to have the Python plugin
included.

This also makes them consistent with the other external collectors.

* Make charts.d collectors optional at build time.

Same reasoning as for the Python collectors.

Also, this fixes up loopsleepms.sh to only be handled if a collector
that needs it is enabled.

* Properly tie config directories to their plugin components.

The Go and Python plugin config directories were being installed
unconditionally as part of the main Netdata component. This is wrong,
they should be installed as part of the plugin packages/components
instead, as they are only needed if those plugins are installed.
2024-09-16 07:25:06 -04:00
Ilya Mashchenko
8d8a6a8cd9
fix some docs issues () 2024-09-14 23:12:15 +03:00
Costa Tsaousis
a399128dbf
config parsers ()
* added parser for durations

* preliminary work for timeframes

* Update CMakeLists.txt

* updated parsing and generation for durations

* renames

* report parser errors; added compatibility to existing config_parse_duration()

* duration parsing is used on most netdata.conf and stream.conf entries

* more uses of duration parsing; simplification of stream.conf

* code cleanup

* more duration changes

* added html playground

* improved js code

* duration parsing applied to dbengine retention

* fixed doc

* simplified logic; added size parser

* added parsing for sizes

* renames and documentation updates

* hide appconfig internals from the rest of netdata

* fix crash on cleanup of streaming receivers

* fix buffer overflow in gorilla compression

* config return values are const

* ksm set to auto

* support reformatting migrated values

* removed obsolete metrics correlations settings

* split appconfig to multiple files

* durations documentation

* sizes documentation

* added backward compatibility in retention configuration

* provide description on migrations and reformattings

* config options are now a double linked list

* config sections are now a double linked list; config uses spinlocks; code cleanup and renames

* added data type to all config options

* update data types

* split appconfig api to multiple files

* code cleanup and renames

* removed size units above PiB

* Revert "fix buffer overflow in gorilla compression"

This reverts commit 3d5c48e84b.

* appconfig internal api changes
2024-09-04 14:42:01 +03:00
Ilya Mashchenko
933a2090c9
kickstart: fix write_claim_config when executed as a regular user ()
* kickstart: fix write_claim_config when executed as a regular user

* fix return
2024-08-25 22:27:17 +03:00
Costa Tsaousis
4c0122063f
WIP - Netdata v2 ()
* split claiming into multiple files; WIP claiming with api

* pidfile is now dynamically allocated

* netdata_exe_path is now dynamically allocated

* remove ENABLE_CLOUD and ENABLE_ACLK

* fix compilation

* remove ENABLE_HTTPS and ENABLE_OPENSSL

* remove the ability to disable cloud

* remove netdata_cloud_enabled variable; split rooms into a json array

* global libcurl initialization

* detect common claiming errors

* more common claiming errors

* finished claiming via API

* same as before

* same as before

* remove the old claiming logic that runs the claim script

* working claim.conf

* cleanup

* fix log message; default proxy is env

* fix log message

* remove netdata-claim.sh from run.sh

* remove netdata-claim.sh from everywhere, except kickstart scripts

* create cloud.d if it does not exist.

* better error handling and logging

* handle proxy disable

* merged master

* fix cmakelists for new files

* left-overs removal

* Include libcurl in required dependencies.

* Fix typo in dependency script.

* Use pkg-config for finding cURL.

This properly handles transitive dependencies, unlike the FindCURL
module.

* netdata installer writes claiming info to /etc/netdata/claim.conf

* remove claim from netdata

* add libcurl to windows packages

* add libcurl to windows packages

* compile-on-windows.sh installs too

* add NODE_ID streaming back to child and INDIRECT cloud status

* log child kill on windows

* fixes for spawn server on windows to ensure we have a valid pid and the process is properly terminated

* better handling to windows processes exit code

* pass the cloud url from parents to children

* add retries and timeout to claiming curl request

* remove FILE * from plugins.d

* spawn-tester to unittest spawning processes communication

* spawn-tester now tests FILE pointer I/O

* external plugins run in posix mode

* set blocking I/O on all pipes

* working spawn server on windows

* latest changes in spawn_popen applied to linux tools

* push environment

* repeated tests of fds

* export variable CYGWIN_BASE_PATH

* renamed to NETDATA_CYGWIN_BASE_PATH

* added cmd and help to adapt the command and the information to be presented to users during claiming

* split spawn server versions into files

* restored spawn server libuv based

* working libuv based spawn server

* fixes in libuv for windows

* working spawn server based on posix_spawn()

* fix fd leads on all spawn servers

* fixed windows spawn server

* fix signal handling to ensure proper cooperation with libuv

* switched windows to posix_spawn() based spawn server

* improvement on libuv version

* callocz() event loop

* simplification of libuv spawn server

* minor fixes in libuv and spawn tester

* api split into parts and separated by version; introduced /api/v3; no changes to old /api/v1 and /api/v2

* completed APIs splitting

* function renames

* remove dead code

* split basic functions into a directory

* execute external plugins in nofork spawn server with posix_spawn() for improved performance

* reset signals when using posix_spawn()

* fix spawn server logs and log cmdline in posix server

* bearer_get_token() implemented as function

* agent cloud status now exposes parent claim_id in indirect mode

* fixes for node id streaming from parent to children

* extract claimed id to separate file

* claim_id is no longer in host structure; there is a global claim_id for this agent and there are parent and origin claim ids in host structure

* fix issue on older compilers

* implement /api/v3 using calls from v1 and v2

* prevent asan leaks on local-sockets callback

* codacy fixes

* moved claim web api to web/api/v2

* when the agent is offline, prefer indirect connection when available; log a warning when a node changes node id

* improve inheritance of claim id from parent

* claim_id for bearer token show match any of the claim ids known

* aclk_connected replaced with functions

* aclk api can now be limited to node information, implementing [cloud].scope = license manager

* comment out most options in stream.conf so that internal defaults will be applied

* respect negative matches for send charts matching

* hidden functions are not accessible via the API; bearer_get_token function checks the request is coming from Netdata Cloud

* /api/v3/settings API

* added error logs to settings api

* saving and loading of bearer tokens

* Fix parameter when calling send_to_plugin

* Prevent overflow

* expose struct parser and typedef PARSER to enforce strict type checking on send_to_plugin()

* ensure the parser will not go away randomly from the receiver - it is now cleared when the receiver lock is acquired; also ensure the output sockets are set in the parser as long as the parser runs

* Add newline

* Send parent claim id downstream

* do not send anything when nodeid is zero

* code re-organization and cleanup

* add aclk capabilities, nodes summary and api version and protection to /api/v2,3/info

* added /api/v3/me which returns information about the current user

* make /api/v3/info accessible always

* Partially revert "remove netdata-claim.sh from everywhere, except kickstart scripts"

Due to how we handle files in our static builds and local builds, we
actually need to continue installing `netdata-claim.sh` to enable a
seamless transition to the new claiming mechanims without breaking
compatibility with existing installs or existing automation tooling that
is directly invoking the claiming script.

The script itself will be rewritten in a subsequent commit to simply
wrap the new claiming methodology, together with some additional changes
to ensure that a warning is issued if the script is invoked by anything
other than the kickstart script.

* Rewrite claiming script to use new claiming method.

* Revert "netdata installer writes claiming info to /etc/netdata/claim.conf"

Same reasoning as for 2e27bedb3fbf9df523bff407f2e8c8428e350e38.

We need to keep the old claiming support code in the kickstart script
for the forseeable future so that existing installs can still be
claimed, since the kickstart script is _NOT_ versioned with the agent.

A later commit will add native support for the new claiming method and
use that in preference to the claiming script if it appears to be
available.

* Add support for new claiming method to kickstart.sh.

This adds native support to the kickstart script to use the new claiming
method without depending on the claiming script, as well as adding a few
extra tweaks to the claiming script to enable it to better handle the
transition.

Expected behavior is for the kickstart script to use the new claiming
code path if the claiming script is either not installed, or does not
contain the specific string `%%NEW_CLAIMING_METHOD%%`. This way we will
skip the claiming script on systems which have the updated copy that
uses the new claiming approach, which should keep kickstart behavior
consistent with what Netdata itself supports.

* Depend on JSON-C 0.14 as a minimum supported version.

Needed for uint64 functions.

* Fix claiming option validation in kickstart script.

* do not cache auth in web client

* reuse bearer tokens when the request to create one matches an existing

* dictionaries dfe loops now allow using return statement

* bearer token files are now fixed for specific agents by having the machine guid of the agent in them

* systemd journal now respects facets and disables the default facets when not given

* fixed commands.c

* restored log for not openning config file

* Fix Netdata group templating for claiming script.

* Warn on failed templating in claiming script.

* Make `--require-cloud` a slient no-op.

We don’t need to warn users that it does nothing, we should just have ti
do nothing.

* added debugging info to claiming

* log also the response

* do not send double / at the url

* properly remove keyword from parameters

* disable debug during claimming

* fix log messages

* Update packaging/installer/kickstart.sh

* Update packaging/installer/kickstart.sh

* implemented POST request payload parsing for systemd-journal

* added missing reset of facets in json parsing

* JSON payload does not need hashes any more. I can accept the raw values

---------

Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud>
Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
2024-08-23 14:12:01 +03:00
thiagoftsm
392e1fa0b0
Update windows installer () 2024-08-21 12:07:43 +00:00
Austin S. Hemmelgarn
6089849cf6
Add detailed reporting of failed checksums in kickstart script. ()
* Add detailed reporting of failed checksums in kickstart script.

* Fix output.
2024-08-08 07:24:31 -04:00
Austin S. Hemmelgarn
b936b41c66
Fix CI issues in build workflow. ()
* Temporarily enable trace mode to debug CI.

* Fix tmpdir path handling.

* Further kickstart fixes.
2024-08-06 13:57:58 -04:00
Austin S. Hemmelgarn
a817a5c75b
Clean up unneeded depencdencies. () 2024-07-30 13:27:09 -04:00
Austin S. Hemmelgarn
16750eacdf
Remove logs-management plugin. ()
It’s not been supported properly pretty much since it was introduced.
2024-07-17 07:04:55 -04:00
Austin S. Hemmelgarn
be1dc2ea51
Bump repository config fetched by kickstart to latest version. () 2024-06-28 10:05:00 -04:00
Ilya Mashchenko
a567f32357
fix grep warning in kickstart () 2024-06-27 14:26:06 +03:00
Ilya Mashchenko
145df7a801
updater: handle json decode error in newer_commit_date() () 2024-06-17 15:28:02 +03:00
Ilya Mashchenko
3c507b4edb
add netdata journald configuration ()
* add netdata journald configuration

* update uninstaller

* put in "/usr/lib/systemd/journald@netdata.conf.d/"

* update uninstaller

* Update CMakeLists.txt

Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>

* Update system/systemd/journald@netdata.conf

* fix

* usr/lib

---------

Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
2024-06-14 19:18:08 +03:00
Austin S. Hemmelgarn
9b7777703c
Improve anacron detection in updater. ()
* Improve anacron detection in updater.

Instead of only checking the parent and grandparent processes, walk up
the process tree until we either find anacron or find init (or hit the
recursion limit for the function, which is currently 50 iterations).
This is needed because at least on some systems there is more than one
intermediate process between the script and anacron.

* Fix PID selection.
2024-06-12 11:41:37 -04:00
Austin S. Hemmelgarn
405a1635a5
Add improved handling for TLS certificates for static builds. ()
* Add improved handling for TLS certificates for static builds.

* Properly replace symlinks.

* Fix shellcheck warning.

* Fix option handling.

- Persist certificate handling mode and check URL across reinstalls.
- Properly consume the arguments for the certificate handling options.

* Add five minute hard timeout on certificate check.

* Differentiate specific error results from curl.

* Persist cert handling options regardless of how they’re passed in.

* Escape slashes in REINSTALL_OPTIONS.

* Fix escaping of reinstall options.
2024-06-12 07:05:39 -04:00
Austin S. Hemmelgarn
9a7bfb9839
Disable updater jitter when run from anacron. ()
* Disable updater jitter when run from anacron.

* Adjust checking to account for busybox ps.

* Check process grandparents as well to handle the use of run-parts.

* Make anacron check more portable.

On Linux when procfs is mounted, use that instead of `ps` because some
older Linux systems apparently don’t support the `ppid` field in `ps`.

Also, allow a variable number of spaces prior to the PID when parsing
`ps` output, as this is less portable than I first realized.

* Address a few additional issues in the detection code.

* Fix additional regexes when parsing ps output.
2024-06-10 06:52:59 -04:00
Fotis Voutsas
38baccf80a
Change "War Room" to "Room" and other docs changes () 2024-05-30 14:16:13 +03:00
Fotis Voutsas
543d2b6096
simplify installation page ()
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
2024-05-27 15:08:14 +03:00
Fotis Voutsas
d3ff7e9818
PR to change absolute links to relative () 2024-05-21 12:58:32 +03:00
Ilya Mashchenko
b6617322fc
some markdown fixes () 2024-05-19 22:19:48 +03:00
Fotis Voutsas
9e236258a5
fix broken links and links pointing to Learn () 2024-05-16 12:54:02 +03:00
Austin S. Hemmelgarn
002c9518f1
Support offline installs in the updater code. () 2024-05-15 07:54:48 -04:00
Fotis Voutsas
effe8e6f26
files movearound () 2024-05-15 10:01:46 +03:00
Fotis Voutsas
7c9dfe1f09
Update the claim readme ()
Co-authored-by: ilyam8 <ilya@netdata.cloud>
2024-05-14 13:06:17 +03:00
Ilya Mashchenko
837c6a1fd9
add pcre2 to install-required-packages "netdata" for macOS () 2024-05-10 14:37:37 +03:00
Austin S. Hemmelgarn
8719db2641
Add option to limit architectures for offline installs. ()
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
2024-05-07 15:42:40 +03:00
Austin S. Hemmelgarn
6487fc4e1e
Make offline installs properly offline again. ()
* Make offline installs properly offline again.

* Update packaging/installer/kickstart.sh

* Clean up path canonicalization.

---------

Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
2024-05-06 13:16:17 -04:00
Austin S. Hemmelgarn
90552bd501
Fix handling of vendored eBPF code in CMake. ()
* Fix logic error in CMake code for kernel version detection.

* Force legacy libbpf for CentOS 7 and AL 2 package builds.

* Check target kernel version instead of host kernel version.

This should help when building in containers.

* Fix up handling for older versions of CMake.

* Use CMake C compiler for libbpf builds.

* Fix selection of legacy eBPF code in static builds.

* Explicitly pull in kernel headers on CentOS.

* Fix typo in FORCE_LEGACY_LIBBPF option.

* Only enable eBPF by default on x86.

* Fix detection of static builds.

* Fix libc detection logic.

* Fix handling of static builds.

* Fix musl libc detection.

* Fix check messages for libc detection.
2024-05-06 07:05:34 -04:00
Ilya Mashchenko
e739a3cf0e
fix _ndpath in detect_existing_install() () 2024-04-26 10:45:10 +03:00
Austin S. Hemmelgarn
aa6d30384d
Move libbpf and eBPF CO-RE bundling into CMake. ()
* Move libbpf and eBPF CO-RE bundling into CMake.

* Silence CMP0135 warnings.

* Fix handling of legacy eBPF code.

* Only enable eBPF by default on Linux.

* Correctly auto-detect the need for legacy libbpf.

* Fix include paths for libbpf linking.

* Add coreutils dependency on Alpine.

* Fix ebpf code handling.

* Fix lib path handling for libbpf.a.

* Correctly fix libbpf lib directory handling.

* Use correct comparison type.
2024-04-24 09:17:23 +03:00
Fotis Voutsas
ea4bf6d407
move netdata charts documentation to proper folder ()
* fix

* links
2024-04-23 07:43:09 +00:00
Austin S. Hemmelgarn
39ea36980f
Fix maintainer documentation to reflect the new build system. () 2024-04-23 10:32:43 +03:00
Austin S. Hemmelgarn
42595b3f26
Add fallback logic in installer for fetching files. ()
Still try to use `curl` first if it exists, but if it fails, fall back
to attempting with wget instead.
2024-04-16 07:32:14 -04:00
Austin S. Hemmelgarn
5ab0754713
Fix typo in kickstart script. 2024-04-10 14:51:12 -04:00
Austin S. Hemmelgarn
532671b243
Canonicalize paths before comparison when checking for multiple installs. ()
For some arcane reason, many distros that have chose a merged `/usr`
layout (https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/)
insist on still putting both `/bin` and `/usr/bin` (and `/sbin` and
`/usr/sbin`) in their default `$PATH`, despite the fact that this
provides no real benefit (it’s questionable even for ‘backwards
compatibility’, anything that truly _needs_ this on a system with a
merged `/usr` layout is fundamentally broken).

To correctly handle the fact that it’s not only possible but actually
extremely likely that Netdata will show up in more than one place in
`$PATH` even if it’s a single install, we need to canonicalize the paths
before comparing them when checking for multiple installs.

Unfortunately, despite path canonicalization being an extremely common
need, there is no POSIX utility for doing it with arbitrary paths,
so we have to resort to some trickery to achieve this portably. The
exact implementation used by this change is somewhat naive and only
works if the directory the target path indicates actually exists, but we
can count on this being the case in this particular usage because we
know that we found a file within that directory.
2024-04-10 14:03:28 -04:00
Austin S. Hemmelgarn
2293a52b7e
Fix logic in detection of multiple installs. ()
- Only flag multiple installs if subsequent searches produce a different
  install path.
- Only set the detected install path if a search actually finds an
  install path.
- Bail early if the initial search finds nothing.
2024-04-10 13:08:10 -04:00
Austin S. Hemmelgarn
7b0a46b71c
kickstart: Add detection of multiple concurrent installs. ()
* Add detection of multiple concurrent installs.

And refuse to operate on such setups in most cases.

* Fix exit cases for existing install detection loop.
2024-04-10 09:59:04 -04:00
Ilya Mashchenko
c41702d9da
uninstaller: remove LaunchDaemons plist file (macOS) () 2024-04-10 09:30:17 +03:00
Ilya Mashchenko
94b6973d6e
fix invalid var in prepare_offline_install_source() () 2024-04-08 18:31:14 +03:00
Fotis Voutsas
128f112c73
remove old overview infrastructure and add home tab doc ()
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Co-authored-by: Hugo Valente <82235632+hugovalente-pm@users.noreply.github.com>
2024-04-05 15:04:44 +03:00