diff --git a/LibreNMS/Alert/Transport/Ciscospark.php b/LibreNMS/Alert/Transport/Ciscospark.php index c1c582de3b..e106bcccbe 100644 --- a/LibreNMS/Alert/Transport/Ciscospark.php +++ b/LibreNMS/Alert/Transport/Ciscospark.php @@ -31,10 +31,15 @@ class Ciscospark extends Transport { $text = strip_tags($obj['msg']); $data = array ( - 'roomId' => $room_id, - 'text' => $text + 'roomId' => $room_id ); + $akey = 'text'; + if ($this->config['use-markdown'] === 'on') { + $akey = 'markdown'; + } + $data[$akey] = $text; + $curl = curl_init(); set_curl_proxy($curl); curl_setopt($curl, CURLOPT_URL, 'https://api.ciscospark.com/v1/messages'); @@ -70,6 +75,13 @@ class Ciscospark extends Transport 'name' => 'room-id', 'descr' => 'CiscoSpark Room ID', 'type' => 'text', + ], + [ + 'title' => 'Use Markdown?', + 'name' => 'use-markdown', + 'descr' => 'Use Markdown when sending the alert', + 'type' => 'checkbox', + 'default' => false, ] ], 'validation' => [ diff --git a/doc/Alerting/Transports.md b/doc/Alerting/Transports.md index 9fd5692518..5fbc9adc32 100644 --- a/doc/Alerting/Transports.md +++ b/doc/Alerting/Transports.md @@ -117,10 +117,13 @@ which are then converted to canopsis events. | Password | my_password | | Vhost | canopsis | -## Cisco Spark +## Cisco Spark (aka Webex Teams) -Cisco Spark. LibreNMS can send alerts to a Cisco Spark room. To make -this possible you need to have a RoomID and a token. +Cisco Spark (now known as Webex Teams). LibreNMS can send alerts to a Cisco +Spark room. To make this possible you need to have a RoomID and a token. +You can also choose to send alerts using Markdown syntax. Enabling this +option provides for more richly formatted alerts, but be sure to adjust your +alert template to account for the Markdown syntax. For more information about Cisco Spark RoomID and token, take a look here : @@ -133,6 +136,7 @@ For more information about Cisco Spark RoomID and token, take a look here : | ------ | ------- | | API Token | ASd23r23edewda | | RoomID | 34243243251 | +| Use Markdown? | x | ## Clickatell