-
Notifications
You must be signed in to change notification settings - Fork 90
Zabbix Monitoring Server Integration. #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tonyborries
wants to merge
3
commits into
hipchat:master
Choose a base branch
from
tonyborries:zabbix-integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # hipchat-cli Zabbix Integration | ||
|
|
||
| This guide integrating hipchat-cli with a Zabbix Monitoring | ||
| Server to push trigger notifications to Hipchat. | ||
|
|
||
| ## Setup hipchat-cli and Config File | ||
|
|
||
|
|
||
| Setup your Hipchat API credentials in /etc/hipchat | ||
|
|
||
| ``` | ||
| HIPCHAT_TOKEN= | ||
| HIPCHAT_ROOM_ID= | ||
| HIPCHAT_FROM= | ||
| HIPCHAT_API=v2 | ||
| HIPCHAT_FORMAT=html | ||
| ``` | ||
| For added protection of the credentials, add a new user to own these files. | ||
|
|
||
| ``` | ||
| useradd -d /opt/hipchat-cli hipchat-cli | ||
| chown hipchat-cli:hipchat-cli /etc/hipchat | ||
| chmod 400 /etc/hipchat | ||
| ``` | ||
|
|
||
| Checkout hipchat-cli. Note that we are setting the SetUID / SetGID so that any | ||
| user can call this script and it will be able to read the credentials file, though | ||
| the original user will not. | ||
|
|
||
| ``` | ||
| git clone https://github.com/hipchat/hipchat-cli.git /opt/hipchat-cli | ||
| chown -R hipchat-cli:hipchat-cli /opt/hipchat-cli | ||
| chmod 6755 /opt/hipchat-cli/hipchat_room_message | ||
| ``` | ||
|
|
||
| ## Setup the Zabbix Actions | ||
|
|
||
|
|
||
| #### Create a new Action | ||
|
|
||
|  | ||
|
|
||
| #### Conditions | ||
|
|
||
| To enable recovery messages, delete the default Condition ```Trigger value = PROBLEM``` | ||
|
|
||
|  | ||
|
|
||
| #### Add a new Operation | ||
|
|
||
| * Operation Type: **Remote Command** | ||
| * Add a new Target | ||
| * Target: **Host** | ||
| * Select server (presumably the Zabbix server) running this script. | ||
| * **Add** | ||
|
|
||
|  | ||
|
|
||
| * Execute on: **Zabbix Server** | ||
| * Commands: ```echo "{TRIGGER.STATUS}: ({TRIGGER.SEVERITY}) {TRIGGER.NAME} " | /opt/hipchat-cli/hipchat_room_message -l "{TRIGGER.SEVERITY}" -s "{TRIGGER.STATUS}" -m html >> /dev/null 2>&1``` | ||
| * **Add** | ||
|
|
||
|  | ||
|
|
||
| Finally **Save** your new Action. | ||
|
|
||
| #### Break something to Trigger the Action | ||
|
|
||
|  | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these be $STATUS instead of $LEVEL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a running Zabbix instance to test against anymore to verify this, however I believe the PR is correct as it exists. The Zabbix Status is either "OK" or "PROBLEM", and if it is "PROBLEM" then Level is used to map the severity.