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 `. diff --git a/html/pages/settings/alerting.inc.php b/html/pages/settings/alerting.inc.php index 5e9a7fede..2a6d6cd80 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 ' +
+ +
+ + +
+
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"]; 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);