enh(3cx) Add a global counter (#2201)
This commit is contained in:
parent
85ad90b734
commit
f727a05aa6
|
@ -53,9 +53,21 @@ sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{maps_counters_type} = [
|
$self->{maps_counters_type} = [
|
||||||
|
{ name => 'global', type => 0 },
|
||||||
{ name => 'extension', type => 1, cb_prefix_output => 'prefix_service_output', message_multiple => 'All extensions are ok' }
|
{ name => 'extension', type => 1, cb_prefix_output => 'prefix_service_output', message_multiple => 'All extensions are ok' }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$self->{maps_counters}->{global} = [
|
||||||
|
{ label => 'count', nlabel => '3cx.extensions.count', display_ok => 0, set => {
|
||||||
|
key_values => [ { name => 'count' } ],
|
||||||
|
output_template => 'Extensions count : %d',
|
||||||
|
perfdatas => [
|
||||||
|
{ template => '%d', min => 0 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{extension} = [
|
$self->{maps_counters}->{extension} = [
|
||||||
{ label => 'status', type => 2, set => {
|
{ label => 'status', type => 2, set => {
|
||||||
key_values => [
|
key_values => [
|
||||||
|
@ -118,6 +130,8 @@ sub manage_selection {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->{global}->{count}++;
|
||||||
|
|
||||||
$self->{extension}->{$item->{_str}} = {
|
$self->{extension}->{$item->{_str}} = {
|
||||||
extension => $item->{_str},
|
extension => $item->{_str},
|
||||||
registered => $item->{IsRegistered} ? 'true' : 'false',
|
registered => $item->{IsRegistered} ? 'true' : 'false',
|
||||||
|
@ -163,6 +177,10 @@ Can used special variables like: %{extension}, %{registered}, %{dnd}, %{profile}
|
||||||
Set critical threshold for status.
|
Set critical threshold for status.
|
||||||
Can used special variables like: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration}
|
Can used special variables like: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration}
|
||||||
|
|
||||||
|
=item B<--warning-*> B<--critical-*>
|
||||||
|
|
||||||
|
Thresholds (Can be: 'count').
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
Loading…
Reference in New Issue