Release 20240711 ()

This commit is contained in:
tuntoja 2024-07-11 14:01:32 +02:00 committed by GitHub
commit ea9abfb9ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
44 changed files with 1725 additions and 195 deletions
.github
connectors/vmware/src/centreon/vmware
packaging/centreon-plugin-Network-Nokia-Isam-Snmp
src
apps
microsoft/hyperv/2012/local/mode
protocols/http/mode
trendmicro/iwsva/snmp
centreon/common/powershell/hyperv/2012
database/mysql/mode
network
os/windows/wsman/mode
tests
resources/spellcheck
robot
apps/microsoft/hyperv/2012/local
network/cisco/meraki/cloudcontroller/restapi
os/linux/snmp

80
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,80 @@
# Community contributors
## Description
Please include a short resume of the changes and what is the purpose of this pull request.
Any relevant information should be added to help **reviewers** to understand what are the stakes
of the pull request.
**Fixes** # (issue)
If you are fixing a github Issue already existing, mention it here.
## Type of change
- [ ] Patch fixing an issue (non-breaking change)
- [ ] New functionality (non-breaking change)
- [ ] Functionality enhancement or optimization (non-breaking change)
- [ ] Breaking change (patch or feature) that might cause side effects breaking part of the Software
## How this pull request can be tested ?
Please describe the **procedure** to verify that the goal of the PR is matched.
Provide clear instructions so that it can be **correctly tested**.
Any **relevant details** of the configuration to perform the test should be added.
To integrate this pull request into our core we need to add some **automated tests** to check the proper
functioning of this PR. Ideally we need the following informations:
* **SNMP**: MIB files and full snmpwalk of enterprise branch (`snmpwalk -ObentU -v 2c -c public address .1.3.6.1.4.1 > equipment.snmpwalk`) or [SNMP collections](https://thewatch.centreon.com/product-how-to-21/snmp-collection-tutorial-132).
* **HTTP API (SOAP, Rest/Json, XML-RPC)**: the documentation and some curl examples (command with -v + output) or HTTP [collections](https://thewatch.centreon.com/data-collection-6/centreon-plugins-discover-collection-modes-131).
* **CLI**: command line examples (command + result).
* **SQL**: queries + results + column types or [SQL collections](https://thewatch.centreon.com/product-how-to-21/sql-collection-tutorial-134).
* **JMX**: mbean names and attributes.
If some information is confidential, such as logins or IP addresses, obfuscate them in what is sent
publicly and we'll get in touch with you by private message if this information is needed.
## Checklist
- [ ] I have followed the **[coding style guidelines](https://github.com/centreon/centreon-plugins/blob/develop/doc/en/developer/plugins_global.md#5-code-style-guidelines)** provided by Centreon
- [ ] I have commented my code, especially **hard-to-understand areas** of the PR.
- [ ] I have **rebased** my development branch on the base branch (develop).
- [ ] I have provide data or shown output displaying the result of this code in the plugin area concerned.
------------------------------------------------------------------------------------------------------
# Centreon team
## Description
**PLEASE MAKE SURE THAT THE BRANCH PR INCLUDES JIRA TICKET ID**
Please include a short resume of the changes and what is the purpose of this pull request.
Any relevant information should be added to help **reviewers** to understand what are the stakes
of the pull request.
**Fixes** # (issue)
If you are fixing a github Issue already existing, mention it here.
If you are fixing one or more JIRA ticket, mention it here too.
## Type of change
- [ ] Patch fixing an issue (non-breaking change)
- [ ] New functionality (non-breaking change)
- [ ] Functionality enhancement or optimization (non-breaking change)
- [ ] Breaking change (patch or feature) that might cause side effects breaking part of the Software
## How this pull request can be tested ?
Please describe the **procedure** to verify that the goal of the PR is matched.
Provide clear instructions so that it can be **correctly tested**.
Mention the automated tests included in this FOR (what they test like mode/option combinations).
## Checklist
- [ ] I have followed the **[coding style guidelines](https://github.com/centreon/centreon-plugins/blob/develop/doc/en/developer/plugins_global.md#5-code-style-guidelines)** provided by Centreon
- [ ] I have commented my code, especially **hard-to-understand areas** of the PR.
- [ ] I have **rebased** my development branch on the base branch (develop).
- [ ] I have implemented automated tests related to my commits.
- [ ] I have reviewed all the help messages in all the .pm files I have modified.
- [ ] All sentences begin with a capital letter.
- [ ] All sentences are terminated by a period.
- [ ] I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.

View File

@ -5,7 +5,7 @@ use Test::More;
use Test::Spelling;
if (!@ARGV) {
die "Missing perl file to check.";
die "Usage: perl pod_spell_check.t module.pm stopwords.t";
}
my $stopword_filename='tests/resources/spellcheck/stopwords.t';
@ -14,9 +14,10 @@ if(defined($ARGV[1])){
}
open(FILE, "<", $stopword_filename)
or die "Could not open $stopword_filename";
printf("stopword file use : ".$stopword_filename." \n");
printf("Using dictionary: ".$stopword_filename." \n");
add_stopwords(<FILE>);
close(FILE);
set_spell_cmd('hunspell -l');
all_pod_files_spelling_ok($ARGV[0]);
close(FILE);

View File

@ -22,9 +22,6 @@ jobs:
strategy:
matrix:
include:
- runner: ubuntu-22.04
dockerfile: packaging-plugins-centos7
image: packaging-plugins-centos7
- runner: ubuntu-22.04
dockerfile: packaging-plugins-alma8
image: packaging-plugins-alma8
@ -51,14 +48,14 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- name: Login to proxy registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
@ -66,7 +63,7 @@ jobs:
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
with:
file: .github/docker/packaging/Dockerfile.${{ matrix.dockerfile }}
context: .

View File

@ -48,14 +48,14 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- name: Login to proxy registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
@ -63,7 +63,7 @@ jobs:
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
with:
file: .github/docker/testing/Dockerfile.testing-plugins-${{ matrix.dockerfile }}
context: .

View File

@ -33,6 +33,7 @@ jobs:
distrib: [el8, el9]
name:
[
"ARGV::Struct",
"Authen::SASL::SASLprep",
"Authen::SCRAM::Client",
"boolean",
@ -42,9 +43,11 @@ jobs:
"Clone",
"Clone::Choose",
"common::sense",
"Config::AWS",
"Convert::Binary::C",
"Convert::EBCDIC",
"Crypt::Blowfish_PP",
"DataStruct::Flat",
"DateTime::Format::Duration::ISO8601",
"DBD::Sybase",
"Device::Modbus",
@ -70,6 +73,8 @@ jobs:
"MIME::Types",
"Mojo::IOLoop::Signal",
"MongoDB",
"MooseX::ClassAttribute",
"Net::Amazon::Signature::V4",
"Net::DHCP",
"Net::FTPSSL",
"Net::HTTPTunnel",
@ -91,6 +96,7 @@ jobs:
"URI::Encode",
"URI::Template",
"URL::Encode",
"URL::Encode::XS",
"UUID",
"UUID::URandom",
"WWW::Selenium",
@ -130,6 +136,8 @@ jobs:
rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)"
- name: "Statistics::Regression"
version: "0.53"
- name: "URL::Encode::XS"
build_distribs: el9
- name: "UUID"
version: "0.31"
- name: "ZMQ::Constants"
@ -139,6 +147,11 @@ jobs:
- name: "ZMQ::LibZMQ4"
version: "0.01"
rpm_dependencies: "zeromq"
- name: "Mojo::IOLoop::Signal"
rpm_dependencies: "perl-Mojolicious"
rpm_provides: "perl(Mojo::IOLoop::Signal)"
no-auto-depends: true
name: package ${{ matrix.distrib }} ${{ matrix.name }}
container:
@ -179,6 +192,10 @@ jobs:
done
fi
if [ ! -z "${{ matrix.no-auto-depends }}" ]; then
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
fi
if [ -z "${{ matrix.rpm_provides }}" ]; then
PACKAGE_PROVIDES=""
else
@ -216,7 +233,7 @@ jobs:
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }}
path: ./*.${{ matrix.package_extension }}
@ -354,8 +371,6 @@ jobs:
image: packaging-plugins-bullseye-arm64
arch: arm64
runner_name: ["self-hosted", "collect-arm64"]
- name: "Paws"
use_dh_make_perl: "false"
- name: "Statistics::Regression"
build_distribs: "bullseye"
version: "0.53"
@ -437,13 +452,12 @@ jobs:
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}-${{ steps.package-name.outputs.name_with_dash}}
path: ./*.${{ matrix.package_extension }}
retention-days: 1
merge-package-deb-artifacts:
needs: [package-deb]
runs-on: ubuntu-22.04

View File

@ -135,7 +135,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension}}

View File

@ -120,7 +120,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: packages-${{ matrix.distrib }}
path: ./*.${{ matrix.package_extension}}

View File

@ -133,7 +133,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension}}

View File

@ -133,7 +133,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension }}

View File

@ -102,7 +102,7 @@ jobs:
path: ./*.rpm
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: packages-${{ matrix.distrib }}
path: ./*.rpm

View File

@ -93,7 +93,7 @@ jobs:
fetch-depth: 1
- name: Prepare FatPacker
uses: shogo82148/actions-setup-perl@28eae78d12c2bba1163aec45d123f6d9228bc307 # v1.29.0
uses: shogo82148/actions-setup-perl@f551dafcc94572adc179bbddbb409b3ada8f8ff5 # v1.30.0
with:
perl-version: '5.34'
install-modules-with: cpm
@ -118,7 +118,7 @@ jobs:
matrix:
include:
- package_extension: rpm
image: packaging-plugins-centos7
image: packaging-plugins-alma8
distrib: el7
- package_extension: rpm
image: packaging-plugins-alma8
@ -156,7 +156,7 @@ jobs:
- if: ${{ matrix.distrib == 'el7' }}
# el7 is not compatible with checkout v4 which uses node20
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./build/
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
@ -284,7 +284,7 @@ jobs:
- name: Upload apt/dnf logs as artifacts if tests failed
if: failure()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: plugin-installation-${{ matrix.distrib }}
path: /var/log/robot-plugins-installation-tests.log

View File

@ -30,7 +30,7 @@ jobs:
- added|modified: 'src/**/*.pm'
- name: Install CPAN Libraries
uses: shogo82148/actions-setup-perl@28eae78d12c2bba1163aec45d123f6d9228bc307 # v1.29.0
uses: shogo82148/actions-setup-perl@f551dafcc94572adc179bbddbb409b3ada8f8ff5 # v1.30.0
with:
perl-version: '5.34'
install-modules-with: cpm

View File

@ -406,7 +406,7 @@ sub generic_performance_values_historic {
return undef if (!defined($perfdata));
if (!$$perfdata[0] || !defined($$perfdata[0]->value)) {
set_response(code => -1, short_message => 'Cannot get value for counters (Maybe, object(s) cannot be reached: disconnected, not running, time not synced (see time-host mode),...)');
set_response(code => -1, short_message => 'Cannot get value for counters (Maybe, object(s) cannot be reached: disconnected, not running, time not synced (see time-host mode) check option --time-shift and ensure this specific metric is retrieved and not late in the vcenter)');
return undef;
}
foreach my $val (@$perfdata) {

View File

@ -0,0 +1,5 @@
{
"dependencies": [
"libsnmp-perl"
]
}

View File

@ -0,0 +1,14 @@
{
"pkg_name": "centreon-plugin-Network-Nokia-Isam-Snmp",
"pkg_summary": "Centreon Plugin to monitor Nokia (formerly Alcatel) Isam devices",
"plugin_name": "centreon_nokia_isam_snmp.pl",
"files": [
"centreon/plugins/script_snmp.pm",
"centreon/plugins/snmp.pm",
"snmp_standard/mode/interfaces.pm",
"snmp_standard/mode/listinterfaces.pm",
"snmp_standard/mode/resources/",
"snmp_standard/mode/uptime.pm",
"network/nokia/isam/snmp/"
]
}

View File

@ -0,0 +1,5 @@
{
"dependencies": [
"perl(SNMP)"
]
}

View File

@ -134,6 +134,20 @@ sub check_options {
if (!defined($self->{option_results}->{command_options}) || $self->{option_results}->{command_options} eq '');
}
sub determine_operational_status {
my ($operational_status) = @_;
if ( defined($operational_status) ) {
if ( defined($node_vm_integration_service_operational_status->{ $operational_status}) ) {
return $node_vm_integration_service_operational_status->{ $operational_status };
} else {
return $operational_status;
}
} else {
return '-';
}
}
sub manage_selection {
my ($self, %options) = @_;
@ -235,16 +249,13 @@ sub manage_selection {
my $services = (ref($node->{services}) eq 'ARRAY') ? $node->{services} : [ $node->{services} ];
foreach my $service (@$services) {
$self->{vm}->{$id}->{service}->{$id2} = {
vm => $node->{name},
service => $service->{service},
enabled => $service->{enabled} =~ /True|1/i ? 1 : 0,
primary_status =>
defined($service->{primary_operational_status}) && defined($node_vm_integration_service_operational_status->{ $service->{primary_operational_status} }) ?
$node_vm_integration_service_operational_status->{ $service->{primary_operational_status} } : '-',
secondary_status =>
defined($service->{secondary_operational_status}) && defined($node_vm_integration_service_operational_status->{ $service->{secondary_operational_status} }) ?
$node_vm_integration_service_operational_status->{ $service->{secondary_operational_status} } : '-'
primary_status => determine_operational_status($service->{primary_operational_status}),
secondary_status => determine_operational_status($service->{secondary_operational_status})
};
$id2++;
}

View File

@ -193,6 +193,8 @@ sub lookup {
$self->decode_json_response();
foreach my $xpath_find (@{$self->{option_results}->{lookup}}) {
next if ($xpath_find eq '');
eval {
my $jpath = JSON::Path->new($xpath_find);
@values = $jpath->values($self->{json_response_decoded});
@ -379,7 +381,7 @@ __END__
=head1 MODE
Check JSON webservice. Can send the json request with option '--data'. Example:
Check JSON web service. Can send the json request with option '--data'. Example:
centreon_plugins.pl --plugin=apps::protocols::http::plugin --mode=json-content --data='/home/user/request.json' --hostname='myws.site.com' --urlpath='/get/payment'
--lookup='$..expiration' --header='Content-Type: application/json'
@ -389,7 +391,7 @@ JSON OPTIONS:
=item B<--data>
Set the JSONrequest or specify a file with the request inside.
Set the JSON request or specify a file with the request inside.
=item B<--lookup>
@ -398,8 +400,8 @@ See: http://goessner.net/articles/JsonPath/
=item B<--lookup-perfdatas-nagios>
Take perfdatas from the JSON response (JSON XPath string)
Chain must be formated in Nagios format.
Take perfdata from the JSON response (JSON XPath string)
Chain must be formatted in Nagios format.
Ex : "rta=10.752ms;50.000;100.000;0; pl=0%;20;40;; rtmax=10.802ms;;;;"
=back
@ -473,11 +475,11 @@ Returns a UNKNOWN status if the value matches the string.
=item B<--warning-time>
Warning threshold in seconds of webservice response time
Warning threshold in seconds of web service response time.
=item B<--critical-time>
Critical threshold in seconds of webservice response time
Critical threshold in seconds of web service response time.
=back
@ -523,7 +525,7 @@ Specify this option if you are accessing a web page using hidden basic authentic
=item B<--ntlmv2>
Specify this option if you are accessing a web page using ntlmv2 authentication (use with --credentials and --port options).
Specify this option if you are accessing a web page using NTLMv2 authentication (use with --credentials and --port options).
=item B<--timeout>
@ -551,11 +553,11 @@ Specify that the type of certificate is PKCS1.
=item B<--get-param>
Set GET params (multiple option. Example: --get-param='key=value').
Set a parameter for GET requests (multiple option. Example: --get-param='key=value').
=item B<--header>
Set HTTP headers(multiple option). Example: --header='Content-Type: xxxxx'.
Set HTTP headers(multiple option). Example: --header='Content-Type: application/json'.
=item B<--unknown-status>

View File

@ -50,6 +50,6 @@ __END__
=head1 PLUGIN DESCRIPTION
Check TendMicro Iwsva equipments in SNMP.
Check TrendMicro Iwsva equipments in SNMP.
=cut

View File

@ -35,6 +35,9 @@ $culture = new-object "System.Globalization.CultureInfo" "en-us"
$ps .= centreon::common::powershell::functions::escape_jsonstring(%options);
$ps .= centreon::common::powershell::functions::convert_to_json(%options);
# if the version of HyperV Powershell module is higher than 2.0.0 and not compatible with
# the following script, then use this Import-Module instead:
# Import-Module -Name "Hyper-V" -MaximumVersion "2.0.0"
$ps .= '
$ProgressPreference = "SilentlyContinue"
@ -68,8 +71,19 @@ Try {
$item_service.service = $service.Name
$item_service.enabled = $service.Enabled
# this works for sure on v1.1 of HyperV Powershell module
$item_service.primary_operational_status = $service.PrimaryOperationalStatus.value__
$item_service.secondary_operational_status = $service.SecondaryOperationalStatus.value__
# this works for sure on v2.0.0 of HyperV Powershell module
if (($service.PrimaryStatusDescription -ne $null) -and ($service.PrimaryStatusDescription -ne "")) {
$item_service.primary_operational_status = $service.PrimaryStatusDescription
}
if (($service.SecondaryStatusDescription -ne $null) -and ($service.SecondaryStatusDescription -ne "")) {
$item_service.secondary_operational_status = $service.SecondaryStatusDescription
}
$services.Add($item_service)
}
@ -96,6 +110,6 @@ __END__
=head1 DESCRIPTION
Method to get hyper-v informations.
Method to get Hyper-V information.
=cut

View File

@ -172,7 +172,20 @@ sub manage_selection {
$innodb_per_table = 1 if ($value =~ /on/i);
$options{sql}->query(
query => q{SELECT table_schema, table_name, engine, data_free, data_length+index_length as data_used, (DATA_FREE / (DATA_LENGTH+INDEX_LENGTH)) as TAUX_FRAG FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND engine IN ('InnoDB', 'MyISAM')}
query => q{
SELECT
table_schema,
table_name,
engine,
data_free,
data_length + index_length as data_used,
DATA_FREE / (DATA_LENGTH + INDEX_LENGTH + DATA_FREE) as TAUX_FRAG
FROM
information_schema.tables
WHERE
table_type = 'BASE TABLE'
AND engine IN ('InnoDB', 'MyISAM')
}
);
my $result = $options{sql}->fetchall_arrayref();
@ -230,7 +243,7 @@ __END__
=head1 MODE
Check MySQL databases size and tables.
Check MySQL/MariaDB databases and tables sizes.
=over 8
@ -240,7 +253,7 @@ Filter the databases to monitor with a regular expression.
=item B<--filter-table>
Filter table name (can be a regexp).
Filter tables by name (can be a regexp).
=item B<--warning-*> B<--critical-*>

View File

@ -241,16 +241,17 @@ sub write_cache_file {
sub get_cache_file_response {
my ($self, %options) = @_;
my $cache_filename = 'cache_meraki_'
. md5_hex($self->{api_token} . '_' .(defined($self->{option_results}->{api_filter_orgs}) ?
$self->{option_results}->{api_filter_orgs} : '')
);
$self->{cache}->read(
statefile => 'cache_meraki_' . md5_hex(
$self->{api_token} . '_' .
(defined($self->{option_results}->{api_filter_orgs}) ? $self->{option_results}->{api_filter_orgs} : '')
)
statefile => $cache_filename
);
$self->{datas} = $self->{cache}->get(name => 'response');
if (!defined($self->{datas})) {
$self->{output}->add_option_msg(short_msg => 'Cache file missing');
$self->{output}->add_option_msg(short_msg => 'Cache file missing or could not load ' . $cache_filename);
$self->{output}->option_exit();
}
@ -261,7 +262,9 @@ sub call_datas {
my ($self, %options) = @_;
$self->get_organizations();
$self->get_networks(orgs => [keys %{$self->{datas}->{orgs}}]);
if (!defined($options{skipNetworks})) {
$self->get_networks(orgs => [keys %{$self->{datas}->{orgs}}]);
}
if (!defined($options{skipDevices})) {
$self->get_devices(orgs => [keys %{$self->{datas}->{orgs}}]);
@ -269,6 +272,9 @@ sub call_datas {
if (!defined($options{skipDevicesStatus})) {
$self->get_organization_device_statuses(orgs => [keys %{$self->{datas}->{orgs}}]);
}
if (!defined($options{skipVpnTunnelsStatus})) {
$self->get_organization_vpn_tunnels_statuses(orgs => [keys %{$self->{datas}->{orgs}}]);
}
if (defined($options{cache})) {
foreach my $orgId (keys %{$self->{datas}->{orgs}}) {
@ -408,6 +414,26 @@ sub get_organization_device_statuses {
return $self->{datas}->{devices_status};
}
sub get_organization_vpn_tunnels_statuses {
my ($self, %options) = @_;
$self->{datas}->{vpn_tunnels_status} = {};
foreach my $id (@{$options{orgs}}) {
my $datas = $self->request_api(
endpoint => '/organizations/' . $id . '/appliance/vpn/statuses',
paginate => 300,
hostname => $self->get_shard_hostname(organization_id => $id),
ignore_codes => { 400 => 1 } # it can be disabled
);
foreach (@$datas) {
$self->{datas}->{vpn_tunnels_status}->{ $_->{deviceSerial} } = $_;
$self->{datas}->{vpn_tunnels_status}->{ $_->{deviceSerial} }->{organizationId} = $id;
}
}
return $self->{datas}->{vpn_tunnels_status};
}
sub get_network_device_uplink {
my ($self, %options) = @_;
@ -444,7 +470,7 @@ sub get_organization_uplink_loss_and_latency {
if (defined($datas)) {
foreach (@$datas) {
# sometimes uplink is undef. so we skip
next if (!defined($_->{uplink}));
next if (!defined($_->{uplink}) || !defined($_->{serial}));
$self->{datas}->{uplinks_loss_latency}->{ $options{orgId} }->{ $_->{serial} } = {}
if (!defined($self->{datas}->{uplinks_loss_latency}->{ $options{orgId} }->{ $_->{serial} }));
@ -554,7 +580,7 @@ Meraki REST API
=head1 SYNOPSIS
api_token Rest API custom mode
Rest API custom mode
=head1 REST API OPTIONS
@ -562,23 +588,23 @@ api_token Rest API custom mode
=item B<--hostname>
Meraki api hostname (default: 'api.meraki.com')
Meraki API hostname (default: 'api.meraki.com')
=item B<--port>
Port used (default: 443)
Define the TCP port to use to reach the API (default: 443).
=item B<--proto>
Specify https if needed (default: 'https')
Define the protocol to reach the API (default: 'https').
=item B<--api-token>
Meraki api token.
Meraki API token.
=item B<--timeout>
Set HTTP timeout
Define the timeout for HTTP requests.
=item B<--ignore-permission-errors>
@ -586,15 +612,15 @@ Ignore permission errors (403 status code).
=item B<--ignore-orgs-api-disabled>
Ignore organizations with api disabled.
Ignore organizations where the API is disabled.
=item B<--api-filter-orgs>
Filter organizations (regexp).
Define the organizations to monitor (regular expression).
=item B<--cache-use>
Use the cache file (created with cache mode).
Use the cache file instead of requesting the API (the cache file can be created with the cache mode).
=back

View File

@ -312,6 +312,7 @@ sub new {
'filter-tags:s' => { name => 'filter_tags' },
'add-switch-ports' => { name => 'add_switch_ports' },
'filter-switch-port:s' => { name => 'filter_switch_port' },
'filter-link-name:s' => { name => 'filter_link_name' },
'skip-traffic-disconnect-port' => { name => 'skip_traffic_disconnect_port' },
'skip-clients' => { name => 'skip_clients' },
'skip-performance' => { name => 'skip_performance' },
@ -373,6 +374,10 @@ sub add_uplink {
foreach (@$links) {
my $interface = lc($_->{interface});
$interface =~ s/\s+//g;
next if (defined($self->{option_results}->{filter_link_name}) && $self->{option_results}->{filter_link_name} ne '' &&
$interface !~ /$self->{option_results}->{filter_link_name}/);
$self->{devices}->{ $options{serial} }->{device_links}->{$interface} = {
display => $interface,
link_status => lc($_->{status})
@ -396,7 +401,10 @@ sub add_uplink_loss_latency {
foreach (values %$links) {
my $interface = lc($_->{uplink});
$interface =~ s/\s+//g;
next if (!defined($self->{devices}->{ $options{serial} }->{device_links}->{$interface}));
next if (defined($self->{option_results}->{filter_link_name}) && $self->{option_results}->{filter_link_name} ne '' &&
$interface !~ /$self->{option_results}->{filter_link_name}/);
my ($latency, $loss, $count) = (0, 0, 0);
foreach my $ts (@{$_->{timeSeries}}) {
@ -581,6 +589,10 @@ Check devices.
Filter devices by name (can be a regexp).
=item B<--filter-link-name>
Filter VPN links by name (can be a regexp).
=item B<--filter-network-id>
Filter devices by network ID (can be a regexp).
@ -611,7 +623,7 @@ Don't monitor clients traffic on device.
=item B<--skip-performance>
Don't monitor appliance perfscore.
Don't monitor appliance performance score.
=item B<--skip-connections>

View File

@ -0,0 +1,149 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::cisco::meraki::cloudcontroller::restapi::mode::listvpntunnels;
use base qw(centreon::plugins::mode);
use strict;
use warnings;
my @labels = (
'organization_id',
'organization_name',
'network_id',
'network_name',
'device_serial',
'mode',
'status'
);
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {
'filter-network-id:s' => { name => 'filter_network_id' },
'filter-organization-name:s' => { name => 'filter_organization_name' },
'filter-organization-id:s' => { name => 'filter_organization_id' }
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
}
sub manage_selection {
my ($self, %options) = @_;
my $organizations = $options{custom}->get_organizations();
my $devices = $options{custom}->get_organization_vpn_tunnels_statuses(
orgs => [keys %$organizations]
);
my $results = {};
foreach (keys %$devices) {
next if (defined($self->{option_results}->{filter_network_id}) && $self->{option_results}->{filter_network_id} ne '' &&
$devices->{$_}->{networkId} !~ /$self->{option_results}->{filter_network_id}/);
next if (defined($self->{option_results}->{filter_organization_id}) && $self->{option_results}->{filter_organization_id} ne '' &&
$devices->{$_}->{organizationId} !~ /$self->{option_results}->{filter_organization_id}/);
my $organization_name = $organizations->{ $devices->{$_}->{organizationId} }->{name};
next if (defined($self->{option_results}->{filter_organization_name}) && $self->{option_results}->{filter_organization_name} ne '' &&
$organization_name !~ /$self->{option_results}->{filter_organization_name}/);
$results->{$_} = {
network_id => $devices->{$_}->{networkId},
network_name => $devices->{$_}->{networkName},
device_serial => $devices->{$_}->{deviceSerial},
organization_id => $devices->{$_}->{organizationId},
organization_name => $organization_name,
mode => $devices->{$_}->{vpnMode},
status => $devices->{$_}->{deviceStatus}
};
}
return $results;
}
sub run {
my ($self, %options) = @_;
my $results = $self->manage_selection(custom => $options{custom});
foreach my $instance (sort keys %$results) {
$self->{output}->output_add(long_msg =>
join('', map("[$_: " . $results->{$instance}->{$_} . ']', @labels))
);
}
$self->{output}->output_add(
severity => 'OK',
short_msg => 'List VPN tunnels:'
);
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit();
}
sub disco_format {
my ($self, %options) = @_;
$self->{output}->add_disco_format(elements => [@labels]);
}
sub disco_show {
my ($self, %options) = @_;
my $results = $self->manage_selection(custom => $options{custom});
foreach (sort keys %$results) {
$self->{output}->add_disco_entry(
%{$results->{$_}}
);
}
}
1;
__END__
=head1 MODE
List VPN tunnels.
=over 8
=item B<--filter-network-id>
Filter VPN tunnels by network ID (can be a regexp).
=item B<--filter-organization-id>
Filter VPN tunnels by organization ID (can be a regexp).
=item B<--filter-organization-name>
Filter VPN tunnels by organization name (can be a regexp).
=back
=cut

View File

@ -126,7 +126,7 @@ sub manage_selection {
(defined($self->{option_results}->{filter_organization_name}) ? $self->{option_results}->{filter_organization_name} : 'all')
);
my $datas = $options{custom}->get_datas(skipDevices => 1, skipDevicesStatus => 1);
my $datas = $options{custom}->get_datas(skipDevices => 1, skipDevicesStatus => 1, skipVpnTunnelsStatus => 1);
$self->{networks} = {};
foreach my $id (keys %{$datas->{networks}}) {

View File

@ -0,0 +1,188 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::cisco::meraki::cloudcontroller::restapi::mode::vpntunnels;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
use Digest::MD5 qw(md5_hex);
sub custom_status_output {
my ($self, %options) = @_;
return 'status: ' . $self->{result_values}->{status} . ' [mode: ' . $self->{result_values}->{mode} . ']';
}
sub prefix_tunnel_output {
my ($self, %options) = @_;
return "vpn tunnel '" . $options{instance_value}->{deviceSerial} . "' ";
}
sub prefix_global_output {
my ($self, %options) = @_;
return 'Vpn tunnels ';
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0, cb_prefix_output => 'prefix_global_output', skipped_code => { -10 => 1 } },
{ name => 'tunnels', type => 1, cb_prefix_output => 'prefix_tunnel_output', message_multiple => 'All vpn tunnels are ok' }
];
$self->{maps_counters}->{global} = [
{ label => 'total-online', nlabel => 'vpn.tunnels.online.count', display_ok => 0, set => {
key_values => [ { name => 'online' }, { name => 'total' } ],
output_template => 'online: %s',
perfdatas => [
{ template => '%s', min => 0, max => 'total' }
]
}
},
{ label => 'total-offline', nlabel => 'vpn.tunnels.offline.count', display_ok => 0, set => {
key_values => [ { name => 'offline' }, { name => 'total' } ],
output_template => 'offline: %s',
perfdatas => [
{ template => '%s', min => 0, max => 'total' }
]
}
},
{ label => 'total-dormant', nlabel => 'vpn.tunnels.dormant.count', display_ok => 0, set => {
key_values => [ { name => 'dormant' }, { name => 'total' } ],
output_template => 'dormant: %s',
perfdatas => [
{ template => '%s', min => 0, max => 'total' }
]
}
}
];
$self->{maps_counters}->{tunnels} = [
{
label => 'status', type => 2,
critical_default => '%{status} =~ /offline/i',
set => {
key_values => [ { name => 'status' }, { name => 'mode' }, { name => 'deviceSerial' } ],
closure_custom_output => $self->can('custom_status_output'),
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold_ng
}
}
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {
'filter-network-name:s' => { name => 'filter_network_name' },
'filter-organization-name:s' => { name => 'filter_organization_name' },
'filter-organization-id:s' => { name => 'filter_organization_id' },
'filter-device-serial:s' => { name => 'filter_device_serial' }
});
return $self;
}
sub manage_selection {
my ($self, %options) = @_;
my $datas = $options{custom}->get_datas(skipDevices => 1, skipDevicesStatus => 1, skipNetworks => 1);
$self->{global} = { total => 0, online => 0, offline => 0, dormant => 0 };
$self->{tunnels} = {};
foreach my $id (keys %{$datas->{vpn_tunnels_status}}) {
next if (defined($self->{option_results}->{filter_network_name}) && $self->{option_results}->{filter_network_name} ne '' &&
$datas->{vpn_tunnels_status}->{$id}->{networkName} !~ /$self->{option_results}->{filter_network_name}/);
next if (defined($self->{option_results}->{filter_organization_id}) && $self->{option_results}->{filter_organization_id} ne '' &&
$datas->{vpn_tunnels_status}->{$id}->{organizationId} !~ /$self->{option_results}->{filter_organization_id}/);
next if (defined($self->{option_results}->{filter_organization_name}) && $self->{option_results}->{filter_organization_name} ne '' &&
$datas->{orgs}->{ $datas->{vpn_tunnels_status}->{$id}->{organizationId} }->{name} !~ /$self->{option_results}->{filter_organization_name}/);
$self->{tunnels}->{$id} = {
deviceSerial => $id,
status => $datas->{vpn_tunnels_status}->{$id}->{deviceStatus},
mode => $datas->{vpn_tunnels_status}->{$id}->{vpnMode}
};
$self->{global}->{total}++;
$self->{global}->{ lc($datas->{vpn_tunnels_status}->{$id}->{deviceStatus}) }++
if (defined($self->{global}->{ lc($datas->{vpn_tunnels_status}->{$id}->{deviceStatus}) }));
}
}
1;
__END__
=head1 MODE
Check VPN tunnels.
=over 8
=item B<--filter-network-name>
Filter VPN tunnels by network name (can be a regexp).
=item B<--filter-organization-id>
Filter VPN tunnels by organization ID (can be a regexp).
=item B<--filter-organization-name>
Filter VPN tunnels by organization name (can be a regexp).
=item B<--filter-device-serial>
Filter VPN tunnels by device serial (can be a regexp).
=item B<--unknown-status>
Define the conditions to match for the status to be UNKNOWN.
You can use the following variables: %{status}, %{deviceSerial}, %{mode}
=item B<--warning-status>
Define the conditions to match for the status to be WARNING.
You can use the following variables: %{status}, %{deviceSerial}, %{mode}
=item B<--critical-status>
Define the conditions to match for the status to be CRITICAL (default: '%{status} =~ /offline/i').
You can use the following variables: %{status}, %{deviceSerial}, %{mode}
=item B<--warning-*> B<--critical-*>
Thresholds.
Can be: 'total-online', 'total-offline', 'total-dormant'.
=back
=cut

View File

@ -30,13 +30,15 @@ sub new {
bless $self, $class;
$self->{modes} = {
'api-requests' => 'network::cisco::meraki::cloudcontroller::restapi::mode::apirequests',
'cache' => 'network::cisco::meraki::cloudcontroller::restapi::mode::cache',
'devices' => 'network::cisco::meraki::cloudcontroller::restapi::mode::devices',
'discovery' => 'network::cisco::meraki::cloudcontroller::restapi::mode::discovery',
'list-devices' => 'network::cisco::meraki::cloudcontroller::restapi::mode::listdevices',
'list-tags' => 'network::cisco::meraki::cloudcontroller::restapi::mode::listtags',
'networks' => 'network::cisco::meraki::cloudcontroller::restapi::mode::networks'
'api-requests' => 'network::cisco::meraki::cloudcontroller::restapi::mode::apirequests',
'cache' => 'network::cisco::meraki::cloudcontroller::restapi::mode::cache',
'devices' => 'network::cisco::meraki::cloudcontroller::restapi::mode::devices',
'discovery' => 'network::cisco::meraki::cloudcontroller::restapi::mode::discovery',
'list-devices' => 'network::cisco::meraki::cloudcontroller::restapi::mode::listdevices',
'list-tags' => 'network::cisco::meraki::cloudcontroller::restapi::mode::listtags',
'list-vpn-tunnels' => 'network::cisco::meraki::cloudcontroller::restapi::mode::listvpntunnels',
'networks' => 'network::cisco::meraki::cloudcontroller::restapi::mode::networks',
'vpn-tunnels' => 'network::cisco::meraki::cloudcontroller::restapi::mode::vpntunnels'
};
$self->{custom_modes}->{api} = 'network::cisco::meraki::cloudcontroller::restapi::custom::api';

View File

@ -18,11 +18,11 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::components::cardtemperature;
package network::nokia::isam::snmp::mode::components::cardtemperature;
use strict;
use warnings;
use network::alcatel::isam::snmp::mode::components::resources qw($mapping_slot);
use network::nokia::isam::snmp::mode::components::resources qw($mapping_slot);
my $oid_eqptBoardThermalSensorActualTemperature = '.1.3.6.1.4.1.637.61.1.23.10.1.2';

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::components::resources;
package network::nokia::isam::snmp::mode::components::resources;
use strict;
use warnings;
@ -34,4 +34,4 @@ $mapping_slot = {
eqptBoardInventorySerialNumber => { oid => '.1.3.6.1.4.1.637.61.1.23.3.1.19' },
};
1;
1;

View File

@ -18,11 +18,11 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::components::sfp;
package network::nokia::isam::snmp::mode::components::sfp;
use strict;
use warnings;
use network::alcatel::isam::snmp::mode::components::resources qw($mapping_slot);
use network::nokia::isam::snmp::mode::components::resources qw($mapping_slot);
my %map_los = (1 => 'los', 2 => 'noLos', 3 => 'notAvailable');

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::cpu;
package network::nokia::isam::snmp::mode::cpu;
use base qw(centreon::plugins::templates::counter);
@ -95,7 +95,7 @@ __END__
=head1 MODE
Check CPU usages.
Monitor the CPU usage.
=over 8

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::hardware;
package network::nokia::isam::snmp::mode::hardware;
use base qw(centreon::plugins::templates::hardware);
@ -40,7 +40,7 @@ sub set_system {
]
};
$self->{components_path} = 'network::alcatel::isam::snmp::mode::components';
$self->{components_path} = 'network::nokia::isam::snmp::mode::components';
$self->{components_module} = ['cardtemperature', 'sfp'];
}
@ -76,7 +76,7 @@ Check Hardware.
=item B<--component>
Which component to check (default: '.*').
Define which component to check (default: '.*').
Can be: 'cardtemperature', 'sfp'.
=item B<--filter>
@ -88,7 +88,6 @@ You can also exclude items from specific instances: --filter=cardtemperature,108
Define the expected status if no components are found (default: critical).
=item B<--threshold-overload>
Use this option to override the status returned by the plugin when the status label matches a regular expression (syntax: section,[instance,]status,regexp).
@ -96,13 +95,19 @@ Example: --threshold-overload='sfp,OK,^los$'
=item B<--warning>
Set warning threshold for 'sfp.temperature', 'cardtemperature' (syntax: type,regexp,threshold)
Example: --warning='sfp.temperature,1.1,30'
Define the warning thresholds for an instance of a certain type of sensor.
Syntax: <type>,<regexp>,<threshold>.
Supported types of sensors: 'sfp.temperature', 'cardtemperature'.
Instances are identified by the last two parts of the OID, separated by a period (example: 1.1) and are filtered as a regular expression.
Example: --warning='sfp.temperature,1\.1,30'
=item B<--critical>
Set critical threshold for 'sfp.temperature', 'cardtemperature' (syntax: type,regexp,threshold)
Example: --warning='sfp.temperature,1.1,40'
Define the critical thresholds for an instance of a certain type of sensor.
Syntax: <type>,<regexp>,<threshold>.
Supported types of sensors: 'sfp.temperature', 'cardtemperature'.
Instances are identified by the last two parts of the OID, separated by a period (example: 1.1) and are filtered as a regular expression.
Example: --critical='sfp.temperature,1\.1,40'
=back

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::hubsapusage;
package network::nokia::isam::snmp::mode::hubsapusage;
use base qw(centreon::plugins::templates::counter);
@ -334,7 +334,7 @@ sub manage_selection {
$self->{output}->option_exit();
}
my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_alcatel_isam_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode});
my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_nokia_isam_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode});
my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp');
if ($has_cache_file == 0 || !defined($timestamp_cache) ||
((time() - $timestamp_cache) > (($self->{option_results}->{reload_cache_time}) * 60))) {
@ -404,7 +404,7 @@ sub manage_selection {
$self->{output}->option_exit();
}
$self->{cache_name} = 'alcatel_isam_' . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' .
$self->{cache_name} = 'nokia_isam_' . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' .
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')) . '_' .
(defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all'));
}
@ -415,62 +415,61 @@ __END__
=head1 MODE
Check SAP QoS usage.
Check Service Access Points (SAP) QoS usage.
=over 8
=item B<--display-name>
Display name (default: '%{SvcDescription}.%{IfName}.%{SapEncapName}').
Can also be: %{SapDescription}, %{SapPortId}
Define the name to display (default: '%{SvcDescription}.%{IfName}.%{SapEncapName}').
Other available macros: %{SapDescription}, %{SapPortId}
=item B<--filter-name>
Filter by SAP name (can be a regexp).
Filter by Service Access Point (SAP) name (can be a regexp).
=item B<--speed-in>
Set interface speed for incoming traffic (in Mb).
Define the actual maximum incoming traffic speed you can have on the interfaces in megabits per second.
=item B<--speed-out>
Set interface speed for outgoing traffic (in Mb).
Define the actual maximum outgoing traffic speed you can have on the interfaces in megabits per second.
=item B<--speed-total-in>
Set interface speed for total incoming traffic (in Mb).
Define the actual maximum total incoming traffic speed you can have on the interfaces in megabits per second.
=item B<--speed-total-out>
Set interface speed for total outgoing traffic (in Mb).
Define the actual maximum total outgoing traffic speed you can have on the interfaces in megabits per second.
=item B<--units-traffic>
Units of thresholds for the traffic (default: '%') ('%', 'b/s').
Define the unit to use to apply to thresholds (default: '%') ('%', 'b/s').
=item B<--warning-status>
Set warning threshold for ib status.
Define the conditions to match for the status to be WARNING.
You can use the following variables: %{admin}, %{status}, %{display}
=item B<--critical-status>
Set critical threshold for ib status (default: '%{admin} =~ /up/i and %{status} !~ /up/i').
Define the conditions to match for the status to be CRITICAL.
Default: '%{admin} =~ /up/i and %{status} !~ /up/i'.
You can use the following variables: %{admin}, %{status}, %{display}
=item B<--warning-*>
Warning threshold.
Can be: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
Warning thresholds for: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
=item B<--critical-*>
Critical threshold.
Can be: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
Critical thresholds for: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
=item B<--reload-cache-time>
Time in seconds before reloading cache file (default: 300).
Time in seconds before reloading the cache file (default: 300).
=back

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::listhubsap;
package network::nokia::isam::snmp::mode::listhubsap;
use base qw(centreon::plugins::mode);
@ -137,7 +137,7 @@ __END__
=head1 MODE
List SAP.
List Service Access Points (SAP) for service discovery.
=over 8

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::mode::memory;
package network::nokia::isam::snmp::mode::memory;
use base qw(centreon::plugins::templates::counter);
@ -159,7 +159,7 @@ sub manage_selection {
my $name = $result->{eqptBoardInventorySerialNumber} . '_' . $result->{eqptSlotActualType};
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$name !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $name . "': not matching filter.", debug => 1);
next;
}
$self->{memory}->{$name} = { display => $name, total => $result->{totalMemSize} * 1024 * 1024, used => $result->{memAbsoluteUsage} * 1024 * 1024 };
@ -170,7 +170,7 @@ sub manage_selection {
my $name = 'SD Card';
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$name !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $name . "': not matching filter.", debug => 1);
} else {
$self->{memory}->{$name} = { display => $name, total => $snmp_result->{$oid_asamSwmTotalSpaceOnFileDisk},
used => $snmp_result->{$oid_asamSwmTotalSpaceOnFileDisk} - $snmp_result->{$oid_asamSwmFreeSpaceOnFileDisk} };
@ -189,17 +189,14 @@ __END__
=head1 MODE
Check memory usages.
Monitor memory usage.
=over 8
=item B<--filter-name>
Filter memory name (can be a regexp).
=item B<--filter-project>
Filter project name (can be a regexp).
Define which memory component to monitor based on their name.
This option will be treated as a regular expression.
=item B<--warning-usage>
@ -211,11 +208,11 @@ Critical threshold.
=item B<--units>
Units of thresholds (default: '%') ('%', 'B').
Define the unit to use to apply to thresholds (default: '%') ('%', 'B').
=item B<--free>
Thresholds are on free space left.
Apply the thresholds on free space left instead of on used space.
=back

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::alcatel::isam::snmp::plugin;
package network::nokia::isam::snmp::plugin;
use strict;
use warnings;
@ -31,13 +31,14 @@ sub new {
$self->{version} = '1.0';
%{$self->{modes}} = (
'cpu' => 'network::alcatel::isam::snmp::mode::cpu',
'hardware' => 'network::alcatel::isam::snmp::mode::hardware',
'cpu' => 'network::nokia::isam::snmp::mode::cpu',
'hardware' => 'network::nokia::isam::snmp::mode::hardware',
'hub-sap-usage' => 'network::nokia::isam::snmp::mode::hubsapusage',
'interfaces' => 'snmp_standard::mode::interfaces',
'list-hub-sap' => 'network::alcatel::isam::snmp::mode::listhubsap',
'list-hub-sap' => 'network::nokia::isam::snmp::mode::listhubsap',
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
'memory' => 'network::alcatel::isam::snmp::mode::memory',
'hub-sap-usage' => 'network::alcatel::isam::snmp::mode::hubsapusage',
'memory' => 'network::nokia::isam::snmp::mode::memory',
'uptime' => 'snmp_standard::mode::uptime',
);
return $self;
@ -49,6 +50,6 @@ __END__
=head1 PLUGIN DESCRIPTION
Check Alcatel DSL ISAM Family (also ASAM) in SNMP.
Monitor Nokia (formerly Alcatel) DSL ISAM devices (also ASAM) using SNMP.
=cut

View File

@ -52,7 +52,7 @@ my $map_status = {
7 => 'mediaDisconnect',
8 => 'auth',
9 => 'authSucceeded',
10 => 'ÁuthFailed',
10 => 'AuthFailed',
11 => 'invalidAddress',
12 => 'credentialsRequired'
};

View File

@ -1,6 +1,11 @@
--add-sysdesc
--api-filter-orgs
--api-password
--api-token
--api-version
--cacert-file
--cert-pkcs12
--cert-pwd
--critical-bytesallocatedpercentage
--display-transform-dst
--display-transform-src
@ -8,9 +13,13 @@
--exclude-fs
--filter-fs
--filter-vdom
--filter-vm
--force-counters32
--force-counters64
--force-oid
--get-param
--ignore-orgs-api-disabled
--lookup-perfdatas-nagios
--map-speed-dsl
--mqtt
--mqtt-allow-insecure
@ -23,22 +32,61 @@
--mqtt-timeout
--mqtt-username
--nagvis-perfdata
--ntlmv2
--oid-display
--oid-extra-display
--oid-filter
--urlpath
--warning-bytesallocatedpercentage
-EncodedCommand
-InputFormat
-NoLogo
2c
ADSL
ASAM
Alcatel
Avigilon
Centreon
Datacore
Fortigate
Fortinet
HashiCorp
ISAM
IpAddr
Iwsva
Loggly
MBean
MQTT
Meraki
Mosquitto
NTLMv2
NagVis
Nagios
Netscaler
OID
PKCS1
QoS
RRDCached
SNMP
SSH
Sansymphony
SureBackup
TCP
TrendMicro
VDSL2
VM
Veeam
VPN
WSMAN
XPath
api.meraki.com
cardtemperature
connections-dhcp
connections-dns
deltaps
df
eth
fanspeed
Fortigate
Fortinet
HashiCorp
hashicorpvault
ifAlias
ifDesc
@ -47,18 +95,9 @@ in-bcast
in-mcast
in-ucast
interface-dsl-name
IpAddr
Iwsva
keepass
ldap
license-instances-usage-prct
Loggly
MBean
Mosquitto
MQTT
NagVis
Netscaler
OID
okta
oneaccess-sys-mib
out-bcast
@ -66,25 +105,20 @@ out-mcast
out-ucast
perfdata
powershell
powershell.exe
proto
psu
queue-messages-inflighted
RRDCached
Sansymphony
SNMP
sfp.temperature
space-usage-prct
SSH
SureBackup
teampass
timeframe
topic-messages-inflighted
total-offline-prct
total-online-prct
total-oper-down
total-oper-up
TendMicro
uptime
userpass
VDSL2
Veeam
v1
v2
WSMAN

View File

@ -0,0 +1,407 @@
[
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER01",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER02",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER03",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER04",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER05",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": false
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER06",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER07",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "Error",
"secondary_operational_status": "OK",
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": false
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER07",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER08",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
}
]

View File

@ -0,0 +1,37 @@
*** Settings ***
Documentation Application Microsoft HyperV 2022
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS}
... --plugin=apps::microsoft::hyperv::2012::local::plugin
... --mode=node-integration-service
... --command=cat
... --command-path=/usr/bin
... --no-ps
... --command-options=nodeintegrationservice-2022.json
*** Test Cases ***
HyperV 2022 ${tc}/3
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization
${command} Catenate
... ${CMD}
... --filter-vm='${filter_vm}'
${output} Run ${command}
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${expected_result}
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
Examples: tc filter_vm expected_result --
... 1 ${EMPTY} CRITICAL: 1 problem(s) detected
... 2 VSERVER05 OK: VM 'VSERVER05' 0 problem(s) detected - VM 'VSERVER05' 0 problem(s) detected
... 3 VSERVER07 CRITICAL: VM 'VSERVER07' 1 problem(s) detected

View File

@ -0,0 +1,480 @@
{
"uuid": "a1da12c3-97f5-4ab7-bec7-a30e1c36309a",
"lastMigration": 32,
"name": "Meraki.mockoon",
"endpointPrefix": "",
"latency": 0,
"port": 3000,
"hostname": "",
"folders": [],
"routes": [
{
"uuid": "77da22e2-4161-4be7-a598-62e372cf0438",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "api/v1/organizations",
"responses": [
{
"uuid": "4c2ab123-f20d-4e65-a422-096ecec496ce",
"body": "",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "access-control-allow-headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
},
{
"key": "access-control-allow-methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "access-control-allow-origin",
"value": "*"
},
{
"key": "content-security-policy",
"value": "default-src 'none'"
},
{
"key": "content-type",
"value": "text/html; charset=utf-8"
},
{
"key": "x-content-type-options",
"value": "nosniff"
}
],
"bodyType": "DATABUCKET",
"filePath": "",
"databucketID": "xl8l",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": false,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
},
{
"uuid": "3d572355-f7f4-4558-abc6-0e4c2c8b06f9",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "api/v1/organizations/123456789123456789/appliance/vpn/statuses",
"responses": [
{
"uuid": "4baedfc4-2a1d-4dd1-aff6-e07f6c4144e9",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "access-control-allow-headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
},
{
"key": "access-control-allow-methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "access-control-allow-origin",
"value": "*"
},
{
"key": "content-security-policy",
"value": "default-src 'none'"
},
{
"key": "content-type",
"value": "text/html; charset=utf-8"
},
{
"key": "x-content-type-options",
"value": "nosniff"
}
],
"bodyType": "DATABUCKET",
"filePath": "",
"databucketID": "zqoq",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": false,
"crudKey": "id",
"callbacks": [],
"body": "{}"
}
],
"responseMode": null
},
{
"uuid": "c8872c69-c290-4c5e-aa4b-18f8ffaf084b",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "api/v1/organizations/123456789123456789/networks",
"responses": [
{
"uuid": "0723def4-07b5-4549-962a-e041423a9733",
"body": "[]",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "access-control-allow-headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
},
{
"key": "access-control-allow-methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "access-control-allow-origin",
"value": "*"
},
{
"key": "content-security-policy",
"value": "default-src 'none'"
},
{
"key": "content-type",
"value": "text/html; charset=utf-8"
},
{
"key": "x-content-type-options",
"value": "nosniff"
}
],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": false,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
},
{
"uuid": "e7b443c0-4b6e-41b0-bfad-6b23fd14a9cd",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "api/v1/organizations/123456789123456789/devices",
"responses": [
{
"uuid": "c1d9369d-ee0e-4b4c-b6df-5f64f4112382",
"body": "[]",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "access-control-allow-headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
},
{
"key": "access-control-allow-methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "access-control-allow-origin",
"value": "*"
},
{
"key": "content-security-policy",
"value": "default-src 'none'"
},
{
"key": "content-type",
"value": "text/html; charset=utf-8"
},
{
"key": "x-content-type-options",
"value": "nosniff"
}
],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": false,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
},
{
"uuid": "83ae251f-e2ac-4eb0-bed3-9d024d2d4055",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "api/v1/organizations/123456789123456789/devices/statuses",
"responses": [
{
"uuid": "e459d826-8630-498d-983f-5259052584b7",
"body": "[]",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "access-control-allow-headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
},
{
"key": "access-control-allow-methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "access-control-allow-origin",
"value": "*"
},
{
"key": "content-security-policy",
"value": "default-src 'none'"
},
{
"key": "content-type",
"value": "text/html; charset=utf-8"
},
{
"key": "x-content-type-options",
"value": "nosniff"
}
],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": false,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
},
{
"uuid": "05351271-5695-4ccc-bdd2-75fd0ab68def",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "api/v1/organizations/123456789123456789/uplinks/statuses",
"responses": [
{
"uuid": "e6e461fe-86d2-43c1-adb9-73047593e783",
"body": "[]",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "access-control-allow-headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
},
{
"key": "access-control-allow-methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "access-control-allow-origin",
"value": "*"
},
{
"key": "content-security-policy",
"value": "default-src 'none'"
},
{
"key": "content-type",
"value": "text/html; charset=utf-8"
},
{
"key": "x-content-type-options",
"value": "nosniff"
}
],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": false,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
},
{
"uuid": "1ee10c37-cb78-4594-9fd9-006a3927f6f2",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "api/v1/organizations/123456789123456789/devices/uplinksLossAndLatency",
"responses": [
{
"uuid": "18e3e93c-302d-4fda-86d1-9ffd1a8b8abd",
"body": "[]",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [
{
"key": "access-control-allow-headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
},
{
"key": "access-control-allow-methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "access-control-allow-origin",
"value": "*"
},
{
"key": "content-security-policy",
"value": "default-src 'none'"
},
{
"key": "content-type",
"value": "text/html; charset=utf-8"
},
{
"key": "x-content-type-options",
"value": "nosniff"
}
],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": false,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
}
],
"rootChildren": [
{
"type": "route",
"uuid": "77da22e2-4161-4be7-a598-62e372cf0438"
},
{
"type": "route",
"uuid": "3d572355-f7f4-4558-abc6-0e4c2c8b06f9"
},
{
"type": "route",
"uuid": "c8872c69-c290-4c5e-aa4b-18f8ffaf084b"
},
{
"type": "route",
"uuid": "e7b443c0-4b6e-41b0-bfad-6b23fd14a9cd"
},
{
"type": "route",
"uuid": "83ae251f-e2ac-4eb0-bed3-9d024d2d4055"
},
{
"type": "route",
"uuid": "05351271-5695-4ccc-bdd2-75fd0ab68def"
},
{
"type": "route",
"uuid": "1ee10c37-cb78-4594-9fd9-006a3927f6f2"
}
],
"proxyMode": false,
"proxyHost": "",
"proxyRemovePrefix": false,
"tlsOptions": {
"enabled": false,
"type": "CERT",
"pfxPath": "",
"certPath": "",
"keyPath": "",
"caPath": "",
"passphrase": ""
},
"cors": true,
"headers": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Access-Control-Allow-Methods",
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
},
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
}
],
"proxyReqHeaders": [
{
"key": "",
"value": ""
}
],
"proxyResHeaders": [
{
"key": "",
"value": ""
}
],
"data": [
{
"uuid": "80e9ddfd-1272-45d6-a29e-c927f0f8cebd",
"id": "xl8l",
"name": "Organizations",
"documentation": "",
"value": "[\n {\n \"id\": \"123456789123456789\",\n \"name\": \"Endor\",\n \"url\": \"http://127.0.0.1:3000/o/NQkU0cWc/manage/organization/overview\",\n \"samlConsumerUrl\": \"http://127.0.0.1:3000/saml/login/NQkU0cWc/RV3RrcB2UCVa\",\n \"samlConsumerUrls\": [\n \"http://127.0.0.1:3000/saml/login/NQkU0cWc/RV3RrcB2UCVa\"\n ],\n \"api\": {\n \"enabled\": true\n },\n \"licensing\": {\n \"model\": \"per-device\"\n },\n \"cloud\": {\n \"region\": {\n \"name\": \"Europe\",\n \"host\": {\n \"name\": \"Europe\"\n }\n }\n },\n \"management\": {\n \"details\": [\n {\n \"name\": \"customer number\",\n \"value\": \"56417983\"\n }\n ]\n }\n }\n]\n"
},
{
"uuid": "337987b2-984c-4882-9e6e-83a2c2b714f5",
"id": "zqoq",
"name": "VPN Tunnels",
"documentation": "",
"value": "[\n {\n \"networkId\": \"Z_000000000000000001\",\n \"networkName\": \"ALDERAAN\",\n \"deviceSerial\": \"C3PO-R2P2-BB88\",\n \"deviceStatus\": \"dormant\",\n \"uplinks\": [],\n \"vpnMode\": \"spoke\",\n \"exportedSubnets\": [\n {\n \"name\": \"Single LAN Settings\",\n \"subnet\": \"172.16.254.24/29\"\n }\n ],\n \"merakiVpnPeers\": [\n {\n \"networkId\": \"Z_000000000000000002\",\n \"networkName\": \"KASHYYYK\",\n \"reachability\": \"unreachable\"\n },\n {\n \"networkId\": \"Z_000000000000000003\",\n \"networkName\": \"TATOOINE\",\n \"reachability\": \"unreachable\"\n },\n {\n \"networkId\": \"Z_000000000000000004\",\n \"networkName\": \"HOTH\",\n \"reachability\": \"unreachable\"\n }\n ],\n \"thirdPartyVpnPeers\": []\n }\n]"
}
],
"callbacks": []
}

View File

@ -0,0 +1,46 @@
*** Settings ***
Documentation Meraki VPN Tunnels
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}meraki.mockoon.json
${CMD} ${CENTREON_PLUGINS} --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin
... --api-token=EEECGFCGFCGF
... --statefile-dir=/dev/shm/
*** Test Cases ***
Create cache from API
[Tags] meraki api vpn network cache
${output} Run
... ${CMD} --mode=cache --proto http --port 3000 --hostname=127.0.0.1
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: Cache files created successfully
... Wrong output result:\n\n ${output}\nInstead of:\n OK: Cache files created successfully\n\n
# Mockoon is not needed any longer since the data are cached
Stop Mockoon
Check if ${test_desc} works
[Tags] meraki api vpn network
${output} Run
... ${CMD} --mode=vpn-tunnels --filter-network-name=${filter_network_name} --cache-use --critical-total-dormant=1:
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${expected}
... Wrong output result:\n\n ${output}\nInstead of:\n ${expected}\n\n
Examples: test_desc filter_network_name expected --
... all links .* OK: vpn tunnel 'C3PO-R2P2-BB88' status: dormant [mode: spoke] | 'vpn.tunnels.online.count'=0;;;0;1 'vpn.tunnels.offline.count'=0;;;0;1 'vpn.tunnels.dormant.count'=1;;1:;0;1
... empty filter ${EMPTY} OK: vpn tunnel 'C3PO-R2P2-BB88' status: dormant [mode: spoke] | 'vpn.tunnels.online.count'=0;;;0;1 'vpn.tunnels.offline.count'=0;;;0;1 'vpn.tunnels.dormant.count'=1;;1:;0;1
... absurd filter toto CRITICAL: Vpn tunnels dormant: 0 | 'vpn.tunnels.online.count'=0;;;0;0 'vpn.tunnels.offline.count'=0;;;0;0 'vpn.tunnels.dormant.count'=0;;1:;0;0

View File

@ -0,0 +1,36 @@
*** Settings ***
Documentation Check the list-diskio mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::snmp::plugin
*** Test Cases ***
List diskio ${tc}
[Documentation] Check the number of returned disks
[Tags] os linux snmp service-disco
${command} Catenate
... ${CMD}
... --mode=list-diskio
... --hostname=127.0.0.1
... --snmp-version=2
... --snmp-port=2024
... --disco-show
... --snmp-community=${snmpcommunity}
${output} Run ${command}
${nb_results} Get Element Count
... ${output}
... label
Should Be Equal As Integers
... ${expected_result}
... ${nb_results}
... Wrong output result for command:{\n}{\n}${command}{\n}{\n}Command output:{\n}{\n}${output}
Examples: tc snmpcommunity expected_result --
... 1 os/linux/snmp/list-diskio 10
... 2 os/linux/snmp/list-diskio-2 4

View File

@ -1,45 +0,0 @@
*** Settings ***
Documentation OS Linux SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::snmp::plugin
&{list_diskio_test1}
... snmpcommunity=os/linux/snmp/list-diskio
... nbresults=10
&{list_diskio_test2}
... snmpcommunity=os/linux/snmp/list-diskio-2
... nbresults=4
@{list_diskio_tests}
... &{list_diskio_test1}
... &{list_diskio_test2}
*** Test Cases ***
Linux SNMP list diskio devices
[Documentation] List Linux diskio devices
[Tags] os linux snmp
FOR ${list_diskio_test} IN @{list_diskio_tests}
${command} Catenate
... ${CMD}
... --mode=list-diskio
... --hostname=127.0.0.1
... --snmp-version=2
... --snmp-port=2024
... --disco-show
... --snmp-community=${list_diskio_test.snmpcommunity}
${output} Run ${command}
Log To Console ${command}
${nb_results} Get Element Count
... ${output}
... label
Should Be Equal As Integers
... ${list_diskio_test.nbresults}
... ${nb_results}
... Wrong output result for list diskio devices: ${list_diskio_test}.{\n}Command output:{\n}${output}
END