Skip to content
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

Add mapping from Zabbix severities to OpsGenie priorities #45

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions zabbix/common/opsgenie-integration.conf.part
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ logPath=/var/log/opsgenie/zabbix2opsgenie.log
#responders=<comma_separated_list_of_responders>
#tags=<comma_separated_list_of_tags>

############################ Mapping Zabbix Severity to OpsGenie Priority ###########################
zabbix2opsgenie.severity.information=P5
zabbix2opsgenie.severity.warning=P4
zabbix2opsgenie.severity.average=P3
zabbix2opsgenie.severity.high=P2
zabbix2opsgenie.severity.disaster=P1

####################################### PROXY CONFIGURATION FOR ZABBIX ############################################
zabbix2opsgenie.http.proxy.enabled=false
zabbix2opsgenie.http.proxy.port=11111
Expand Down
8 changes: 7 additions & 1 deletion zabbix/zabbix/zabbix2opsgenie.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ var configParameters = map[string]string{"apiKey": API_KEY,
"zabbix2opsgenie.http.proxy.host": "localhost",
"zabbix2opsgenie.http.proxy.protocol":"http",
"zabbix2opsgenie.http.proxy.username": "",
"zabbix2opsgenie.http.proxy.password": ""}
"zabbix2opsgenie.http.proxy.password": "",
"zabbix2opsgenie.severity.information": "P5",
"zabbix2opsgenie.severity.warning": "P4",
"zabbix2opsgenie.severity.average": "P3",
"zabbix2opsgenie.severity.high": "P2",
"zabbix2opsgenie.severity.disaster": "P1"}
var configPath = "/etc/opsgenie/conf/opsgenie-integration.conf"
var levels = map [string]log.Level{"info":log.Info,"debug":log.Debug,"warning":log.Warning,"error":log.Error}
var logger log.Logger
Expand Down Expand Up @@ -283,6 +288,7 @@ func parseFlags()map[string]string{
parameters["itemValue"] = *itemValue
parameters["eventId"] = *eventId
parameters["recoveryEventStatus"] = *recoveryEventStatus
parameters["mappedPriority"] = configParameters["zabbix2opsgenie.severity."+strings.ToLower(*triggerSeverity)]

if *apiKey != ""{
configParameters["apiKey"] = *apiKey
Expand Down