Integrate JIRA with Nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Post by rituraj966323 »

Also enabled the command name "jira" in global event handler
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Integrate JIRA with Nagios

Post by scottwilkerson »

The global event handler doesn't execute nagios commands, you need to use the macros defined as outlined in this article and create the whole command line
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Post by rituraj966323 »

Hi Team,

After successfully integrated nagios with Jira,
Today I face new challenge, kindly help me to resolve the below issue.

Issue description:-

I have set in my script if any "critical alert and state change to HARD state" it should generate a jira ticket.
and the ticket should not get generated if someone manually schedules downtime for the respective host.

But today there was flapping happening on some host and the host was on schedule downtime period but because of state change(flapping) , we got multiple duplicate tickets for the same host.

/usr/local/nagios/var/nagios.log

Service Event Handler[11-21-2018 12:15:50] GLOBAL SERVICE EVENT HANDLER: -ECGTCOPR55;Memory Usage;CRITICAL;HARD;5;jira
Service Critical[11-21-2018 12:15:50] SERVICE ALERT: ECGTCOPR55;Memory Usage;CRITICAL;HARD;5;connect to address 172.22.33.150 and port 12489: Connection refused

Host comment :-

11-21-2018 12:19:11 nagiosadmin This host has been scheduled for fixed downtime from 11-21-2018 11:54:08 to 11-21-2018 17:54:08. Notifications for the host will not be sent out during that time period. 2520 No Scheduled Downtime N/A

11-21-2018 12:19:11 (Nagios Process) Notifications for this service are being suppressed because it was detected as having been flapping between different states (84.9% change >= 20.0% threshold). When the service state stabilizes and the flapping stops, notifications will be re-enabled. 2512 No Flap Detection N/A Delete This Comment

Is there any possibilities to disable host/service so that even in state change(flapping) it should not create any ticket.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Integrate JIRA with Nagios

Post by scottwilkerson »

Can you share the global event handler you are using for the integration?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Post by rituraj966323 »

Please find the requested details below:-

in --> nagios.cfg
global_host_event_handler=jira
global_service_event_handler=jira

in --> command.cfg

define command{
command_name jira
command_line $USER1$/NagiosIssue2JSD.pl -s "$SERVICESTATE$" -t "$SERVICESTATETYPE$" -A "$SERVICEATTEMPT$" -H "$HOSTNAME$" -S "$SERVICEDESC$" -a "$SERVICEOUTPUT$" -d "$SHORTDATETIME$"
}
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Post by rituraj966323 »

Hi Team,

Also, Please confirm would event handler get disable during schedule downtime?

It is creating multiple automatic tickets during scheduled downtime as there was flapping during activity.

Regards,
rituraj
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Post by rituraj966323 »

Please find the logs details below:-

[11-26-2018 17:37:24] GLOBAL SERVICE EVENT HANDLER: PROBE-SRVR;mydesktop.it.com Status;CRITICAL;SOFT;1;jira
Service Critical[11-26-2018 17:37:24] SERVICE ALERT: PROBE-SRVR;mydesktop.it.com Status;CRITICAL;SOFT;1;connect to address mydesktop.it.com and port 80: Connection refused
Service entered a period of scheduled downtime[11-26-2018 17:34:54] SERVICE DOWNTIME ALERT: PROBE-SRVR;mydesktop.it.com Status;STARTED; Service has entered a period of scheduled downtime
External Command[11-26-2018 17:34:54] EXTERNAL COMMAND: SCHEDULE_SVC_DOWNTIME;PROBE-SRVR;mydesktop.it.com Status;1543233883;1543234243;1;0;7200;nagiosadmin;testing
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Integrate JIRA with Nagios

Post by scottwilkerson »

The best I can think of is to split your jira eventhandler into 2 commands and test for downtime before executing the other command

in --> nagios.cfg
global_host_event_handler=jira-host
global_service_event_handler=jira-service

in --> command.cfg

Code: Select all

define command{
command_name jira-host
command_line [ "$HOSTDOWNTIME$" == "0" ] && $USER1$/NagiosIssue2JSD.pl -s "$SERVICESTATE$" -t "$SERVICESTATETYPE$" -A "$SERVICEATTEMPT$" -H "$HOSTNAME$" -S "$SERVICEDESC$" -a "$SERVICEOUTPUT$" -d "$SHORTDATETIME$"
}

define command{
command_name jira-service
command_line [ "$SERVICEDOWNTIME$" == "0" ] && $USER1$/NagiosIssue2JSD.pl -s "$SERVICESTATE$" -t "$SERVICESTATETYPE$" -A "$SERVICEATTEMPT$" -H "$HOSTNAME$" -S "$SERVICEDESC$" -a "$SERVICEOUTPUT$" -d "$SHORTDATETIME$"
}
This will make sure they are not in downtime before executing the command
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Post by rituraj966323 »

Thanks much scottwilkerson . It is working fine now.

Regards,
Rituraj.
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Post by rituraj966323 »

Hi All,

i have pushed docker image for Nagios -jira Integration configuration.
Please pull the docker image by using - docker pull rajritu45/gre if required.

Regards,
Rituraj
Locked