Page 1 of 1

integrating nagios with jira

Posted: Thu Jan 30, 2020 11:55 am
by taruk
Hello ,

im working to intergrate nagios with jira ( nagios to open ticket in jira), i have found already a related topic but i could not add a comment cause its closed,

at this stage im just trying to get information from rest api in jira , the problem is i get error with internal error 500 in my nagios box, after some tries with postman i figured out that i need to deactivate ssl verification and and configure global proxy settings in postman,

is there any method to modify the script to get the same configuration,
script that im using :
#!/bin/perl
#
use strict;
use warnings;
use JIRA::REST;
use Data::Dumper;
use LWP::UserAgent;
use IO::Socket::SSL;


use Getopt::Std;
use Getopt::Long qw(:config no_ignore_case bundling);

my $jira = JIRA::REST->new({
url => 'https://x.x.x.x/',
username => "**********",
password => "************"
});
my $baseurl = $jira->GET('/rest/api/latest/issue/INDUS-25408');
print Dumper($baseurl);

Re: integrating nagios with jira

Posted: Thu Jan 30, 2020 7:20 pm
by Box293
Can you please provide a link to the topic you are referencing?

Re: integrating nagios with jira

Posted: Fri Jan 31, 2020 2:41 am
by taruk
Hello thnx for the reply here the topic that im folowing:
https://support.nagios.com/forum/viewto ... 62&start=0

Re: integrating nagios with jira

Posted: Fri Jan 31, 2020 3:23 am
by taruk
@box293 topic followed : https://support.nagios.com/forum/viewto ... 62&start=0
hello after updating my script i could use the api to get a ticket information , the problem now is when i want to post a ticket i got this problem below (see attachements), here is the new code :

#!/bin/perl
#
use strict;
use warnings;
use JIRA::REST;
use Data::Dumper;
use LWP::UserAgent;
use IO::Socket::SSL;


use Getopt::Std;
use Getopt::Long qw(:config no_ignore_case bundling);

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
#my $bot = LWP::UserAgent->new(
# env_proxy => 1,
# keep_alive => 1,
# timeout => 300,
# ssl_opts => {
# verify_hostname => 0,
# SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE },
#);









my $jira = JIRA::REST->new({
url => 'https://jira@',
username => "tchehidi",
password => "*********"
});
#$ua->proxy('http','http://*********:********@*******.201:8080');


#my $baseurl = $jira->GET('/rest/api/latest/issue/INDUS-25408');
#print Dumper($baseurl);







my $issue = $jira->POST('/issue', undef, {
fields => {
project => { key => 'INDUS' },
issuetype => { name => 'Incident' },
"Component/s" => { "Project Monitoring"},
Location => { "Vermeg-Malaren"},
SummaryRequired => "[NAGIOS] Hostname: Service: State:",
Description => "Hostname: Service: State: Info: DateTime:datetime"
},
});

Re: integrating nagios with jira

Posted: Fri Jan 31, 2020 8:23 am
by taruk
sorry for the time wasting , i resolved the problem , it was the components field it must be an array with the post pethod , thnx

Re: integrating nagios with jira

Posted: Fri Jan 31, 2020 2:36 pm
by benjaminsmith
Hello,
sorry for the time wasting , i resolved the problem , it was the components field it must be an array with the post pethod , thnx
Not a problem! Glad it's been resolved.

Thank you for using the Nagios Support Forum.