Skip to content

Commit

Permalink
Canopsis transport (#9795)
Browse files Browse the repository at this point in the history
* Change in the Canopsis transport to make it 3.9.0 compliant and link to
the new documentation

* Add missing php72 module on Centos

* Fixing documentation for AMQP based tranport outside of the main doc
  • Loading branch information
aylham authored and murrant committed Feb 11, 2019
1 parent 7e18a07 commit cf17016
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 5 additions & 6 deletions LibreNMS/Alert/Transport/Canopsis.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function contactCanopsis($obj, $opts)
$host = $opts["host"];
$port = $opts["port"];
$user = $opts["user"];
$pass = $opts["passwd"];
$pass = $opts["pass"];
$vhost = $opts["vhost"];
$exchange = "canopsis.events";

Expand All @@ -41,13 +41,13 @@ public function contactCanopsis($obj, $opts)
$state = 0;
break;
case "warning":
$state = 1;
$state = 2;
break;
case "critical":
$state = 2;
$state = 3;
break;
default:
$state = 3;
$state = 0;
}
$msg_body = array(
"timestamp" => time(),
Expand All @@ -56,9 +56,8 @@ public function contactCanopsis($obj, $opts)
"event_type" => "check",
"source_type" => "resource",
"component" => $obj['hostname'],
"resource" => $obj['faults'][1]['storage_descr'],
"resource" => $obj['name'],
"state" => $state,
"state_type" => 1,
"output" => $obj['msg'],
"display_name" => "librenms"
);
Expand Down
7 changes: 6 additions & 1 deletion doc/Alerting/Transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ To include users that have `Global-Read`, `Administrator` or `Normal-User` permi
## Using a Proxy?
[Proxy Configuration](../Support/Configuration.md#proxy-support)

## Using a AMQP based Transport?

You need to install an additional php module : `bcmath` (eg `php72w-bcmath` for
Centos 7)

## Alertmanager
Alertmanager is an alert handling software, initially developed for alert processing sent by Prometheus.

Expand Down Expand Up @@ -74,7 +79,7 @@ Copy your access token from the Boxcar app or from the Boxcar.io website and set
## Canopsis
Canopsis is a hypervision tool. LibreNMS can send alerts to Canopsis which are then converted to canopsis events.

[Canopsis Docs](http://www.canopsis.org/wp-content/themes/canopsis/doc/sakura/user-guide/event-spec.html)
[Canopsis Docs](https://doc.canopsis.net/guide-developpement/struct-event/)

**Example:**

Expand Down

0 comments on commit cf17016

Please sign in to comment.