Hi Team,
I am doing the icinga2 with JIRA integration to create the automated JIRA issue if any host or service having an issue.
below configuration i did after installation of module.
manually using icingacli as well as icinga GUI i am able to create the JIRA issue.
so when i am doing valication of icinga2 daemon -C i am getting an warning.
2021-07-16 20:00:46 +0200] warning/ApplyRule: Apply rule ‘jira-icingaadmin-host’ (in /etc/icinga2/conf.d/notifications.conf: 11:1-11:50) for type ‘Notification’ does not match anywhere!
[2021-07-16 20:00:46 +0200] warning/ApplyRule: Apply rule ‘jira-icingaadmin-service’ (in /etc/icinga2/conf.d/notifications.conf: 16:1-16:56) for type ‘Notification’ does not match anywhere!
so can you please help me how i can apply these service and host to my host or services example check_disk or ping
so that automtically JIRA issue will get created.
hosts.conf:
object Host “jira.com” {
import “generic-host”
address = “10.10.25.5”
check_command = “hostalive”
vars.agent = “ssh”
vars.mountpoint = “/app”
vars.user = “icinga”
vars.notification[“mail”] = { groups = [ “icingaadmins” ] }
services.conf
apply Service “jenkins-mountpoint[jira.com]” {
import “generic-service”
check_command = “mountxx”
vars.notification[“mail”] = { groups = [ “icingaadmins” ] }
assign where host.name == “jira.com”
}
notification.conf
apply Notification “jira-icingaadmin-host” to Host {
import “jira-host-notification”
assign where host.vars.notification.jira == true
}
apply Notification “jira-icingaadmin-service” to Service {
import “jira-service-notification”
assign where service.vars.notification.jira == true
}
template.conf
template Notification “jira-host-notification” {
command = “jira-host-notification”
states = [ Up, Down ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
vars += {
notification_logtosyslog = false
}
period = “24x7”
}
template Notification “jira-service-notification” {
command = “jira-service-notification”
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
vars += {
notification_logtosyslog = false
}
period = “24x7”
}
command.conf
object NotificationCommand “jira-host-notification” {
import “plugin-notification-command”
command = [ “/usr/bin/icingacli”, “jira”, “send”, “problem” ]
arguments += {
“–description” = {
description = “JIRA issue description”
required = true
value = “$jira_description$”
}
“–host” = “$host.name$”
“–issuetype” = {
description = “JIRA issue type (e.g. Incident)”
required = true
value = “$jira_issuetype$”
}
“–no-acknowledge” = {
description = “D not acknowledge Icinga problems once a JIRA issue got created”
value = “$jira_no_acknowledge$”
}
“–project” = {
description = “JIRA project name (e.g. ITSM)”
required = true
value = “$jira_project$”
}
“–state” = {
description = “Host state (e.g. DOWN)”
value = “$host.state$”
}
“–summary” = {
description = “JIRA issue summary”
required = true
value = “$jira_summary$”
}
“–template” = {
description = “Issue template name (templates.ini section). This allows to pass custom fields to JIRA”
value = “$jira_template$”
}
}
vars.jira_description = “$host.output$”
vars.jira_summary = “$host.name$ is $host.state$”
}
object NotificationCommand “jira-service-notification” {
import “plugin-notification-command”
command = [ “/usr/bin/icingacli”, “jira”, “send”, “problem” ]
arguments += {
“–description” = {
description = “JIRA issue description”
required = true
value = “$jira_description$”
}
“–host” = “$host.name$”
“–issuetype” = {
description = “JIRA issue type (e.g. Incident)”
required = true
value = “$jira_issuetype$”
}
“–no-acknowledge” = {
description = “D not acknowledge Icinga problems once a JIRA issue got created”
value = “$jira_no_acknowledge$”
}
“–project” = {
description = “JIRA project name (e.g. ITSM)”
required = true
value = “$jira_project$”
}
“–service” = “$service.name$”
“–state” = {
description = “Service state (e.g. CRITICAL)”
value = “$service.state$”
}
“–summary” = {
description = “JIRA issue summary”
required = true
value = “$jira_summary$”
}
“–template” = {
description = “Issue template name (templates.ini section). This allows to pass custom fields to JIRA”
value = “$jira_template$”
}
}
vars.jira_description = “$service.output$”
vars.jira_summary = “$service.name$ on $host.name$ is $service.state$”
}