From a93228fdb46b202f387ae2ed853a3bbbf0c7c9a4 Mon Sep 17 00:00:00 2001 From: Guillaume COEUGNET Date: Fri, 1 Apr 2016 10:04:34 +0200 Subject: [PATCH 1/7] Add canopsis transport doc --- doc/Extensions/Alerting.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/Extensions/Alerting.md b/doc/Extensions/Alerting.md index 15a38291f..1183a5a37 100644 --- a/doc/Extensions/Alerting.md +++ b/doc/Extensions/Alerting.md @@ -21,6 +21,7 @@ Table of Content: - [Clickatell](#transports-clickatell) - [PlaySMS](#transports-playsms) - [VictorOps](#transports-victorops) + - [Canopsis](#transports-canopsis) - [Entities](#entities) - [Devices](#entity-devices) - [BGP Peers](#entity-bgppeers) @@ -440,6 +441,28 @@ $config['alert']['transports']['victorops']['url'] = 'https://alert.victorops.co ``` ~~ +## Canopsis + +Canopsis is a hypervision tool. LibreNMS can send alerts to Canopsis which are then converted to canopsis events. To configure the transport, go to: + +Global Settings -> Alerting Settings -> Canopsis Transport. + +You will need to fill this paramaters : + +~~ +```php +$config['alert']['transports']['canopsis']['host'] = 'www.xxx.yyy.zzz'; +$config['alert']['transports']['canopsis']['port'] = '5672'; +$config['alert']['transports']['canopsis']['user'] = 'admin'; +$config['alert']['transports']['canopsis']['passwd'] = 'my_password'; +$config['alert']['transports']['canopsis']['vhost'] = 'canopsis'; +``` +~~ + +For more information about canopsis and its events, take a look here : + http://www.canopsis.org/ + http://www.canopsis.org/wp-content/themes/canopsis/doc/sakura/user-guide/event-spec.html + # Entities Entities as described earlier are based on the table and column names within the database, if you are unsure of what the entity is you want then have a browse around inside MySQL using `show tables` and `desc `. From ac89c7b00c4c6f6c915163b465e31d13513fb1b0 Mon Sep 17 00:00:00 2001 From: Guillaume COEUGNET Date: Fri, 1 Apr 2016 10:04:58 +0200 Subject: [PATCH 2/7] Add canopsis port parameter --- html/pages/settings/alerting.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/html/pages/settings/alerting.inc.php b/html/pages/settings/alerting.inc.php index 5e9a7fede..d61b0e303 100644 --- a/html/pages/settings/alerting.inc.php +++ b/html/pages/settings/alerting.inc.php @@ -840,6 +840,7 @@ echo ' '; $canopsis_host = get_config_by_name('alert.transports.canopsis.host'); +$canopsis_port = get_config_by_name('alert.transports.canopsis.port'); $canopsis_user = get_config_by_name('alert.transports.canopsis.user'); $canopsis_passwd = get_config_by_name('alert.transports.canopsis.passwd'); $canopsis_vhost = get_config_by_name('alert.transports.canopsis.vhost'); @@ -859,6 +860,13 @@ echo ' +
+ +
+ + +
+
From 38558483189e39fbba897036467f85206349e22e Mon Sep 17 00:00:00 2001 From: Guillaume COEUGNET Date: Fri, 1 Apr 2016 10:05:17 +0200 Subject: [PATCH 3/7] Add canopsis port parameter --- sql-schema/110.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/sql-schema/110.sql b/sql-schema/110.sql index e72bcb1cf..17c86f63e 100644 --- a/sql-schema/110.sql +++ b/sql-schema/110.sql @@ -1,4 +1,5 @@ INSERT INTO config VALUES ('','alert.transports.canopsis.user','','','Canopsis User','alerting',0, 'transports', 0, 0, 0); INSERT INTO config VALUES ('','alert.transports.canopsis.passwd','','','Canopsis Password','alerting',0, 'transports', 0, 0, 0); INSERT INTO config VALUES ('','alert.transports.canopsis.host','','','Canopsis Hostname','alerting',0, 'transports', 0, 0, 0); +INSERT INTO config VALUES ('','alert.transports.canopsis.port','','','Canopsis Port number','alerting',0, 'transports', 0, 0, 0); INSERT INTO config VALUES ('','alert.transports.canopsis.vhost','','','Canopsis vHost','alerting',0, 'transports', 0, 0, 0); From 32ac7a59d3519a964b65585dff34b2aa60d2f6f9 Mon Sep 17 00:00:00 2001 From: Guillaume COEUGNET Date: Fri, 1 Apr 2016 10:05:52 +0200 Subject: [PATCH 4/7] Add port parameter and code enhancement --- includes/alerts/transport.canopsis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/alerts/transport.canopsis.php b/includes/alerts/transport.canopsis.php index def4b095d..9c00d667a 100644 --- a/includes/alerts/transport.canopsis.php +++ b/includes/alerts/transport.canopsis.php @@ -1,8 +1,8 @@ -require_once "./lib/PhpAmqpLib/autoload.php"; +require_once $config['install_dir']."/lib/PhpAmqpLib/autoload.php"; // Configurations $host = $opts["host"]; -$port = 5672; +$port = $opts["port"]; $user = $opts["user"]; $pass = $opts["passwd"]; $vhost = $opts["vhost"]; From c6a022694b4f617d210ff9c78691e171a1f630db Mon Sep 17 00:00:00 2001 From: Guillaume Coeugnet Date: Fri, 1 Apr 2016 10:21:11 +0200 Subject: [PATCH 5/7] Update alerting.inc.php Code indentation --- html/pages/settings/alerting.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/pages/settings/alerting.inc.php b/html/pages/settings/alerting.inc.php index d61b0e303..2a6d6cd80 100644 --- a/html/pages/settings/alerting.inc.php +++ b/html/pages/settings/alerting.inc.php @@ -840,7 +840,7 @@ echo '
'; $canopsis_host = get_config_by_name('alert.transports.canopsis.host'); -$canopsis_port = get_config_by_name('alert.transports.canopsis.port'); +$canopsis_port = get_config_by_name('alert.transports.canopsis.port'); $canopsis_user = get_config_by_name('alert.transports.canopsis.user'); $canopsis_passwd = get_config_by_name('alert.transports.canopsis.passwd'); $canopsis_vhost = get_config_by_name('alert.transports.canopsis.vhost'); From 7a2faae2370c2faecab941d171bd07404ac18e6a Mon Sep 17 00:00:00 2001 From: Guillaume Coeugnet Date: Fri, 1 Apr 2016 14:20:17 +0200 Subject: [PATCH 6/7] Update 110.sql Remove port parameter to put it a new file --- sql-schema/110.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/sql-schema/110.sql b/sql-schema/110.sql index 17c86f63e..e72bcb1cf 100644 --- a/sql-schema/110.sql +++ b/sql-schema/110.sql @@ -1,5 +1,4 @@ INSERT INTO config VALUES ('','alert.transports.canopsis.user','','','Canopsis User','alerting',0, 'transports', 0, 0, 0); INSERT INTO config VALUES ('','alert.transports.canopsis.passwd','','','Canopsis Password','alerting',0, 'transports', 0, 0, 0); INSERT INTO config VALUES ('','alert.transports.canopsis.host','','','Canopsis Hostname','alerting',0, 'transports', 0, 0, 0); -INSERT INTO config VALUES ('','alert.transports.canopsis.port','','','Canopsis Port number','alerting',0, 'transports', 0, 0, 0); INSERT INTO config VALUES ('','alert.transports.canopsis.vhost','','','Canopsis vHost','alerting',0, 'transports', 0, 0, 0); From 713501e27038b0596d32acba7b06971ba8c601d0 Mon Sep 17 00:00:00 2001 From: Guillaume Coeugnet Date: Fri, 1 Apr 2016 14:20:47 +0200 Subject: [PATCH 7/7] Create 111.sql Add new port parameter for Canopsis transport. --- sql-schema/111.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql-schema/111.sql diff --git a/sql-schema/111.sql b/sql-schema/111.sql new file mode 100644 index 000000000..a465227f8 --- /dev/null +++ b/sql-schema/111.sql @@ -0,0 +1 @@ +INSERT INTO config VALUES ('','alert.transports.canopsis.port','','','Canopsis Port number','alerting',0, 'transports', 0, 0, 0);