From ddf800fb16a5ef1e7c30c02e690d028eae49f0a6 Mon Sep 17 00:00:00 2001 From: laf Date: Thu, 27 Aug 2015 20:29:16 +0000 Subject: [PATCH 1/3] Added docs for device groups and tried to make sure old alerting docs are clear --- doc/Extensions/Device-Groups.md | 30 ++++++++++++++++++++++++++++++ doc/Extensions/Email-Alerting.md | 10 +++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 doc/Extensions/Device-Groups.md diff --git a/doc/Extensions/Device-Groups.md b/doc/Extensions/Device-Groups.md new file mode 100644 index 0000000000..cc48cdaad7 --- /dev/null +++ b/doc/Extensions/Device-Groups.md @@ -0,0 +1,30 @@ +# Device Groups + +LibreNMS supports grouping your devices together in much the same way as you can configure alerts. This document will hopefully help you get started. + +### Pattern + +Patterns work in the same was as Entities within the alerting system, the format of the pattern is based on the MySQL structure your data is in such +as __tablename.columnname__. If you are ensure of what the entity is you want then have a browse around inside MySQL using `show tables` and `desc `. + +As a working example and a common question, let's assume you want to group devices by hostname. If you hostname format is dcX.[devicetype].example.com. You would use the pattern +devices.hostname. Select the condition which in this case would Like and then enter dc1.@.example.com. This would then match dc1.sw01.example.com, dc1.rtr01.example.com but not + dc2.sw01.example.com. + +#### Wildcards + +As used in the example above, wildcards are represented by the @ symbol. I.e @.example.com would match any hostnames under example.com. + +A list of common entities is maintained in our [Alerting docs](http://docs.librenms.org/Extensions/Alerting/#entities). + +### Conditions + +Please see our [Alerting docs](http://docs.librenms.org/Extensions/Alerting/#syntax) for explanations. + +### Connection + +If you only want to group based on one pattern then select And. If however you want to build a group based on multiple patterns then you can build a SQL like +query using And / Or. As an example, we want to base our group on the devices hostname AND it's type. Use the pattern as before, devices.hostname, select the condition which in this case would Like and then enter dc1.@.example.com then click And. Now enter devices.type in the pattern, select Equals and enter firewall. This would then match dc1.fw01.example.com but not dc1.sw01.example.com as that is a network type. + +You can now select this group from the Devices -> All Devices link in the navigation at the top. You can also use the group to map alert rules to by creating an alert mapping +Overview -> Alerts -> Rule Mapping. diff --git a/doc/Extensions/Email-Alerting.md b/doc/Extensions/Email-Alerting.md index 67b51a6ba0..0cb61dc9d2 100644 --- a/doc/Extensions/Email-Alerting.md +++ b/doc/Extensions/Email-Alerting.md @@ -2,11 +2,15 @@ #### Please see [The new alerting docs](http://docs.librenms.org/Extensions/Alerting/#transports-email) -Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it: +> None of these configuration options will work on builds older than the 1st of August 2015. + + +~~Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it:~~ + ```php // Mailer backend Settings -$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". +~~$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". $config['email_from'] = NULL; // Mail from. Default: "ProjectName" $config['email_user'] = $config['project_id']; $config['email_sendmail_path'] = '/usr/sbin/sendmail'; // The location of the sendmail program. @@ -23,5 +27,5 @@ $config['alerts']['email']['default'] = 'sendto@somewhere.com'; // Defau $config['alerts']['email']['default_only'] = FALSE; // Only use default recipient $config['alerts']['email']['enable'] = TRUE; // Enable email alerts $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. -$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down +$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down~~ ``` From 08368f92f2fdb22256de0d418c9ca59e154babca Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 28 Aug 2015 08:55:46 +0000 Subject: [PATCH 2/3] Moved strikeout to outside code block --- doc/Extensions/Email-Alerting.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Extensions/Email-Alerting.md b/doc/Extensions/Email-Alerting.md index 0cb61dc9d2..fc20362e95 100644 --- a/doc/Extensions/Email-Alerting.md +++ b/doc/Extensions/Email-Alerting.md @@ -8,9 +8,9 @@ ~~Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it:~~ -```php +~~```php // Mailer backend Settings -~~$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". +$config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". $config['email_from'] = NULL; // Mail from. Default: "ProjectName" $config['email_user'] = $config['project_id']; $config['email_sendmail_path'] = '/usr/sbin/sendmail'; // The location of the sendmail program. @@ -27,5 +27,5 @@ $config['alerts']['email']['default'] = 'sendto@somewhere.com'; // Defau $config['alerts']['email']['default_only'] = FALSE; // Only use default recipient $config['alerts']['email']['enable'] = TRUE; // Enable email alerts $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. -$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down~~ -``` +$config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down +```~~ From 950b58ba657f71149720e1051d7ca97efc1259f5 Mon Sep 17 00:00:00 2001 From: laf Date: Fri, 28 Aug 2015 09:02:36 +0000 Subject: [PATCH 3/3] Removed strikethrough --- doc/Extensions/Email-Alerting.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/Extensions/Email-Alerting.md b/doc/Extensions/Email-Alerting.md index fc20362e95..55a2f0a5f5 100644 --- a/doc/Extensions/Email-Alerting.md +++ b/doc/Extensions/Email-Alerting.md @@ -7,8 +7,7 @@ ~~Currently, the email alerts needs to be set up in the config. If you want to enable it, paste this in your config and change it:~~ - -~~```php +```php // Mailer backend Settings $config['email_backend'] = 'mail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". $config['email_from'] = NULL; // Mail from. Default: "ProjectName" @@ -28,4 +27,4 @@ $config['alerts']['email']['default_only'] = FALSE; // Only use default recipi $config['alerts']['email']['enable'] = TRUE; // Enable email alerts $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. $config['alerts']['port']['ifdown'] = FALSE; // Generate alerts for ports that go down -```~~ +```