Skip to content

Commit

Permalink
fixed errors in Trigger::Get
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Abraham committed Sep 14, 2012
1 parent d6dcd31 commit fe2a936
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bin/main.pl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ sub uniqArray
my $response = Pabbix::Trigger::Get->new(
authToken => $authToken,
url => $url,
statusValue => 'PROBLEM',
)->get;

use Data::Dumper;
print Dumper $response;

if( -f $file )
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Pabbix/HostGroup/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ sub _add_missing_params
sub _add_name_filter
{
my $self = shift;
$json->{'params'}{'output'} = 'extend';
if( $self->name )
{
my $json = $self->json;
$json->{'params'}{'output'} = 'extend';
$json->{'params'}{'filter'}{'name'} = $self->name;
$self->json( $json );
}
Expand All @@ -44,11 +44,11 @@ sub _add_name_filter
sub _add_id_filter
{
my $self = shift;
$json->{'params'}{'output'} = 'extend';
if( $self->groupid )
{
my $json = $self->json;
$json->{'params'}{'filter'}{'groupid'} = $self->groupid;
$json->{'params'}{'output'} = 'extend';
$self->json( $json );
}
}
Expand Down
4 changes: 3 additions & 1 deletion lib/Pabbix/Trigger/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ sub _add_status
if( defined( $self->statusValue ) )
{
my $json = $self->json;
$json->{'params'}{'status'} = $self->_translateStatus;
$json->{'params'}{'output'} = 'extend';
$json->{'params'}{'expandData'} = 'host';
$json->{'params'}{'filter'}{'value'} = $self->_translateStatus;
$self->json( $json );
}
}
Expand Down
2 changes: 2 additions & 0 deletions lib/Pabbix/Trigger/Get.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ sub get
url => $self->url,
json => $self->_createJson,
);
use Data::Dumper;
print Dumper $self->json;
return $response->get();
}

Expand Down

0 comments on commit fe2a936

Please sign in to comment.