--recv-only argument doesn't exist on some well used version of netcat. This method timesout after 1 second of idle time.
Only possible downside is that if it takes more than 1 second to initiate the connection it may timeout too.
- `agent-local/powerdns`
- Replaced the absolute path `/usr/bin/pdns_control` with `pdns_control`, since pdns_control can also be in `/usr/sbin` or `/usr/local/bin`.
Python can find the executable using PATH just fine.
- Changed `vars` to `kvars` to avoid conflicting with the reserved `vars` Python symbol
- Changed shebang to use `python3` instead of `python` - as Python 2 is EOL.
- `agent-local/powerdns-recursor`
- Changed shebang to use `/usr/bin/env` instead of a hardcoded path to Python
- Changed shebang to use `python3` instead of `python` - as Python 2 is EOL.
**NOTE:** As per https://pythonclock.org/ - Python 2 is end-of-life, and is no longer included by default on modern Linux distros,
along with macOS (OS X).
I would recommend adjusting all Python-based agents to use Python 3 by default, instead of Python 2.
4s max time limit was causing some timeouts, especially given the two 1s sleeps. Especially with a lot of sentences coming back from the GPS chip it was probably not enough to always catch the right variables.
* convert the snmp scripts using tmp files over to use mktemp
* reverse this... joy... not a temp file but cache file ;(
* moved cache file from under /tmp to /var/cache/librenms
* fix mysql tmp usage
Update mysql agent script based on updated changes in newest version of Percona Monitoring Plugins (Cacti template).
Changes enable correct parsing of status data for newer versions of MySQL/MariaDB database servers and should be backward compatible with older versions.
Fixed an error which prevented output.
It seems some ceph version probably use different values or something. This is a quick fix to have the script output the correct values.
This poll script runs hddtemp with a list of all drives as arguments and reads the output. hddtemp scans each drive's SMART status serially, which scales poorly with a large number of drives.
In lieu of a patch to the actual hddtemp project, optionally use GNU parallel when available to parallelize the call to hddtemp.
In testing a machine with 58 drives I went from a runtime of about 5 seconds per run to 0.5s, a performance improvement of 10x.
Previously, this script was only able to find 26 drives (sda-sdz) due to the use of globbing.
A better strategy for detecting drives would be to use lsblk on systems that support it, failing over to globbing.
This patch adds support both for lsblk and a more comprehensive glob solution with find that will at least catch 26^2 drives.
hddtemp gives inconsistent values in it's current state, after some debugging I was able to resolve the issue by passing -w to the hddtemp command, this will wake-up the drive if it is in a sleep state to gather information.
I had some issues with the netcat / daemon implementation of the module.
netcat was stallingor sometimes netcat did not return the full output of hddtemp.
Running hddtemp directly without running it as a daemon is much more stable for me.
This new version also does not give any stdout output when hddtemp is not installed or when no disks can be found.
Running the script manually on a server does give stderr output for easy debugging.