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 link to service in created JIRA issue #42

Closed
mrimann opened this issue Jan 15, 2020 · 5 comments
Closed

Add link to service in created JIRA issue #42

mrimann opened this issue Jan 15, 2020 · 5 comments
Milestone

Comments

@mrimann
Copy link

mrimann commented Jan 15, 2020

We configured the Icingaweb2 module for JIRA and it creates tasks for low-priority issues in JIRA. They end up in our Ops-Pool, basically a queue of tickets that $someone from our team will work.

These created issues look like the one in the screenshot below:
image

What we're missing is a link to the service's detail view in Icingaweb2, so the user working on those queued issues can just follow the link to see the current status of the service that triggered the notification / creation of the JIRA issue.

I've not found an easy solution for this in the docs - but maybe I'm missing something and it's just a question of adding some config?

@mrimann
Copy link
Author

mrimann commented Jan 15, 2020

Just an additional detail we just noticed: The screenshot from above is from an automatically created issue (Icinga2 Check > Alert > Notification which created JIRA issue - without any manual intervention).

But for cases where we created an issue from within the Icingaweb2 GUI, the resulting ticket looks like it contains the link back to the service we're missing in the automatically created issue:

image

@Obivatelj
Copy link

I confirm here the same behavior. Since our clients see in benefit in jumping from links back to Icinga2, i would be interested in further development.

System Description:
Icinga 2.11.2
Icinga Web 2 Version 2.7.3
PHP Version 7.2.24-0ubuntu0.18.04.2
Modules:
incubator 0.5.0
ipl 0.4.0
jira 1.0.1
reactbundle 0.7.0

Debuglog shows usual behavior, but there is this warning:

debuglog

``
[2020-01-21 11:33:51 +0100] warning/PluginNotificationTask: Notification command for checkable 'test dummy server' and notification 'test dummy server!Host Status Benachrichtigung Jira' (PID: 17907, arguments: '/usr/bin/icingacli' 'jira' 'send' 'problem' '--ack-author' 'Automation' '--description' 'Server is Down' '--host' 'test dummy server' '--issuetype' 'Incident' '--project' 'IN' '--state' 'DOWN' '--summary' 'test dummy server ist im Status DOWN') terminated with exit code 255, output:

[2020-01-21 11:33:51 +0100] notice/Process: PID 17907 ('/usr/bin/icingacli' 'jira' 'send' 'problem' '--ack-author' 'Automation' '--description' 'Server is Down' '--host' 'test dummy server' '--issuetype' 'Incident' '--project' 'IN' '--state' 'DOWN' '--summary' 'test dummy server ist im Status DOWN') terminated with exit code 255
[2020-01-21 11:33:51 +0100] warning/PluginNotificationTask: Notification command for checkable 'test dummy server' and notification 'test dummy server!Host Status Benachrichtigung Jira' (PID: 17907, arguments: '/usr/bin/icingacli' 'jira' 'send' 'problem' '--ack-author' 'Automation' '--description' 'Server is Down' '--host' 'test dummy server' '--issuetype' 'Incident' '--project' 'IN' '--state' 'DOWN' '--summary' 'test dummy server ist im Status DOWN') terminated with exit code 255, output:
Fatal error: Uncaught Error: Call to a member function getUsername() on null in /usr/share/php/Icinga/Application/Hook/AuditHook.php:32
Stack trace:
#0 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Command/Transport/ApiCommandTransport.php(206): Icinga\Application\Hook\AuditHook::logActivity('monitoring/comm...', 'Issued command ...', Array)
#1 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Command/Transport/ApiCommandTransport.php(255): Icinga\Module\Monitoring\Command\Transport\ApiCommandTransport->sendCommand(Object(Icinga\Module\Monitoring\Command\IcingaApiCommand))
#2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php(125): Icinga\Module\Monitoring\Command\Transport\ApiCommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand), NULL)
#3 /usr/share/icingaweb2/modules/jira/library/Jira/IcingaCommandPipe.php(31): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring in /usr/share/php/Icinga/Application/Hook/AuditHook.php on line 32
``

@theFeu theFeu added this to the v1.0.2 milestone May 10, 2021
@theFeu
Copy link
Contributor

theFeu commented May 12, 2021

@Obivatelj so your issue with the trace you posted should be fixed with Icinga Web 2.8 Icinga/icingaweb2#4065 :)

Concerning the topic of the issue: my plan would be to use the description template, that is added for all manually sent notifications to Jira, and just add that as a template for all others too.

So basically the link should be found in all descriptions, like in this very realistic example below:

Service: [http|http://localhost/icingaweb2/monitoring/service/show?host=dummy-0&service=http]
Host: [dummy-0|http://localhost/icingaweb2/monitoring/host/show?host=dummy-0]

HTTP CRITICAL - No data received from host

@kaurav1108
Copy link

We configured the Icingaweb2 module for JIRA and it creates tasks for low-priority issues in JIRA. They end up in our Ops-Pool, basically a queue of tickets that $someone from our team will work.

These created issues look like the one in the screenshot below:
image

What we're missing is a link to the service's detail view in Icingaweb2, so the user working on those queued issues can just follow the link to see the current status of the service that triggered the notification / creation of the JIRA issue.

I've not found an easy solution for this in the docs - but maybe I'm missing something and it's just a question of adding some config?

@mrimann : I need your help to configuration icinga2 with JIRA module. as I want if any issue occour into host or service JIRA ticket should create automatically.
Till Now below configuration i did,
downloaded module of JIRA.
configured config.ini and template.ini into JIRA module.
Restart ICINGA2
Then done the below configuration and restarted icinga2 serviee but still tickets are not creating automatically, can you please help the same if we miss something.

Below is host configuration file.

object Host "jira.com" {
import "generic-host"
vars.os = "linux"
address = "10.10.5.4"
check_command = "hostalive"
vars.agent = "ssh"
vars.mountpoint = "/app"
vars.user = "icinga"
vars.notification["mail"] = { groups = [ "icingaadmins" ] }
vars.notification["jira"] = { groups = [ "icingaadmins" ] }
}

Done configuration into notification.conf as below.

apply Notification "jira" to Host {
import "jira-host-notification"
user_groups = host.vars.notification.jira.groups
users = host.vars.notification.jira.users
assign where host.vars.notification.jira
}

apply Notification "jira" to Service {
import "jira-service-notification"
user_groups = host.vars.notification.jira.groups
users = host.vars.notification.jira.users
assign where host.vars.notification.jira
}

Done Configuration into template.conf as below

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$"
    }
    "--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$"

}

jira-service-notification

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$"
}

"diskchecksun"
"mail-service-notification"

check_command = "jira-host-notification"
check_command = "jira-service-notification"

@theFeu
Copy link
Contributor

theFeu commented Jul 16, 2021

Hey @kaurav1108

would you please take this kind of question to the community forum.
If you have opened a topic there, you can edit your comment here to a link to the forum if you wish - else please remove it.

If @mrimann wants to answer your question, they can do so on the forum.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants