Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,926
Community Members
 
Community Events
176
Community Groups

API de integração do Jira Service Desk com o Nagios para abrir chamado de eventos/alertas

#!/bin/perl

use strict;
use warnings;
use JIRA::REST;
use Data::Dumper;

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

my $jira = JIRA::REST->new({
url => 'https://xxxxxxx',
username => 'xxxx',
password => 'xxxx'
});

#my $baseurl = $jira->GET('/rest/servicedeskapi/info');
#print Dumper($baseurl);
#
use vars qw( $state $type $attempt $hostname $servicedesc $serviceoutput $datetime );
GetOptions(
'help|h' => \&print_usage,
'state|s=s' => \$state,
'type|t=s' => \$type,
'attempt|A=i' => \$attempt,
'hostname|H=s' => \$hostname,
'servicedesc|S=s' => \$servicedesc,
'serviceoutput|a=s' => \$serviceoutput,
'datetime|d=s' => \$datetime,
);


if(!$state or !$type or !$attempt or !$hostname or !$servicedesc) {
print "\tUSAGE:/usr/local/nagios/libexec/jira_eventhandler.pl -s <state> -t <type> -A <attempt> -H <hostname> -S <servicedesc>\n";
exit 3; #unknown
}

if($type ne "HARD" or $state eq "OK") {
# not doing anything till its reaaaally a problem
exit 0; #ok
}

1 comment

Estava olhando seu script, acredito que esta faltando um pedaço. Não está fazendo nada com o objeto $jira que foi criado no início.

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events