mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-25 14:44:43 +02:00
add keyname tag in ec2 listinstance
This commit is contained in:
parent
c127ffcbb0
commit
dd6f32f7bf
@ -348,6 +348,7 @@ sub ec2_list_resources {
|
|||||||
InstanceType => $instance->{InstanceType},
|
InstanceType => $instance->{InstanceType},
|
||||||
State => $instance->{State}->{Name},
|
State => $instance->{State}->{Name},
|
||||||
Tags => join(",", @instance_tags),
|
Tags => join(",", @instance_tags),
|
||||||
|
KeyName => $instance->{KeyName},
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ sub run {
|
|||||||
$self->manage_selection(%options);
|
$self->manage_selection(%options);
|
||||||
foreach (@{$self->{instances}}) {
|
foreach (@{$self->{instances}}) {
|
||||||
next if ($_->{Type} !~ m/instance/);
|
next if ($_->{Type} !~ m/instance/);
|
||||||
$self->{output}->output_add(long_msg => sprintf("[Id = %s][AvailabilityZone = %s][InstanceType = %s][State = %s][Tags = %s]",
|
$self->{output}->output_add(long_msg => sprintf("[Id = %s][AvailabilityZone = %s][InstanceType = %s][State = %s][Tags = %s][KeyName = %s]",
|
||||||
$_->{Name}, $_->{AvailabilityZone}, $_->{InstanceType}, $_->{State}, $_->{Tags}));
|
$_->{Name}, $_->{AvailabilityZone}, $_->{InstanceType}, $_->{State}, $_->{Tags}, $_->{KeyName}));
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'OK',
|
$self->{output}->output_add(severity => 'OK',
|
||||||
@ -67,7 +67,7 @@ sub run {
|
|||||||
sub disco_format {
|
sub disco_format {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{output}->add_disco_format(elements => ['id', 'availabilityzone', 'instancetype', 'state', 'tags']);
|
$self->{output}->add_disco_format(elements => ['id', 'availabilityzone', 'instancetype', 'state', 'tags', 'keyname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub disco_show {
|
sub disco_show {
|
||||||
@ -82,6 +82,7 @@ sub disco_show {
|
|||||||
instancetype => $_->{InstanceType},
|
instancetype => $_->{InstanceType},
|
||||||
state => $_->{State},
|
state => $_->{State},
|
||||||
tags => $_->{Tags},
|
tags => $_->{Tags},
|
||||||
|
keyname => $_->{KeyName},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user