Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
centreon
centreon-plugins
Commits
e57c66cc
Commit
e57c66cc
authored
Nov 22, 2021
by
itoussies
Browse files
wip
parent
48ffc55f
Changes
6
Hide whitespace changes
Inline
Side-by-side
apps/video/zixi/restapi/mode/broadcasterinputusage.pm
View file @
e57c66cc
...
...
@@ -25,7 +25,7 @@ use base qw(centreon::plugins::templates::counter);
use
strict
;
use
warnings
;
use
Digest::
MD5
qw(md5_hex)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold
_ng
)
;
sub
custom_status_output
{
my
(
$self
,
%options
)
=
@_
;
...
...
@@ -57,7 +57,7 @@ sub set_counters {
closure_custom_calc
=>
$self
->
can
('
custom_status_calc
'),
closure_custom_output
=>
$self
->
can
('
custom_status_output
'),
closure_custom_perfdata
=>
sub
{
return
0
;
},
closure_custom_threshold_check
=>
\
&catalog_status_threshold
,
closure_custom_threshold_check
=>
\
&catalog_status_threshold
_ng
,
}
},
{
label
=>
'
traffic-in
',
set
=>
{
...
...
apps/video/zixi/restapi/mode/broadcasterlicenseusage.pm
View file @
e57c66cc
...
...
@@ -24,7 +24,7 @@ use base qw(centreon::plugins::templates::counter);
use
strict
;
use
warnings
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold
_ng
)
;
sub
custom_status_output
{
my
(
$self
,
%options
)
=
@_
;
...
...
@@ -135,7 +135,7 @@ sub set_counters {
closure_custom_calc
=>
$self
->
can
('
custom_status_calc
'),
closure_custom_output
=>
$self
->
can
('
custom_status_output
'),
closure_custom_perfdata
=>
sub
{
return
0
;
},
closure_custom_threshold_check
=>
\
&catalog_status_threshold
,
closure_custom_threshold_check
=>
\
&catalog_status_threshold
_ng
,
}
},
{
label
=>
'
usage
',
set
=>
{
...
...
apps/video/zixi/restapi/mode/broadcasteroutputusage.pm
View file @
e57c66cc
...
...
@@ -25,7 +25,7 @@ use base qw(centreon::plugins::templates::counter);
use
strict
;
use
warnings
;
use
Digest::
MD5
qw(md5_hex)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold
_ng
)
;
sub
custom_status_output
{
my
(
$self
,
%options
)
=
@_
;
...
...
@@ -57,7 +57,7 @@ sub set_counters {
closure_custom_calc
=>
$self
->
can
('
custom_status_calc
'),
closure_custom_output
=>
$self
->
can
('
custom_status_output
'),
closure_custom_perfdata
=>
sub
{
return
0
;
},
closure_custom_threshold_check
=>
\
&catalog_status_threshold
closure_custom_threshold_check
=>
\
&catalog_status_threshold
_ng
}
},
{
label
=>
'
traffic-in
',
set
=>
{
...
...
apps/video/zixi/restapi/mode/feederinputusage.pm
View file @
e57c66cc
...
...
@@ -25,7 +25,7 @@ use base qw(centreon::plugins::templates::counter);
use
strict
;
use
warnings
;
use
Digest::
MD5
qw(md5_hex)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold
_ng
)
;
sub
custom_status_output
{
my
(
$self
,
%options
)
=
@_
;
...
...
@@ -44,6 +44,12 @@ sub custom_status_calc {
return
0
;
}
sub
prefix_input_output
{
my
(
$self
,
%options
)
=
@_
;
return
"
Input '
"
.
$options
{
instance_value
}
->
{
name
}
.
"
'
";
}
sub
set_counters
{
my
(
$self
,
%options
)
=
@_
;
...
...
@@ -52,7 +58,7 @@ sub set_counters {
];
$self
->
{
maps_counters
}
->
{
input
}
=
[
{
label
=>
'
status
',
t
hreshold
=>
0
,
set
=>
{
{
label
=>
'
status
',
t
ype
=>
2
,
set
=>
{
key_values
=>
[
{
name
=>
'
active
'
},
{
name
=>
'
name
'
},
{
name
=>
'
error
'
}
],
closure_custom_calc
=>
$self
->
can
('
custom_status_calc
'),
closure_custom_output
=>
$self
->
can
('
custom_status_output
'),
...
...
@@ -79,27 +85,12 @@ sub new {
bless
$self
,
$class
;
$options
{
options
}
->
add_options
(
arguments
=>
{
'
filter-name:s
'
=>
{
name
=>
'
filter_name
'
},
'
warning-status:s
'
=>
{
name
=>
'
warning_status
'
},
'
critical-status:s
'
=>
{
name
=>
'
critical_status
'
}
'
filter-name:s
'
=>
{
name
=>
'
filter_name
'
}
});
return
$self
;
}
sub
check_options
{
my
(
$self
,
%options
)
=
@_
;
$self
->
SUPER::
check_options
(
%options
);
$self
->
change_macros
(
macros
=>
['
warning_status
',
'
critical_status
']);
}
sub
prefix_input_output
{
my
(
$self
,
%options
)
=
@_
;
return
"
Input '
"
.
$options
{
instance_value
}
->
{
name
}
.
"
'
";
}
sub
manage_selection
{
my
(
$self
,
%options
)
=
@_
;
...
...
apps/video/zixi/restapi/mode/feederoutputusage.pm
View file @
e57c66cc
...
...
@@ -25,7 +25,7 @@ use base qw(centreon::plugins::templates::counter);
use
strict
;
use
warnings
;
use
centreon::plugins::
misc
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold)
;
use
centreon::plugins::templates::
catalog_functions
qw(catalog_status_threshold
_ng
)
;
sub
custom_status_output
{
my
(
$self
,
%options
)
=
@_
;
...
...
@@ -34,15 +34,10 @@ sub custom_status_output {
return
$msg
;
}
sub
custom_status_calc
{
sub
prefix_output_output
{
my
(
$self
,
%options
)
=
@_
;
$self
->
{
result_values
}
->
{
active
}
=
$options
{
new_datas
}
->
{
$self
->
{
instance
}
.
'
_active
'};
$self
->
{
result_values
}
->
{
name
}
=
$options
{
new_datas
}
->
{
$self
->
{
instance
}
.
'
_name
'};
$self
->
{
result_values
}
->
{
error
}
=
$options
{
new_datas
}
->
{
$self
->
{
instance
}
.
'
_error
'};
$self
->
{
result_values
}
->
{
con_stat
}
=
$options
{
new_datas
}
->
{
$self
->
{
instance
}
.
'
_con_stat
'};
return
0
;
return
"
Output '
"
.
$options
{
instance_value
}
->
{
name
}
.
"
'
";
}
sub
set_counters
{
...
...
@@ -53,24 +48,23 @@ sub set_counters {
];
$self
->
{
maps_counters
}
->
{
output_stream
}
=
[
{
label
=>
'
status
',
t
hreshold
=>
0
,
set
=>
{
{
label
=>
'
status
',
t
ype
=>
2
,
set
=>
{
key_values
=>
[
{
name
=>
'
active
'
},
{
name
=>
'
name
'
},
{
name
=>
'
error
'
},
{
name
=>
'
con_stat
'
}
],
closure_custom_calc
=>
$self
->
can
('
custom_status_calc
'),
closure_custom_output
=>
$self
->
can
('
custom_status_output
'),
closure_custom_perfdata
=>
sub
{
return
0
;
},
closure_custom_threshold_check
=>
\
&catalog_status_threshold
,
closure_custom_threshold_check
=>
\
&catalog_status_threshold
_ng
}
},
{
label
=>
'
current-bitrate
',
set
=>
{
{
label
=>
'
current-bitrate
',
nlabel
=>
'
feedoutput.traffic.out.usage.bytes.
',
set
=>
{
key_values
=>
[
{
name
=>
'
bitrate
'
},
{
name
=>
'
name
'
}
],
output_change_bytes
=>
2
,
output_template
=>
'
C
urrent
B
itrate : %s %s/s
',
output_template
=>
'
c
urrent
b
itrate : %s %s/s
',
perfdatas
=>
[
{
label
=>
'
current_bitrate
',
value
=>
'
bitrate
',
template
=>
'
%.2f
',
min
=>
0
,
unit
=>
'
b/s
',
label_extra_instance
=>
1
,
instance_use
=>
'
name
'
}
,
]
,
{
label
=>
'
current_bitrate
',
template
=>
'
%.2f
',
min
=>
0
,
unit
=>
'
b/s
',
label_extra_instance
=>
1
,
instance_use
=>
'
name
'
}
]
}
}
,
}
];
}
...
...
@@ -79,27 +73,11 @@ sub new {
my
$self
=
$class
->
SUPER::
new
(
package
=>
__PACKAGE__
,
%options
);
bless
$self
,
$class
;
$options
{
options
}
->
add_options
(
arguments
=>
{
"
filter-name:s
"
=>
{
name
=>
'
filter_name
'
},
"
warning-status:s
"
=>
{
name
=>
'
warning_status
'
},
"
critical-status:s
"
=>
{
name
=>
'
critical_status
'
},
});
return
$self
;
}
sub
check_options
{
my
(
$self
,
%options
)
=
@_
;
$self
->
SUPER::
check_options
(
%options
);
$self
->
change_macros
(
macros
=>
['
warning_status
',
'
critical_status
']);
}
$options
{
options
}
->
add_options
(
arguments
=>
{
"
filter-name:s
"
=>
{
name
=>
'
filter_name
'
}
});
sub
prefix_output_output
{
my
(
$self
,
%options
)
=
@_
;
return
"
Output '
"
.
$options
{
instance_value
}
->
{
name
}
.
"
'
";
return
$self
;
}
sub
manage_selection
{
...
...
apps/video/zixi/restapi/plugin.pm
View file @
e57c66cc
...
...
@@ -30,14 +30,14 @@ sub new {
bless
$self
,
$class
;
$self
->
{
version
}
=
'
1.0
';
%
{
$self
->
{
modes
}
}
=
(
'
broadcaster-input-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcasterinputusage
',
'
broadcaster-license-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcasterlicenseusage
',
'
broadcaster-output-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcasteroutputusage
',
'
broadcaster-system-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcastersystemusage
',
'
feeder-input-usage
'
=>
'
apps::video::zixi::restapi::mode::feederinputusage
',
'
feeder-output-usage
'
=>
'
apps::video::zixi::restapi::mode::feederoutputusage
'
,
)
;
$self
->
{
modes
}
=
(
'
broadcaster-input-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcasterinputusage
',
'
broadcaster-license-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcasterlicenseusage
',
'
broadcaster-output-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcasteroutputusage
',
'
broadcaster-system-usage
'
=>
'
apps::video::zixi::restapi::mode::broadcastersystemusage
',
'
feeder-input-usage
'
=>
'
apps::video::zixi::restapi::mode::feederinputusage
',
'
feeder-output-usage
'
=>
'
apps::video::zixi::restapi::mode::feederoutputusage
'
}
;
$self
->
{
custom_modes
}{
api
}
=
'
apps::video::zixi::restapi::custom::api
';
return
$self
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment