add new hipchat transport for alerts

This commit is contained in:
Tyler Christiansen
2015-03-26 20:18:15 -07:00
parent 8512ef74ae
commit d6d2fa1920
2 changed files with 97 additions and 0 deletions
+42
View File
@@ -13,6 +13,7 @@ Table of Content:
- [Nagios-Compatible](#transports-nagios)
- [IRC](#transports-irc)
- [Slack](#transports-slack)
- [HipChat](#transports-hipchat)
- [Entities](#entities)
- [Devices](#entity-devices)
- [BGP Peers](#entity-bgppeers)
@@ -191,6 +192,47 @@ $config['alert']['transports']['slack'][] = array('url' => "https://hooks.slack.
```
## <a name="transports-hipchat">HipChat</a>
The HipChat transport requires the following:
__room_id__: HipChat Room ID
__url__: HipChat API URL+API Key
__from__: The name that will be displayed
The HipChat transport makes the following optional:
__color__: Any of HipChat's supported message colors
__message_format__: Any of HipChat's supported message formats
__notify__: 0 or 1
See the HipChat API Documentation for
[rooms/message](https://www.hipchat.com/docs/api/method/rooms/message)
for details on acceptable values.
> You may notice that the link points at the "deprecated" v1 API. This is
> because the v2 API is still in beta.
Below are two examples of sending messages to a HipChat room.
```php
$config['alert']['transports']['hipchat'][] = array("url" => "https://api.hipchat.com/v1/rooms/message?auth_token=9109jawregoaih",
"room_id" => "1234567",
"from" => "LibreNMS");
$config['alert']['transports']['hipchat'][] = array("url" => "https://api.hipchat.com/v1/rooms/message?auth_token=109jawregoaihj",
"room_id" => "7654321",
"from" => "LibreNMS",
"color" => "red",
"notify" => 1,
"message_format" => "text");
```
> Note: The default message format for HipChat messages is HTML. It is
> recommended that you specify the `text` message format to prevent unexpected
> results, such as HipChat attempting to interpret angled brackets (`<` and
> `>`).
# <a name="entities">Entities
Entities as described earlier are based on the table and column names within the database, if you are ensure of what the entity is you want then have a browse around inside MySQL using `show tables` and `desc <tablename>`.