1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00
Commit Graph

57 Commits

Author SHA1 Message Date
Deltawings
d3a8aaef51 Constants definition logic modification
Correction avoiding script exit when configuration file doesn't exist because MySQL connection constants can also be set at the beginning of this script.
2021-11-10 22:25:51 +01:00
Jellyfrog
25fb357809 Lint more files (#356) 2021-03-18 20:07:25 +01:00
Jellyfrog
61064dc9fe Cleanup some code (#355)
* Format with isort

* Format with Black

* Fix CRLF

* Format with shellcheck

* Fix some warning

* Fix PHP style

* Dont modifiy check_mk files

* Fixes
2021-03-18 12:24:30 +01:00
Mike Dixson
4c30656394 Update check_mpre (#336)
--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.
2021-01-02 03:07:23 +01:00
Slashdoom
aecfa970e7 Update check_mrpe (#321)
Include exit code when proper -a flag is specified.
2020-07-18 01:59:17 +02:00
Mark Westerterp
a8cb5b0112 Make this script Python 3 compatible (#311) 2020-06-30 23:56:49 +02:00
Slashdoom
2cf11d0484 add check_mrpe script (#192)
* add check_mrpe script

* recommit

Co-authored-by: slashdoom <slashdoom>
2020-06-16 23:26:08 +02:00
Chris (Someguy123)
c91ba4d29d Remove absolute exe for powerdns + use python3
- `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.
2020-05-22 07:48:00 +01:00
Karl Shea
e6892ea76d Update gpsd
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.
2020-05-15 01:15:20 -05:00
PipoCanaja
f4ff8bde94 Merge pull request #244 from tuxis-ie/fix-ceph-newer-versions
Detect current Ceph version and change statistics commands based on t…
2020-01-19 11:04:35 +01:00
Zane C. Bowers-Hadley
d609e23600 /tmp fix (#250)
* 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
2019-08-08 21:18:06 -05:00
Mark Schouten
0b4e95a096 Detect current Ceph version and change statistics commands based on those versions. Fixes #186 2019-07-03 11:10:29 +02:00
Shao Yu Lung
6e644272b4 add nginx agent use python3 2019-06-10 12:28:13 +08:00
Shao Yu-Lung (Allen)
8114d88f91 remove duplicate code 2019-03-16 14:33:31 +08:00
arrmo
3b9d632a8d hddtemp, ignore devices not supporting SMART (#153) 2017-12-04 20:11:17 +00:00
dragans
2996ad88b0 fix: Update mysql (#127)
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.
2017-10-27 07:39:09 +02:00
tomarch
6a40ca1e9c fix munin agent (#148)
Without the full munin-scripts path, this script won't find munin file and return nothing.
2017-09-20 20:47:11 +01:00
einarjh
cc6d7882db Strip all non-ASCII characters from hddtemp output (#136) 2017-06-10 10:20:48 +01:00
BlackDex
f473c5e30c Added try-except checks for global values. (#107)
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.
2017-05-23 07:44:05 -05:00
Svennd
705cc0f3fe add support for SGE/rocks job tracker (#118) 2017-04-18 21:34:05 +01:00
Chris Putnam
d7085e001c hddtemp: parallelize calls to hddtemp for performance (#117)
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.
2017-04-18 21:32:41 +01:00
Chris Putnam
5f47aad492 hddtemp: improve detection of drives (#115)
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.
2017-04-07 07:45:56 +01:00
Philip Rosenberg-Watt
67bae5a86c fix: Update proxmox agent to use new Perl module (#88)
PVE::API2Client is deprecated in Proxmox 4.4-6. Agent now requires
installation of libpve-apiclient-perl via apt.

This commit fixes #81.
2017-04-06 09:24:36 +00:00
Robert Verspuy
ff6ee0e2bc Fixed correct amount of pipeline symbols when degrees symbol is missing. (#85)
When the script is called through xinetd/check_mk (on my system), there is no degree symbol, but a space.
Changed the script to handle both correctly
2017-02-17 00:46:13 +00:00
Tony Murray
3d061d2407 Support python2.6 for powerdns scripts
fixes #67
2016-12-14 16:27:15 -06:00
Karl Shea
36ed3f008c Agent: script to collect data from GPSD (#69) 2016-10-08 21:26:07 +01:00
Tuxis Internet Engineering V.O.F
91c251fd94 fix: a dirty hack to prevent failing of stats when the cluster is rebuilding (#68)
because Ceph returns '-inf' which the json decompiler doesn't seem to get..
2016-10-05 09:06:48 +00:00
vectr0n
6128dc3c71 Update hddtemp to include hddtemp -w option (#56)
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.
2016-09-09 07:16:28 +01:00
Tatermen
351e5aa7bc Freeswitch (#53)
feature: Added freeswitch support
2016-08-28 20:06:04 +01:00
Alan Gregory
9cd81f1b93 Added unbound stats script 2016-08-17 09:36:39 -03:00
xavier.beaudouin
760f9de567 /bin/bash => /usr/bin/env bash to allow freebsd agent work without patching each files 2016-07-29 13:23:20 +02:00
Neil Lathwood
dde18e9895 Merge pull request #36 from murrant/powerdns-recursor
PowerDNS Recursor agent
2016-07-26 20:46:20 +01:00
Neil Lathwood
18f4006e09 Merge pull request #33 from murrant/mysql-php7
Use mysqli instead of mysql
2016-07-26 20:45:38 +01:00
Tony Murray
9a3846cac3 PowerDNS Recursor agent 2016-07-22 15:33:16 -05:00
Tony Murray
c70d12c83c Remove duplicate nfsstats file 2016-07-22 15:22:48 -05:00
Tony Murray
bfdf71d699 Merge pull request #34 from murrant/nfs
Copy nfsstats script from main repo.
2016-07-21 22:30:29 -05:00
Tony Murray
9501c2f4ff Copy nfsstats script from main repo.
Send PR to remove scripts from the main repo.
2016-07-21 22:28:41 -05:00
Tony Murray
fc07e27c37 Fix permissions 2016-07-21 22:26:02 -05:00
Tony Murray
e80b025818 Use mysqli instead of mysql 2016-07-21 21:31:25 -05:00
Mark Schouten
9bad4dfb3e Something like this @einarjh ? 2016-07-13 15:06:57 +02:00
Mark Schouten
6d27c7edb3 Wrap these calls in an eval to prevent it from dying if its a container instead of a qemu vm. Fixes #28 2016-07-11 17:06:14 +02:00
Neil Lathwood
5b21301ecd Added nfsstats.sh file 2016-07-09 19:12:13 +01:00
Neil Lathwood
d00ce4a15a Merge pull request #29 from murrant/powerdns-python3
Python3 fixes for powerdns agent.  Compatible with python2.
2016-06-30 08:57:07 +01:00
Tony Murray
ca5a5a12c0 Python3 fixes for powerdns agent. Compatible with python2. 2016-06-29 19:52:10 -05:00
Tony Murray
8328d71c09 Local script to collect stats from rrdcached
Being able to connect to local unix sockets is the primary advantage of this.
2016-06-08 20:37:04 -05:00
Robert Verspuy
8d856e2764 Improved hddtemp agent module
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.
2016-05-05 10:27:30 +02:00
Mark Schouten
d16462bb5a Add PowerDNS Authoritative Agent 2015-11-23 14:10:15 +01:00
Mike Rostermund
66d502837d Moved mysql tag a bit up and added a newline to error msg. 2015-11-11 14:21:49 +01:00
Mark Schouten
9b4c3b3400 Add support for Ceph 2015-11-10 10:58:24 +01:00
Mark Schouten
30b7651e01 Crap, forgot this line... 2015-11-04 14:40:19 +01:00