Integrate JIRA with Nagios

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Integrate JIRA with Nagios

Postby rituraj966323 » Mon Jul 30, 2018 7:50 am

Hi Team

I have followed below docs but getting below error.

http://albertolarripa.com/2012/11/17/in ... with-jira/

[root@nagios-core /]# /usr/bin/php -q /usr/local/nagios/libexec/to-jira/NTJ/nagios_to_jira.php
PHP Fatal error: Script was called, but there were no Nagios environment variables present. Script was most likely not called from Nagios. Aborting. in /usr/local/nagios/libexec/to-jira/NTJ/nagios_to_jira.php on line 500
[root@nagios-core /]#

Request you to help me to resolve this error please.

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

Re: Integrate JIRA with Nagios

Postby mcapra » Mon Jul 30, 2018 8:11 am

You posted this in the Nagios Log Server forum, but this appears to be a Nagios Core related question.

Simply put:
rituraj966323 wrote:Script was most likely not called from Nagios.

I don't see anywhere in that documentation where it instructs you to run the script by hand from the CLI.

If this is not working when Nagios Core executes it, I would suggest leveraging the enable_environment_macros option in your main nagios.cfg. I don't see this step mentioned in the documentation, but I think it might be critical based on my brief reading of the script.
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3372
Joined: Thu May 05, 2016 3:54 pm

Re: Integrate JIRA with Nagios

Postby scottwilkerson » Mon Jul 30, 2018 3:46 pm

Also, I am moving this the the Core forum as it is not a Log Server Question
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 11144
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Integrate JIRA with Nagios

Postby rituraj966323 » Tue Jul 31, 2018 4:06 am

Hi Team,

I have enabled to enable_environment_macros- 1 as per below guidance but still getting same error.
viewtopic.php?f=6&t=42341
I have followed below command because it is defined in the command.cfg

define command {
command_name nagios-to-jira
command_line /usr/bin/php -q $USER1$/to-jira/NTJ/nagios_to_jira.php
}
[root@nagios-core etc]# /usr/bin/php -q /usr/local/nagios/libexec/to-jira/NTJ/nagios_to_jira.php
PHP Fatal error: Script was called, but there were no Nagios environment variables present. Script was most likely not called from Nagios. Aborting. in /usr/local/nagios/libexec/to-jira/NTJ/nagios_to_jira.php on line 500
[root@nagios-core etc]#

need your guidance to complete this.Thank you.

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

Re: Integrate JIRA with Nagios

Postby rituraj966323 » Tue Jul 31, 2018 5:17 am

Hi Team,

I have enabled to 1 but still same error

[root@nagios-core etc]# cat nagios.cfg | grep -i enable_environment_macros
enable_environment_macros=1
[root@nagios-core etc]#

I have followed below cli command as it is mention in command.cfg file

define command {
command_name nagios-to-jira
command_line /usr/bin/php -q $USER1$/to-jira/NTJ/nagios_to_jira.php
}

[root@nagios-core etc]# /usr/bin/php -q /usr/local/nagios/libexec/to-jira/NTJ/nagios_to_jira.php
PHP Fatal error: Script was called, but there were no Nagios environment variables present. Script was most likely not called from Nagios. Aborting. in /usr/local/nagios/libexec/to-jira/NTJ/nagios_to_jira.php on line 500
[root@nagios-core etc]#

Please provide ur suggestion to resolve this error
rituraj966323
 
Posts: 8
Joined: Tue Jul 17, 2018 9:40 am

Re: Integrate JIRA with Nagios

Postby scottwilkerson » Tue Jul 31, 2018 8:13 am

rituraj966323 wrote:I have enabled to 1 but still same error

[root@nagios-core etc]# cat nagios.cfg | grep -i enable_environment_macros
enable_environment_macros=1
[root@nagios-core etc]#

I have followed below cli command as it is mention in command.cfg file

define command {
command_name nagios-to-jira
command_line /usr/bin/php -q $USER1$/to-jira/NTJ/nagios_to_jira.php
}


This is good, but per the error message, it is expecting to be run from Nagios
Code: Select all
Script was most likely not called from Nagios. Aborting.


this script may not work just running from the command line
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 11144
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Integrate JIRA with Nagios

Postby rituraj966323 » Thu Aug 02, 2018 5:47 am

Hi Team,

It might be script may not work.
Please confirm if any alternatives so that we can generate Jira ticket from Nagios Automatically.

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

Re: Integrate JIRA with Nagios

Postby scottwilkerson » Thu Aug 02, 2018 7:45 am

We have documentation for a way to do it in Nagios XI but for Core, the only thing I found on the Nagios Exchange was this
https://exchange.nagios.org/directory/Addons/Event-Handlers/Nagios-2D2JiraServerDesk-2DIssue-2DCreator/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 11144
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Integrate JIRA with Nagios

Postby rituraj966323 » Tue Aug 07, 2018 10:19 am

Thank you Team,

I have followed the above docs and configured all the dependenices but getting below error.

[root@nagios-core ActivePerl-5.26.1.2601-x86_64-linux-glibc-2.15-404865]# /usr/local/nagios/libexec/NagiosIssue2JSD.pl -s "$SERVICESTATE$" -t "$SERVICESTATETYPE$" -A "$SERVICEATTEMPT$" -H "$HOSTNAME$" -S "$SERVICEDESC$" -a "$SERVICEOUTPUT$" -d "$SHORTDATETIME$"
Can't locate JIRA/REST.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/NagiosIssue2JSD.pl line 5.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/NagiosIssue2JSD.pl line 5.

Hence to install JIRA-REST I have followed below docs but no go.
https://www.activestate.com/activeperl/ ... 533633216#
[nagios@nagios-core ActivePerl-5.26.1.2601-x86_64-linux-glibc-2.15-404865]$ PATH=$PATH:/home/nagios/bin
[nagios@nagios-core ActivePerl-5.26.1.2601-x86_64-linux-glibc-2.15-404865]$ mkdir /home/nagios/bin
[nagios@nagios-core ActivePerl-5.26.1.2601-x86_64-linux-glibc-2.15-404865]$ ln -s /home/nagios/ActivePerl-5.26/bin/perl /home/nagios/bin/perl
[nagios@nagios-core ActivePerl-5.26.1.2601-x86_64-linux-glibc-2.15-404865]$ ln -s /home/nagios/ActivePerl-5.26/bin/ppm /home/nagios/bin/ppm
[nagios@nagios-core ActivePerl-5.26.1.2601-x86_64-linux-glibc-2.15-404865]$ perl -e 'print "Hello World!\n"'
Hello World!
[nagios@nagios-core ~]$ ppm install JIRA-REST
ppm install failed: Can't find any package that provides JIRA-REST
[nagios@nagios-core ~]$

Request you to help me to fix this issue.

Thanking in Anticipation

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

Re: Integrate JIRA with Nagios

Postby rituraj966323 » Tue Aug 07, 2018 10:32 am

Below docs I have followed to install JIRA-PERL but no go

https://code.activestate.com/ppm/JIRA-REST/

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

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 21 guests