From 66a500cd28d69a59ff7a1a5c0c3140ba3b568583 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 26 Jul 2016 21:27:12 -0500 Subject: [PATCH] Rename Agent Setup to Applications This is to make the document easier to find. No one sets out with a goal to set up an agent (unless they are told to). They want to monitor an application. Coming to this doc will give them a list of applications they can monitor and ways they can collect the data from the application. (Direct, SNMP Extend, or Agent) There needs to be a lot of expansion here, but this is a start. I'd like to see most applications support 2-3 ways of collecting data. --- doc/Extensions/Agent-Setup.md | 147 ---------------------------- doc/Extensions/Applications.md | 173 +++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 147 deletions(-) delete mode 100644 doc/Extensions/Agent-Setup.md create mode 100644 doc/Extensions/Applications.md diff --git a/doc/Extensions/Agent-Setup.md b/doc/Extensions/Agent-Setup.md deleted file mode 100644 index 17678a311d..0000000000 --- a/doc/Extensions/Agent-Setup.md +++ /dev/null @@ -1,147 +0,0 @@ -Agent setup ------------ - -To gather data from remote systems you can use LibreNMS in combination with check_mk (included in the scripts directory). - -Make sure that xinetd is installed on the host you want to run the agent on. - -The agent uses TCP-Port 6556, please allow access from the LibreNMS-Host and Poller-Nodes if you're using the Distributed Polling setup. - -On each of the hosts you would like to use the agent on then you need to do the following: - -* Clone the `librenms-agent` repository: - -```shell -cd /opt/ -git clone https://github.com/librenms/librenms-agent.git -cd librenms-agent -``` - -Now copy the relevant check_mk_agent: - -| linux | freebsd | -| --- | --- | -| `cp check_mk_agent /usr/bin/check_mk_agent` | `cp check_mk_agent_freebsd /usr/bin/check_mk_agent` | - -```shell -chmod +x /usr/bin/check_mk_agent -``` - -* Copy the service file(s) into place. - -| xinetd | systemd | -| --- | --- | -| `cp check_mk_xinetd /etc/xinetd.d/check_mk` | `cp check_mk@.service check_mk.socket /etc/systemd/system` | - -* Create the relevant directories. - -```shell -mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local -``` - -* Copy each of the scripts from `agent-local/` into `/usr/lib/check_mk_agent/local` that you require to be graphed. -* Make each one executable that you want to use with `chmod +x /usr/lib/check_mk_agent/local/$script` -* Enable service scripts - -| xinetd | systemd | -| --- | --- | -| `/etc/init.d/xinetd restart` | `systemctl enable --now check_mk.socket` | - - -* Login to the LibreNMS web interface and edit the device you want to monitor. Under the modules section, ensure that unix-agent is enabled. -* Then under Applications, enable the apps that you plan to monitor. -* Wait, in around 10 minutes you should start seeing data in your graphs under Apps for the device. - -## Application Specific Configuration - -### BIND9/named - -Create stats file with appropriate permissions: -```shell -~$ touch /etc/bind/named.stats -~$ chown bind:bind /etc/bind/named.stats -``` -Change `user:group` to the user and group that's running bind/named. - -Bind/named configuration: -```text -options { - ... - statistics-file "/etc/bind/named.stats"; - zone-statistics yes; - ... -}; -``` -Restart your bind9/named after changing the configuration. - -Verify that everything works by executing `rndc stats && cat /etc/bind/named.stats`. -In case you get a `Permission Denied` error, make sure you chown'ed correctly. - -Note: if you change the path you will need to change the path in `scripts/agent-local/bind`. - -### TinyDNS/djbdns - -__Installation__: - -1. Get tinystats sources from http://www.morettoni.net/tinystats.en.html -2. Compile like as advised. - _Note_: In case you get `Makefile:9: *** missing separator. Stop.`, compile manually using: - * With IPv6: `gcc -Wall -O2 -fstack-protector -DWITH_IPV6 -o tinystats tinystats.c` - * Without IPv6: `gcc -Wall -O2 -fstack-protector -o tinystats tinystats.c` -3. Install into preferred path, like `/usr/bin/`. - -__Configuration__: - -_Note_: In this part we assume that you use DJB's [Daemontools](http://cr.yp.to/daemontools.html) to start/stop tinydns. -And that your tinydns-instance is located in `/service/dns`, adjust this path if necessary. - -1. Replace your _log_'s `run` file, typically located in `/service/dns/log/run` with: - ``` - #!/bin/sh - - exec setuidgid dnslog tinystats ./main/tinystats/ multilog t n3 s250000 ./main/ - ``` -2. Create tinystats directory and chown: - `mkdir /service/dns/log/main/tinystats && chown dnslog:nofiles /service/dns/log/main/tinystats` -3. Restart TinyDNS and Daemontools: `/etc/init.d/svscan restart` - _Note_: Some say `svc -t /service/dns` is enough, on my install (Gentoo) it doesn't rehook the logging and I'm forced to restart it entirely. - -### MySQL - -Unlike most other scripts, the MySQL script requires a configuration file `/usr/lib/check_mk_agent/local/mysql.cnf` with following content: - -```php -