Integrate JIRA with Nagios
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
Also enabled the command name "jira" in global event handler
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Integrate JIRA with Nagios
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
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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.
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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Integrate JIRA with Nagios
Can you share the global event handler you are using for the integration?
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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$"
}
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$"
}
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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
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
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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
[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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Integrate JIRA with Nagios
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
This will make sure they are not in downtime before executing the 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$"
}
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
Thanks much scottwilkerson . It is working fine now.
Regards,
Rituraj.
Regards,
Rituraj.
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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
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