Improve Services documentation (#12226)

* Update Services.md

I updated the services page for a few of the following reasons:

* Fix placement of certain info that was better placed elsewhere.
* Adjust the documentation to inculde how to install during setup step.
* Fixed a few lines for a better feel to the wording.

* Update Services.md

Dispatcher Service notice.

* Update Services.md

dispatcher -> dispatch
This commit is contained in:
CameronMunroe
2020-10-20 17:12:30 -07:00
committed by GitHub
parent 397a10e73f
commit 59accd7e42

View File

@@ -4,39 +4,42 @@ path: blob/master/doc/
# Setting up services # Setting up services
Services within LibreNMS provides the ability to use Nagios plugins to Services within LibreNMS provides the ability to leverage Nagios plugins to
perform additional monitoring outside of SNMP. perform additional monitoring outside of SNMP. Services can also be used
in conjuction with your SNMP monitoring for larger monitoring functionality.
**These services are tied into an existing device so you need at least **Services must be tied to a device to function properly. A good generic
one device to be able to add it to LibreNMS - localhost is a good option is to use `localhost`, but it is suggest to attach the check to
one. This is needed in order for alerting to work properly.** the device you are monitoring.**
## Pre installed plugins ## Nagios plugins source
Note: Plugins will only load if they are prefixed with "check_" and Plugins come from two main sources:
they have that prefix stripped out when displaying in the "Add Service"
* [monitoring-plugins](https://www.monitoring-plugins.org)
* [pkg-nagios-plugins-contrib](https://github.com/bzed/pkg-nagios-plugins-contrib)
Note: Plugins will only load if they are prefixed with `check_`.
The `check_` prefix is stripped out when displaying in the "Add Service"
GUI "Type" dropdown list. GUI "Type" dropdown list.
Plugins come from two main places
[pkg-nagios-plugins-contrib](https://github.com/bzed/pkg-nagios-plugins-contrib)
and [monitoring-plugins](https://www.monitoring-plugins.org). This is
where you can find the documentation for most, if not all of the plugins.
The plugins are bundled with the pre build VM images via the package
`monitoring-plugins` in Ubuntu and `nagios-plugins-all` in CentOS.
## Setup ## Setup
Service checks is now distributed aware. If you run a distributed Service checks are now distributable if you run a distributed
setup then you can now run `services-wrapper.py` in cron instead of setup. To leverage this, use the `dispatch` service. Alternatively,
`check-services.php` across all polling nodes. you could also replace `check-services.php` with `services-wrapper.py` in
cron instead to run across all polling nodes.
If you need to debug the output of services-wrapper.py then you can If you need to debug the output of services-wrapper.py then you can
add `-d` to the end of the command - it is NOT recommended to do this add `-d` to the end of the command - it is NOT recommended to do this
in cron. in cron.
Firstly, install Nagios plugins however you would like, this could be Firstly, install Nagios plugins.
via yum, apt-get or direct from source.
Debian / Ubuntu: `sudo apt install monitoring-plugins`
Centos: `yum install nagios-plugins-all`
Note: The plugins are bundled with the pre-build VM and Docker images.
Next, you need to enable the services within config.php with the following: Next, you need to enable the services within config.php with the following:
@@ -46,17 +49,29 @@ $config['show_services'] = 1;
This will enable a new service menu within your navbar. This will enable a new service menu within your navbar.
Debian/Ubuntu:
```php ```php
$config['nagios_plugins'] = "/usr/lib/nagios/plugins"; $config['nagios_plugins'] = "/usr/lib/nagios/plugins";
``` ```
Centos:
```php
$config['nagios_plugins'] = "/usr/lib64/nagios/plugins";
```
This will point LibreNMS at the location of the nagios plugins - This will point LibreNMS at the location of the nagios plugins -
please ensure that any plugins you use are set to executable. For example: please ensure that any plugins you use are set to executable. For example:
Debian/Ubuntu:
``` ```
chmod +x /usr/lib/nagios/plugins/* chmod +x /usr/lib/nagios/plugins/*
``` ```
Centos:
```
chmod +x /usr/lib64/nagios/plugins/*
```
Finally, you now need to add services-wrapper.py to the current cron Finally, you now need to add services-wrapper.py to the current cron
file (/etc/cron.d/librenms typically) like: file (/etc/cron.d/librenms typically) like:
@@ -113,7 +128,7 @@ go together. Example below:
## Alerting ## Alerting
Services uses the Nagios Alerting scheme where: Services uses the Nagios Alerting scheme where exit code:
``` ```
0 = Ok, 0 = Ok,