diff --git a/pandora_server/util/chatops_integration/README.md b/pandora_server/util/chatops_integration/README.md new file mode 100644 index 0000000000..0d503357c7 --- /dev/null +++ b/pandora_server/util/chatops_integration/README.md @@ -0,0 +1,22 @@ +# Pandora FMS Mattermost Plugin +A plugin for [Pandora FMS](https://github.com/pandorafms/pandorafms) to enable notifications to ChatOps solutions. + +#Solutions covered +1. Slack +2. Mattermost + +# Usage +Assuming you are using Pandora FMS 6.0, the steps are: + +1. Create the [Alert command](http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#The_Alert_Command_.28Pandora_Versions_5_and_above_only.29) in Pandora FMS console following the instructions of your solution inside this folder + +2. Define the [Alert Action](http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#Alert_Actions_.28all_Pandora_FMS_versions_including_5.0.29) in Pandora FMS console following the instructions of your solution inside this folder + +3. Assign the action to an existing module under Alerts -> [List of alerts](http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#Assigning_Alerts_from_an_Alert.27s_Sub_Menu): +![assign template to module](help/images/3-assign-template-to-module.png?raw=true "Assign a template to a module") + +4. Optinionally, go to your agent and verify the alert has been created: +![Verify the alert creation](help/images/4-verify.png?raw=true "Verify the alert creation") + +When the alert triggers, the result would be something like this: +![Mattermost-real-example](help/images/5-mattermost-result.png?raw=true "Mattermost real example") diff --git a/pandora_server/util/chatops_integration/help/images/3-assign-template-to-module.png b/pandora_server/util/chatops_integration/help/images/3-assign-template-to-module.png new file mode 100644 index 0000000000..f8362d8f5a Binary files /dev/null and b/pandora_server/util/chatops_integration/help/images/3-assign-template-to-module.png differ diff --git a/pandora_server/util/chatops_integration/help/images/4-verify.png b/pandora_server/util/chatops_integration/help/images/4-verify.png new file mode 100644 index 0000000000..1ef31975b1 Binary files /dev/null and b/pandora_server/util/chatops_integration/help/images/4-verify.png differ diff --git a/pandora_server/util/chatops_integration/help/images/5-mattermost-result.png b/pandora_server/util/chatops_integration/help/images/5-mattermost-result.png new file mode 100644 index 0000000000..d69fa90235 Binary files /dev/null and b/pandora_server/util/chatops_integration/help/images/5-mattermost-result.png differ diff --git a/pandora_server/util/chatops_integration/mattermost/README.md b/pandora_server/util/chatops_integration/mattermost/README.md new file mode 100644 index 0000000000..0f3a383d93 --- /dev/null +++ b/pandora_server/util/chatops_integration/mattermost/README.md @@ -0,0 +1,20 @@ +# Pandora FMS Mattermost Plugin +A plugin for [Pandora FMS](https://github.com/pandorafms/pandorafms) to enable notifications to Mattermost Open Source Chat. + +# Usage +Assuming you are using Pandora FMS 6.0, the steps are: + +1. Create the [Alert command](http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#The_Alert_Command_.28Pandora_Versions_5_and_above_only.29) going to Alerts -> Commands and clicking on "Create". Then: +![create command](help/images/1-set-up-the-mattermost-command.png?raw=true "Set up Mattermost Command") + +2. Define the [Alert Action](http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#Alert_Actions_.28all_Pandora_FMS_versions_including_5.0.29) going to Alerts -> Actions and clicking on "Create". Then: +![create action](help/images/2-set-up-the-mattermost-action.png?raw=true "Set up Mattermost Action") + +3. Assign the action to an existing module under Alerts -> List of alerts: +![assign template to module](../help/images/3-assign-template-to-module.png?raw=true "Assign a template to a module") + +4. Optinionally, go to your agent and verify the alert has been created: +![Verify the alert creation](../help/images/4-verify.png?raw=true "Verify the alert creation") + +When the alert triggers, the result would be something like this: +![Mattermost-real-example](../help/images/5-mattermost-result.png?raw=true "Mattermost real example") diff --git a/pandora_server/util/chatops_integration/mattermost/pandora_to_mattermost.sh b/pandora_server/util/chatops_integration/mattermost/pandora_to_mattermost.sh new file mode 100755 index 0000000000..304689fe2a --- /dev/null +++ b/pandora_server/util/chatops_integration/mattermost/pandora_to_mattermost.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Integration script with Mattermost and Slack for sending messages from Pandora FMS +# (c) 2016 Axel Amigo + + +# SET HERE YOUR DATA +USERNAME=pandorafmsbot +ICON="http://cdn9.staztic.com/app/a/3528/3528476/pandora-fms-1-l-78x78.png" +URL="$2" + +# Do not touch from there: + +MSG="'payload={\"username\": \"$USERNAME\", \"text\": \"$1\", \"icon_url\": \"$ICON\"}'" +COMMAND="curl -k -X POST --data-urlencode $MSG $URL" + +eval $COMMAND diff --git a/pandora_server/util/chatops_integration/slack/README.md b/pandora_server/util/chatops_integration/slack/README.md new file mode 100644 index 0000000000..8f43c0592d --- /dev/null +++ b/pandora_server/util/chatops_integration/slack/README.md @@ -0,0 +1,20 @@ +# Pandora FMS Mattermost Plugin +A plugin for [Pandora FMS](https://github.com/pandorafms/pandorafms) to enable notifications to Mattermost Open Source Chat. + +# Usage +Assuming you are using Pandora FMS 6.0, the steps are: + +1. Create the [Alert command](http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#The_Alert_Command_.28Pandora_Versions_5_and_above_only.29) going to Alerts -> Commands and clicking on "Create". Then: +![create command](help/images/1-set-up-the-slack-command.png?raw=true "Set up Mattermost Command") + +2. Define the [Alert Action](http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#Alert_Actions_.28all_Pandora_FMS_versions_including_5.0.29) going to Alerts -> Actions and clicking on "Create". Then: +![create action](help/images/2-set-up-the-slack-action.png?raw=true "Set up Mattermost Action") + +3. Assign the action to an existing module under Alerts -> List of alerts: +![assign template to module](../help/images/3-assign-template-to-module.png?raw=true "Assign a template to a module") + +4. Optinionally, go to your agent and verify the alert has been created: +![Verify the alert creation](../help/images/4-verify.png?raw=true "Verify the alert creation") + +When the alert triggers, the result would be something like this: +![Mattermost-real-example](../help/images/5-mattermost-result.png?raw=true "Mattermost real example") diff --git a/pandora_server/util/chatops_integration/slack/pandora_to_slack.sh b/pandora_server/util/chatops_integration/slack/pandora_to_slack.sh new file mode 100755 index 0000000000..304689fe2a --- /dev/null +++ b/pandora_server/util/chatops_integration/slack/pandora_to_slack.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Integration script with Mattermost and Slack for sending messages from Pandora FMS +# (c) 2016 Axel Amigo + + +# SET HERE YOUR DATA +USERNAME=pandorafmsbot +ICON="http://cdn9.staztic.com/app/a/3528/3528476/pandora-fms-1-l-78x78.png" +URL="$2" + +# Do not touch from there: + +MSG="'payload={\"username\": \"$USERNAME\", \"text\": \"$1\", \"icon_url\": \"$ICON\"}'" +COMMAND="curl -k -X POST --data-urlencode $MSG $URL" + +eval $COMMAND