Integrate JIRA with Nagios
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Integrate JIRA with Nagios
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
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
Re: Integrate JIRA with Nagios
You posted this in the Nagios Log Server forum, but this appears to be a Nagios Core related question.
Simply put:
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.
Simply put:
I don't see anywhere in that documentation where it instructs you to run the script by hand from the CLI.rituraj966323 wrote:Script was most likely not called from Nagios.
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
https://www.mcapra.com/
https://www.mcapra.com/
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Integrate JIRA with Nagios
Also, I am moving this the the Core forum as it is not a Log Server Question
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
Hi Team,
I have enabled to enable_environment_macros- 1 as per below guidance but still getting same error.
• https://support.nagios.com/forum/viewto ... =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
I have enabled to enable_environment_macros- 1 as per below guidance but still getting same error.
• https://support.nagios.com/forum/viewto ... =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
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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
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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Integrate JIRA with Nagios
This is good, but per the error message, it is expecting to be run from Nagiosrituraj966323 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
}
Code: Select all
Script was most likely not called from Nagios. Aborting.
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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
It might be script may not work.
Please confirm if any alternatives so that we can generate Jira ticket from Nagios Automatically.
Regards,
Rituraj
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Integrate JIRA with Nagios
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/A ... or/details
https://exchange.nagios.org/directory/A ... or/details
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
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/ ... 1533633216#
[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
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/ ... 1533633216#
[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
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Integrate JIRA with Nagios
Below docs I have followed to install JIRA-PERL but no go
https://code.activestate.com/ppm/JIRA-REST/
Regards,
Rituraj
https://code.activestate.com/ppm/JIRA-REST/
Regards,
Rituraj