Release 20240909 (#5178)

This commit is contained in:
pkippes 2024-09-09 16:06:58 +02:00 committed by GitHub
commit 6cda88a109
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
148 changed files with 17843 additions and 194 deletions

10
.github/actions/unit-tests/action.yml vendored Normal file
View File

@ -0,0 +1,10 @@
name: "unit-tests"
description: "Unit tests that control the code itself"
runs:
using: "composite"
steps:
- name: Recursively run all unit tests
shell: bash
run: yath -L test ./tests

View File

@ -0,0 +1,55 @@
ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/almalinux:8
RUN bash -e <<EOF
dnf install -y 'dnf-command(config-manager)' epel-release zstd jq
dnf config-manager --set-enabled powertools
# Add Centreon plugins repositories
echo -e '[centreon-plugins-stable]\n\
name=centreon plugins stable x86_64\n\
baseurl=https://packages.centreon.com/rpm-plugins/el8/stable/x86_64\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-stable-noarch]\n\
name=centreon plugins stable noarch\n\
baseurl=https://packages.centreon.com/rpm-plugins/el8/stable/noarch\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-testing]\n\
name=centreon plugins testing x86_64\n\
baseurl=https://packages.centreon.com/rpm-plugins/el8/testing/x86_64\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-testing-noarch]\n\
name=centreon plugins testing noarch\n\
baseurl=https://packages.centreon.com/rpm-plugins/el8/testing/noarch\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-unstable]\n\
name=centreon plugins unstable x86_64\n\
baseurl=https://packages.centreon.com/rpm-plugins/el8/unstable/x86_64\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-unstable-noarch]\n\
name=centreon plugins unstable noarch\n\
baseurl=https://packages.centreon.com/rpm-plugins/el8/unstable/noarch\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
>> /etc/yum.repos.d/centreon-plugins.repo
dnf install -y gcc make cpan perl-Test2-Suite.noarch perl-Test2-Plugin-NoWarnings.noarch 'perl(Authen::Radius)' 'perl(Convert::Binary::C)' 'perl(Crypt::OpenSSL::RSA)' 'perl(Data::Dumper)' 'perl(Date::Parse)' 'perl(DateTime)' 'perl(DateTime::Duration)' 'perl(DateTime-Format-Duration-ISO8601)' 'perl(DateTime::Format::Strptime)' 'perl(DBD::mysql)' 'perl(DBD::ODBC)' 'perl(DBD::Pg)' 'perl(DBD::Sybase)' 'perl(DBI)' 'perl(Device::Modbus::RTU::Client)' 'perl(Device::Modbus::TCP::Client)' 'perl(Digest::CRC)' 'perl(Digest::MD5)' 'perl(Digest::SHA)' 'perl(Email::MIME)' 'perl(Email::Sender)' 'perl(Email::Send::SMTP::Gmail)' 'perl(Email::Simple)' 'perl(File::Basename)' 'perl(Filesys::SmbClient)' 'perl(Hash::Ordered)' 'perl(HTML::Template)' 'perl(IO::Select)' 'perl(IO::Socket)' 'perl(IO::Socket::INET)' 'perl(IO::Socket::INET6)' 'perl(IO::Socket::SSL)' 'perl(JMX::Jmx4Perl)' 'perl(JSON)' 'perl(JSON::Path)' 'perl(JSON::WebToken)' 'perl(JSON::XS)' 'perl(Libssh::Session)' 'perl-Mail-IMAPClient' 'perl(MIME::Base64)' 'perl(MongoDB)' 'perl(NetAddr::IP)' 'perl(Net::DHCP::Constants)' 'perl(Net::DHCP::Packet)' 'perl(Net::DNS)' 'perl(Net::FTP)' 'perl(Net::FTPSSL)' 'perl(Net::LDAP)' 'perl(Net::MQTT::Simple)' 'perl(Net::NTP)' 'perl(Net::SSLeay)' 'perl(Net::Subnet)' 'perl(Net::Telnet)' 'perl(Net::TFTP)' 'perl(openwsman)' 'perl(Pod::Parser)' 'perl(POSIX)' 'perl(Redis)' 'perl(RRDs)' 'perl(SNMP)' 'perl(Socket)' 'perl(Text::CSV)' 'perl(Time::HiRes)' 'perl(URI::Encode)' 'perl(URI::Escape)' 'perl(UUID)' 'perl(WWW::Selenium)' 'perl(XML::LibXML)' 'perl(XML::LibXML::Simple)' 'perl(XML::Simple)' 'perl(XML::XPath)' 'perl(ZMQ::LibZMQ4)' 'perl(Data::UUID)'
dnf clean all
mkdir -p /var/lib/centreon/centplugins/
chmod 777 /var/lib/centreon/centplugins/
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
rm -fr /root/.cpan*
EOF

View File

@ -0,0 +1,54 @@
ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/almalinux:9
RUN bash -e <<EOF
dnf install -y 'dnf-command(config-manager)' epel-release zstd jq
dnf config-manager --set-enabled crb
# Add Centreon plugins repositories
echo -e '[centreon-plugins-stable]\n\
name=centreon plugins stable x86_64\n\
baseurl=https://packages.centreon.com/rpm-plugins/el9/stable/x86_64\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-stable-noarch]\n\
name=centreon plugins stable noarch\n\
baseurl=https://packages.centreon.com/rpm-plugins/el9/stable/noarch\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-testing]\n\
name=centreon plugins testing x86_64\n\
baseurl=https://packages.centreon.com/rpm-plugins/el9/testing/x86_64\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-testing-noarch]\n\
name=centreon plugins testing noarch\n\
baseurl=https://packages.centreon.com/rpm-plugins/el9/testing/noarch\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-unstable]\n\
name=centreon plugins unstable x86_64\n\
baseurl=https://packages.centreon.com/rpm-plugins/el9/unstable/x86_64\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n\
[centreon-plugins-unstable-noarch]\n\
name=centreon plugins unstable noarch\n\
baseurl=https://packages.centreon.com/rpm-plugins/el9/unstable/noarch\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
>> /etc/yum.repos.d/centreon-plugins.repo
dnf install -y make cpan perl-Test2-Suite.noarch 'perl(Authen::Radius)' 'perl(Convert::Binary::C)' 'perl(Crypt::OpenSSL::RSA)' 'perl(Data::Dumper)' 'perl(Date::Parse)' 'perl(DateTime)' 'perl(DateTime::Duration)' 'perl(DateTime-Format-Duration-ISO8601)' 'perl(DateTime::Format::Strptime)' 'perl(DBD::mysql)' 'perl(DBD::ODBC)' 'perl(DBD::Pg)' 'perl(DBD::Sybase)' 'perl(DBI)' 'perl(Device::Modbus::RTU::Client)' 'perl(Device::Modbus::TCP::Client)' 'perl(Digest::CRC)' 'perl(Digest::MD5)' 'perl(Digest::SHA)' 'perl(Email::MIME)' 'perl(Email::Sender)' 'perl(Email::Send::SMTP::Gmail)' 'perl(Email::Simple)' 'perl(File::Basename)' 'perl(Filesys::SmbClient)' 'perl(Hash::Ordered)' 'perl(HTML::Template)' 'perl(IO::Select)' 'perl(IO::Socket)' 'perl(IO::Socket::INET)' 'perl(IO::Socket::INET6)' 'perl(IO::Socket::SSL)' 'perl(JMX::Jmx4Perl)' 'perl(JSON)' 'perl(JSON::Path)' 'perl(JSON::WebToken)' 'perl(JSON::XS)' 'perl(Libssh::Session)' 'perl-Mail-IMAPClient' 'perl(MIME::Base64)' 'perl(MongoDB)' 'perl(NetAddr::IP)' 'perl(Net::DHCP::Constants)' 'perl(Net::DHCP::Packet)' 'perl(Net::DNS)' 'perl(Net::FTP)' 'perl(Net::FTPSSL)' 'perl(Net::LDAP)' 'perl(Net::MQTT::Simple)' 'perl(Net::NTP)' 'perl(Net::SSLeay)' 'perl(Net::Subnet)' 'perl(Net::Telnet)' 'perl(Net::TFTP)' 'perl(openwsman)' 'perl(Pod::Parser)' 'perl(POSIX)' 'perl(Redis)' 'perl(RRDs)' 'perl(SNMP)' 'perl(Socket)' 'perl(Text::CSV)' 'perl(Time::HiRes)' 'perl(URI::Encode)' 'perl(URI::Escape)' 'perl(UUID)' 'perl(WWW::Selenium)' 'perl(XML::LibXML)' 'perl(XML::LibXML::Simple)' 'perl(XML::Simple)' 'perl(XML::XPath)' 'perl(ZMQ::LibZMQ4)' 'perl(Data::UUID)'
dnf clean all
mkdir -p /var/lib/centreon/centplugins/
chmod 777 /var/lib/centreon/centplugins/
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness Test2::Plugin::NoWarnings UUID
rm -fr /root/.cpan*
EOF

View File

@ -0,0 +1,30 @@
ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/debian:bookworm
ENV DEBIAN_FRONTEND noninteractive
# fix locale
RUN bash -e <<EOF
apt-get update
apt-get install -y locales libcurl4-openssl-dev curl wget zstd jq gpg
rm -rf /var/lib/apt/lists/*
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
apt-get clean
EOF
ENV LANG en_US.utf8
RUN bash -e <<EOF
# Add Centreon plugins repositories
echo "deb https://packages.centreon.com/apt-plugins-stable/ bookworm main" | tee /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/apt-plugins-testing/ bookworm main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/apt-plugins-unstable/ bookworm main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
apt-get update
apt-get -y install libtest2-harness-perl libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl perl perl-modules
apt-get clean
EOF

View File

@ -0,0 +1,29 @@
ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/debian:bullseye
ENV DEBIAN_FRONTEND noninteractive
# fix locale
RUN bash -e <<EOF
apt-get update
apt-get install -y locales libcurl4-openssl-dev curl wget zstd jq gpg
rm -rf /var/lib/apt/lists/*
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
apt-get clean
EOF
ENV LANG en_US.utf8
RUN bash -e <<EOF
# Add Centreon plugins repositories
echo "deb https://packages.centreon.com/apt-plugins-stable/ bullseye main" | tee /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/apt-plugins-testing/ bullseye main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/apt-plugins-unstable/ bullseye main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
apt-get update
apt-get -y install gcc make libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl perl perl-modules libdata-uuid-perl
apt-get clean
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
EOF

View File

@ -0,0 +1,34 @@
ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/ubuntu:jammy
ENV DEBIAN_FRONTEND noninteractive
# fix locale
RUN bash -e <<EOF
apt-get update
apt-get install -y locales libcurl4-openssl-dev curl wget zstd jq gpg
rm -rf /var/lib/apt/lists/*
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
apt-get clean
EOF
ENV LANG en_US.utf8
RUN bash -e <<EOF
# Add Centreon plugins repositories
echo "deb https://packages.centreon.com/ubuntu-plugins-stable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/ubuntu-plugins-testing/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
echo "deb https://packages.centreon.com/ubuntu-plugins-unstable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
apt-get update
apt-get -y install libtest2-harness-perl libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjmx4perl-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl libzmq-libzmq4-perl perl perl-modules
apt-get clean
mkdir -p /var/lib/centreon/centplugins/
chmod 777 /var/lib/centreon/centplugins/
EOF

View File

@ -82,7 +82,9 @@ foreach my $plugin (@plugins) {
'centreon/plugins/backend/http/useragent.pm',
'centreon/plugins/alternative/Getopt.pm',
'centreon/plugins/alternative/FatPackerOptions.pm',
'centreon/plugins/passwordmgr/centreonvault.pm',
'centreon/plugins/passwordmgr/environment.pm',
'centreon/plugins/passwordmgr/file.pm',
'centreon/plugins/passwordmgr/hashicorpvault.pm',
'centreon/plugins/passwordmgr/keepass.pm',
'centreon/plugins/passwordmgr/teampass.pm',

View File

@ -8,7 +8,7 @@ if (!@ARGV) {
die "Usage: perl pod_spell_check.t module.pm stopwords.t";
}
my $stopword_filename='tests/resources/spellcheck/stopwords.t';
my $stopword_filename='tests/resources/spellcheck/stopwords.txt';
if(defined($ARGV[1])){
$stopword_filename=$ARGV[1];
}

View File

@ -11,8 +11,8 @@ def get_tests_folders(plugin_name):
pkg_file = open("./packaging/" + plugin_name + "/pkg.json")
packaging = json.load(pkg_file)
for file in packaging["files"]: # loop on "files" array in pkg.json file.
if file.endswith("/") and os.path.exists("tests/robot/" + file): # if this is a directory and there is test for it.
folder_list.append("tests/robot/" + file)
if file.endswith("/") and os.path.exists("tests/" + file): # if this is a directory and there is test for it.
folder_list.append("tests/" + file)
return folder_list
@ -49,7 +49,7 @@ def launch_snmp_sim():
try_command(cmd="mkdir -p /var/lib/snmp/cert_indexes/", error="can't create /var/lib/snmp/cert_indexes/ dir")
try_command(cmd="chown snmp:snmp -R /var/lib/snmp/cert_indexes/", error="can't set cert_indexes folder permissions")
snmpsim_cmd = "snmpsim-command-responder --logging-method=null --agent-udpv4-endpoint=127.0.0.1:2024 --process-user=snmp --process-group=snmp --data-dir='./tests/robot' &"
snmpsim_cmd = "snmpsim-command-responder --logging-method=null --agent-udpv4-endpoint=127.0.0.1:2024 --process-user=snmp --process-group=snmp --data-dir='./tests' &"
try_command(cmd=snmpsim_cmd, error="can't launch snmp sim daemon.")
def refresh_packet_manager(archi):

View File

@ -48,22 +48,22 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.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@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
- uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
with:
file: .github/docker/packaging/Dockerfile.${{ matrix.dockerfile }}
context: .

View File

@ -48,22 +48,22 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.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@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
- uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
with:
file: .github/docker/testing/Dockerfile.testing-plugins-${{ matrix.dockerfile }}
context: .

View File

@ -0,0 +1,67 @@
name: docker-builder-unit-tests
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- develop
paths:
- ".github/workflows/docker-builder-unit-tests.yml"
- ".github/docker/unit-tests/*"
pull_request:
paths:
- ".github/workflows/docker-builder-unit-tests.yml"
- ".github/docker/unit-tests/*"
jobs:
create-and-push-docker:
strategy:
matrix:
include:
- runner: ubuntu-22.04
dockerfile: alma8
image: alma8
- runner: ubuntu-22.04
dockerfile: alma9
image: alma9
- runner: ubuntu-22.04
dockerfile: bullseye
image: bullseye
- runner: ubuntu-22.04
dockerfile: bookworm
image: bookworm
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
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@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
with:
file: .github/docker/unit-tests/Dockerfile.unit-tests-${{ matrix.dockerfile }}
context: .
build-args: "REGISTRY_URL=${{ vars.DOCKER_PROXY_REGISTRY_URL }}"
pull: true
push: true
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/unit-tests-${{ matrix.image }}:latest

View File

@ -26,7 +26,7 @@ jobs:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
@ -132,6 +132,8 @@ jobs:
rpm_provides: "perl(Exporter::Shiny) perl(Exporter::Tiny)"
- name: "FFI::Platypus"
rpm_provides: "perl(FFI::Platypus::Buffer) perl(FFI::Platypus::Memory)"
rpm_dependencies: "perl(Capture::Tiny) perl(FFI::CheckLib) perl(File::Spec::Functions) perl(IPC::Cmd) perl(JSON::PP) perl(List::Util) perl(autodie) perl(constant) perl(parent)"
no-auto-depends: true
- name: "Net::DHCP"
rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)"
- name: "Statistics::Regression"
@ -176,6 +178,23 @@ jobs:
dnf install -y ruby ruby-devel
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: kduret/fpm
ref: fix-rpm-perl-dependency-name-unchanged
path: fpm
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
name: Build and install fpm # waiting https://github.com/jordansissel/fpm/pull/2066
run: |
dnf install -y bsdtar
cd fpm
gem install bundler
bundle install
make install
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file == '' }}
run: |
if [ -z "${{ matrix.version }}" ]; then
@ -187,8 +206,8 @@ jobs:
if [ -z "${{ matrix.rpm_dependencies }}" ]; then
PACKAGE_DEPENDENCIES=""
else
for PACKAGE_DEPENDENCY in `echo ${{ matrix.rpm_dependencies }}`; do
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY"
for PACKAGE_DEPENDENCY in `echo "${{ matrix.rpm_dependencies }}"`; do
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends "$PACKAGE_DEPENDENCY""
done
fi
@ -209,7 +228,6 @@ jobs:
export SYBASE="/usr"
gem install fpm
fpm -s cpan -t ${{ matrix.package_extension }} --rpm-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES$PACKAGE_VERSION ${{ matrix.name }}
shell: bash
@ -233,7 +251,7 @@ jobs:
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }}
path: ./*.${{ matrix.package_extension }}
@ -241,26 +259,30 @@ jobs:
merge-package-rpm-artifacts:
needs: [package-rpm]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [el8, el9]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
- name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
target_name: packages-rpm-${{ matrix.distrib }}
source_paths: packages-rpm-${{ matrix.distrib }}/*.rpm
source_name_pattern: packages-rpm-${{ matrix.distrib }}-
github_token: ${{ secrets.GITHUB_TOKEN }}
name: packages-rpm-${{ matrix.distrib }}
pattern: packages-rpm-${{ matrix.distrib }}-*
delete-merged: false # cannot be set to true due to random fails: Failed to DeleteArtifact: Unable to make request: ECONNRESET
retention-days: 1
- name: Delete merged artifacts
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
with:
name: packages-rpm-${{ matrix.distrib }}-*
failOnError: false
sign-rpm:
needs: [merge-package-rpm-artifacts]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [el8, el9]
@ -278,7 +300,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: packages-rpm-${{ matrix.distrib }}
path: ./
@ -352,7 +374,7 @@ jobs:
"ZMQ::LibZMQ4"
]
include:
- runner_name: ubuntu-22.04
- runner_name: ubuntu-24.04
- arch: amd64
- build_distribs: "bullseye,bookworm,jammy"
- deb_dependencies: ""
@ -463,7 +485,7 @@ jobs:
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}-${{ steps.package-name.outputs.name_with_dash}}
path: ./*.${{ matrix.package_extension }}
@ -471,30 +493,34 @@ jobs:
merge-package-deb-artifacts:
needs: [package-deb]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Merging Artifacts
uses: ./.github/actions/merge-artifacts
- name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
target_name: packages-deb-${{ matrix.distrib }}
source_paths: packages-deb-${{ matrix.distrib }}/*.deb
source_name_pattern: packages-deb-${{ matrix.distrib }}-
github_token: ${{ secrets.GITHUB_TOKEN }}
name: packages-deb-${{ matrix.distrib }}
pattern: packages-deb-${{ matrix.distrib }}-*
delete-merged: false # cannot be set to true due to random fails: Failed to DeleteArtifact: Unable to make request: ECONNRESET
retention-days: 1
- name: Delete merged artifacts
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
with:
name: packages-deb-${{ matrix.distrib }}-*
failOnError: false
download-and-cache-deb:
needs: [merge-package-deb-artifacts]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: packages-deb-${{ matrix.distrib }}
path: ./

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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.distrib }}
path: ./*.rpm

View File

@ -9,6 +9,7 @@ on:
pull_request:
paths:
- '.github/workflows/plugins.yml'
- '.github/scripts/plugins-source.container.pl'
- 'src/**'
- 'packaging/**'
push:
@ -33,7 +34,7 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.9'
@ -82,9 +83,51 @@ jobs:
shell: bash
unit-tests:
needs: [get-environment, get-plugins]
strategy:
fail-fast: false
matrix:
image: [unit-tests-alma8, unit-tests-alma9, unit-tests-bullseye, unit-tests-bookworm]
include:
- runner_name: ubuntu-22.04
- package_extension: rpm
image: unit-tests-alma8
distrib: el8
- package_extension: rpm
image: unit-tests-alma9
distrib: el9
- package_extension: deb
image: unit-tests-bullseye
distrib: bullseye
- package_extension: deb
image: unit-tests-bookworm
distrib: bookworm
runs-on: ${{ matrix.runner_name }}
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run unit tests
uses: ./.github/actions/unit-tests
- name: Upload logs as artifacts if tests failed
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: plugin-installation-${{ matrix.distrib }}
path: /tmp/*.jsonl
retention-days: 1
fatpacker:
if: ${{ needs.get-plugins.outputs.plugins != '' }}
needs: [get-environment, get-plugins]
needs: [get-environment, get-plugins, unit-tests]
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
@ -290,7 +333,7 @@ jobs:
- name: Upload apt/dnf logs as artifacts if tests failed
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: plugin-installation-${{ matrix.distrib }}
path: /var/log/robot-plugins-installation-tests.log

View File

@ -0,0 +1,4 @@
{
"dependencies": [
]
}

View File

@ -0,0 +1,9 @@
{
"pkg_name": "centreon-plugin-Network-Backbox-Restapi",
"pkg_summary": "Centreon Plugin to monitor Backbox using RestAPI",
"plugin_name": "centreon_backbox_restapi.pl",
"files": [
"centreon/plugins/script_custom.pm",
"network/backbox/restapi/"
]
}

View File

@ -0,0 +1,4 @@
{
"dependencies": [
]
}

View File

@ -97,8 +97,7 @@ sub manage_selection {
pagination => {
limit => undef,
start => 0
},
reports => '/technology/management/snmp/communities'
}
};
my $snmp_community_api_results = $options{custom}->request_api(
@ -110,7 +109,7 @@ sub manage_selection {
for my $index (0 .. $#disco_data){
next if (!defined($disco_data[$index]->{hostname}));
if ($snmp_device->{hostname} eq $disco_data[$index]->{hostname}){
$disco_data[$index]->{snmp_community} = $snmp_device->{name}->{data};
$disco_data[$index]->{snmp_community} = $snmp_device->{name};
}
}
}

View File

@ -16,4 +16,20 @@
<critical>a .*?chou.</critical>
</messages>
</dcdiag>
<dcdiag language="it">
<messages>
<global>Inizio test.*?:\s+(.*?)\n.*?(superato|warning|non ha superato)</global>
<ok>superato</ok>
<warning>warning</warning>
<critical>non ha superato</critical>
</messages>
</dcdiag>
<dcdiag language="de">
<messages>
<global>Starting test.*?:\s+(.*?)\n.*?(bestanden|warnung|fehlgeschlagen)</global>
<ok>bestanden</ok>
<warning>warnung</warning>
<critical>fehlgeschlagen</critical>
</messages>
</dcdiag>
</root>

View File

@ -115,6 +115,14 @@ sub read_config {
<critical>non ha superato</critical>
</messages>
</dcdiag>
<dcdiag language="de">
<messages>
<global>Starting test.*?:\s+(.*?)\n.*?(bestanden|warnung|fehlgeschlagen)</global>
<ok>bestanden</ok>
<warning>warnung</warning>
<critical>fehlgeschlagen</critical>
</messages>
</dcdiag>
</root>
END_FILE
@ -237,7 +245,7 @@ Set the language used in config file (default: 'en').
=item B<--dfsr>
Specifies that SysVol replication uses DFS instead of FRS (Windows 2008 or later)
Specifies that SysVol replication uses Distributed File System instead of File Replication Service (Windows 2008 or later)
=item B<--noeventlog>

View File

@ -111,7 +111,7 @@ sub new {
'ps-display' => { name => 'ps_display' },
'filter-vm:s' => { name => 'filter_vm' },
'filter-note:s' => { name => 'filter_note' },
'filter-status:s' => { name => 'filter_status', default => 'running' }
'filter-status:s' => { name => 'filter_status', default => 'Running' }
});
return $self;
@ -218,17 +218,20 @@ sub manage_selection {
foreach my $node (@$decoded) {
if (defined($self->{option_results}->{filter_vm}) && $self->{option_results}->{filter_vm} ne '' &&
$node->{name} !~ /$self->{option_results}->{filter_vm}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter vm.", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_status}) && $self->{option_results}->{filter_status} ne '' &&
$node_vm_state->{ $node->{state} } !~ /$self->{option_results}->{filter_status}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name}
. "': node state " . $node->{state} . " (" . $node_vm_state->{ $node->{state} }
. ") does not match filter /" . $self->{option_results}->{filter_status}
. "/i", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_note}) && $self->{option_results}->{filter_note} ne '' &&
defined($node->{note}) && $node->{note} !~ /$self->{option_results}->{filter_note}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter note.", debug => 1);
next;
}

View File

@ -64,7 +64,6 @@ sub new {
});
$self->{option_results} = {};
$self->{option_msg} = [];
$self->{nodisplay} = 0;

View File

@ -17,7 +17,7 @@
# 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.
#
use strict;
use warnings;

View File

@ -16,7 +16,7 @@
# 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 hardware::ups::standard::rfc1628::snmp::plugin;

View File

@ -0,0 +1,265 @@
#
# 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::backbox::restapi::custom::api;
use strict;
use warnings;
use centreon::plugins::http;
use JSON::XS;
sub new {
my ($class, %options) = @_;
my $self = {};
bless $self, $class;
if (!defined($options{output})) {
print "Class Custom: Need to specify 'output' argument.\n";
exit 3;
}
if (!defined($options{options})) {
$options{output}->add_option_msg(short_msg => "Class Custom: Need to specify 'options' argument.");
$options{output}->option_exit();
}
if (!defined($options{noptions})) {
$options{options}->add_options(arguments => {
'hostname:s' => { name => 'hostname' },
'port:s' => { name => 'port' },
'proto:s' => { name => 'proto' },
'url-path:s' => { name => 'url_path' },
'api-token:s' => { name => 'api_token' },
'timeout:s' => { name => 'timeout' }
});
}
$options{options}->add_help(package => __PACKAGE__, sections => 'REST API OPTIONS', once => 1);
$self->{output} = $options{output};
$self->{http} = centreon::plugins::http->new(%options);
return $self;
}
sub set_options {
my ($self, %options) = @_;
$self->{option_results} = $options{option_results};
}
sub set_defaults {}
sub check_options {
my ($self, %options) = @_;
$self->{hostname} = (defined($self->{option_results}->{hostname})) ? $self->{option_results}->{hostname} : '';
$self->{proto} = (defined($self->{option_results}->{proto})) ? $self->{option_results}->{proto} : 'https';
$self->{port} = (defined($self->{option_results}->{port})) ? $self->{option_results}->{port} : 443;
$self->{url_path} = (defined($self->{option_results}->{url_path})) ? $self->{option_results}->{url_path} : '/rest/data/token/api/';
$self->{api_token} = (defined($self->{option_results}->{api_token})) ? $self->{option_results}->{api_token} : '';
$self->{timeout} = (defined($self->{option_results}->{timeout})) ? $self->{option_results}->{timeout} : 30;
if ($self->{hostname} eq '') {
$self->{output}->add_option_msg(short_msg => 'Need to specify hostname option.');
$self->{output}->option_exit();
}
if ($self->{api_token} eq '') {
$self->{output}->add_option_msg(short_msg => "Need to specify --api-token option.");
$self->{output}->option_exit();
}
return 0;
}
sub get_connection_infos {
my ($self, %options) = @_;
return $self->{hostname} . '_' . $self->{http}->get_port();
}
sub get_hostname {
my ($self, %options) = @_;
return $self->{hostname};
}
sub get_port {
my ($self, %options) = @_;
return $self->{port};
}
sub json_decode {
my ($self, %options) = @_;
$options{content} =~ s/\r//mg;
my $decoded;
eval {
$decoded = JSON::XS->new->utf8->decode($options{content});
};
if ($@) {
$self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@");
$self->{output}->option_exit();
}
return $decoded;
}
sub build_options_for_httplib {
my ($self, %options) = @_;
$self->{option_results}->{hostname} = $self->{hostname};
$self->{option_results}->{port} = $self->{port};
$self->{option_results}->{proto} = $self->{proto};
$self->{option_results}->{timeout} = $self->{timeout};
}
sub settings {
my ($self, %options) = @_;
$self->build_options_for_httplib();
$self->{http}->add_header(key => 'Accept', value => 'application/json');
$self->{http}->set_options(%{$self->{option_results}});
}
sub request {
my ($self, %options) = @_;
my $endpoint = $options{full_endpoint};
if (!defined($endpoint)) {
$endpoint = $self->{url_path} . $options{endpoint};
}
$self->settings();
my $content = $self->{http}->request(
method => 'GET',
url_path => $endpoint,
get_param => $options{get_param},
header => [
'AUTH: ' . $self->{api_token}
],
warning_status => '',
unknown_status => '',
critical_status => ''
);
# Maybe there is an issue with the token. So we retry.
if ($self->{http}->get_code() < 200 || $self->{http}->get_code() >= 300) {
$content = $self->{http}->request(
url_path => $endpoint,
get_param => $options{get_param},
header => [
'AUTH: ' . $self->{api_token}
],
unknown_status => $self->{unknown_http_status},
warning_status => $self->{warning_http_status},
critical_status => $self->{critical_http_status}
);
}
my $decoded = $self->json_decode(content => $content);
if (!defined($decoded)) {
$self->{output}->add_option_msg(short_msg => 'Error while retrieving data (add --debug option for detailed message)');
$self->{output}->option_exit();
}
return $decoded;
}
sub get_backup_jobs_status {
my ($self, %options) = @_;
my $endpoint = 'dashboard/backupStatus';
if (!centreon::plugins::misc::is_empty($options{filter_type})) {
$endpoint .= '/' . $options{filter_type};
}
return $self->request(endpoint => $endpoint);
}
sub get_config_status {
my ($self, %options) = @_;
my $endpoint = 'dashboard/configStatus';
if (!centreon::plugins::misc::is_empty($options{filter_type})) {
$endpoint .= '/' . $options{filter_type};
}
return $self->request(endpoint => $endpoint);
}
sub get_intelli_check_status {
my ($self, %options) = @_;
my $endpoint = 'dashboard/intelliCheckStatus';
if (!centreon::plugins::misc::is_empty($options{filter_type})) {
$endpoint .= '/' . $options{filter_type};
}
if (!centreon::plugins::misc::is_empty($options{report_id})) {
$endpoint .= '/' . $options{report_id};
}
return $self->request(endpoint => $endpoint);
}
1;
__END__
=head1 NAME
Backbox API
=head1 SYNOPSIS
Backbox api
=head1 REST API OPTIONS
=over 8
=item B<--hostname>
API hostname.
=item B<--url-path>
API url path (default: '/rest/token/api')
=item B<--port>
API port (default: 443)
=item B<--proto>
Specify https if needed (default: 'https')
=item B<--api-token>
Set API token
=item B<--timeout>
Set HTTP timeout
=back
=head1 DESCRIPTION
B<custom>.
=cut

View File

@ -0,0 +1,136 @@
#
# 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::backbox::restapi::mode::backup;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub prefix_backup_output {
my ($self, %options) = @_;
return "Backup '" . $options{instance_value}->{name} . "' - ";
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'backups', type => 1, cb_prefix_output => 'prefix_backup_output', message_multiple => 'All backups are ok', skipped_code => { -10 => 1 } },
];
$self->{maps_counters}->{backups} = [
{ label => 'total', nlabel => 'backups.total.count', set => {
key_values => [ { name => 'total' } ],
output_template => 'total: %d',
perfdatas => [
{ value => 'total', template => '%d', min => 0, label_extra_instance => 1 }
]
}
},
{ label => 'success', nlabel => 'backups.success.count', set => {
key_values => [ { name => 'success' }, { name => 'total' } ],
output_template => 'success: %d',
perfdatas => [
{ value => 'success', template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
},
{ label => 'suspect', nlabel => 'backups.suspect.count', set => {
key_values => [ { name => 'suspect' }, { name => 'total' } ],
output_template => 'suspect: %d',
perfdatas => [
{ value => 'suspect', template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
},
{ label => 'failure', nlabel => 'backups.failure.count', set => {
key_values => [ { name => 'failure' }, { name => 'total' } ],
output_template => 'failure: %d',
perfdatas => [
{ value => 'failure', template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
}
];
}
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-type:s' => { name => 'filter_type' }
});
return $self;
}
sub manage_selection {
my ($self, %options) = @_;
my $backups = $options{custom}->get_backup_jobs_status();
for $backups (@$backups) {
$self->{backups}->{$backups->{name}} = {
name => $backups->{name},
total => $backups->{totalDevices},
success => $backups->{successDevices},
suspect => $backups->{suspectDevices},
failure => $backups->{failureDevices}
};
}
}
1;
__END__
=head1 MODE
Check Backbox backups.
=over 8
=item B<--filter-type>
Filter backups by type.
=item B<--warning-failure>
Set warning threshold for 'failure'.
=item B<--critical-failure>
Set critical threshold for 'failure'.
=item B<--warning-suspect>
Set warning threshold for 'suspect'.
=item B<--critical-suspect>
Set critical threshold for 'suspect'.
=back
=cut

View File

@ -0,0 +1,126 @@
#
# 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::backbox::restapi::mode::configstatus;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'config', type => 0 },
];
$self->{maps_counters}->{config} = [
{ label => 'identical', nlabel => 'config.identical.count', set => {
key_values => [ { name => 'identical' } ],
output_template => 'identical: %d',
perfdatas => [
{ value => 'identical', template => '%d', min => 0 }
]
}
},
{ label => 'changed', nlabel => 'config.changed.count', set => {
key_values => [ { name => 'changed' } ],
output_template => 'changed: %d',
perfdatas => [
{ value => 'changed', template => '%d', min => 0 }
]
}
},
{ label => 'na', nlabel => 'config.na.count', set => {
key_values => [ { name => 'na' } ],
output_template => 'n/a: %d',
perfdatas => [
{ value => 'na', template => '%d', min => 0 }
]
}
}
];
}
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-type:s' => { name => 'filter_type' }
});
return $self;
}
sub manage_selection {
my ($self, %options) = @_;
my $config = $options{custom}->get_config_status();
$self->{config} = {
identical => $config->{identical},
changed => $config->{changed},
na => $config->{na}
};
}
1;
__END__
=head1 MODE
Check Backbox configs status.
=over 8
=item B<--filter-type>
Filter configs by type.
=item B<--warning-identical>
Set warning threshold for 'identical'.
=item B<--critical-identical>
Set critical threshold for 'identical'.
=item B<--warning-changed>
Set warning threshold for 'changed'.
=item B<--critical-changed>
Set critical threshold for 'changed'.
=item B<--warning-na>
Set warning threshold for 'n/a'.
=item B<--critical-na>
Set critical threshold for 'n/a'.
=back
=cut

View File

@ -0,0 +1,152 @@
#
# 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::backbox::restapi::mode::intellicheck;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub prefix_intellicheck_output {
my ($self, %options) = @_;
return "Intellicheck " . $options{instance_value}->{id} . " '" . $options{instance_value}->{name} . "' - ";
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'intellichecks', type => 1, cb_prefix_output => 'prefix_intellicheck_output', message_multiple => 'All intellichecks are ok', skipped_code => { -10 => 1 } },
];
$self->{maps_counters}->{intellichecks} = [
{ label => 'total', nlabel => 'intellicheck.total.count', set => {
key_values => [ { name => 'total' } ],
output_template => 'total: %d',
perfdatas => [
{ value => 'total', template => '%d', min => 0, label_extra_instance => 1 }
]
}
},
{ label => 'success', nlabel => 'intellicheck.success.count', set => {
key_values => [ { name => 'success' }, { name => 'total' } ],
output_template => 'success: %d',
perfdatas => [
{ value => 'success', template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
},
{ label => 'suspect', nlabel => 'intellicheck.suspect.count', set => {
key_values => [ { name => 'suspect' }, { name => 'total' } ],
output_template => 'suspect: %d',
perfdatas => [
{ value => 'suspect', template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
},
{ label => 'failure', nlabel => 'intellicheck.failure.count', set => {
key_values => [ { name => 'failure' }, { name => 'total' } ],
output_template => 'failure: %d',
perfdatas => [
{ value => 'failure', template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
}
];
}
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-type:s' => { name => 'filter_type' },
'report-id:s' => { name => 'report_id' }
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
if (!centreon::plugins::misc::is_empty($self->{option_results}->{report_id}) && centreon::plugins::misc::is_empty($self->{option_results}->{filter_type})) {
$self->{output}->add_option_msg(short_msg => "Need to specify --filter-type option.");
$self->{output}->option_exit();
}
}
sub manage_selection {
my ($self, %options) = @_;
my $intellichecks = $options{custom}->get_intelli_check_status();
for $intellichecks (@$intellichecks) {
$self->{intellichecks}->{$intellichecks->{name}} = {
name => $intellichecks->{name},
id => $intellichecks->{id},
success => $intellichecks->{successDevices},
suspect => $intellichecks->{suspectDevices},
failure => $intellichecks->{failureDevices},
total => $intellichecks->{total_devices}
};
}
}
1;
__END__
=head1 MODE
Check Backbox backups.
=over 8
=item B<--filter-type>
Filter backups by type.
=item B<--report-id>
Specify report id.
=item B<--warning-failure>
Set warning threshold for 'failure'.
=item B<--critical-failure>
Set critical threshold for 'failure'.
=item B<--warning-suspect>
Set warning threshold for 'suspect'.
=item B<--critical-suspect>
Set critical threshold for 'suspect'.
=back
=cut

View File

@ -0,0 +1,52 @@
#
# 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::backbox::restapi::plugin;
use strict;
use warnings;
use base qw(centreon::plugins::script_custom);
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$self->{version} = '1.0';
$self->{modes} = {
'backup' => 'network::backbox::restapi::mode::backup',
'configstatus' => 'network::backbox::restapi::mode::configstatus',
'intellicheck' => 'network::backbox::restapi::mode::intellicheck'
};
$self->{custom_modes}->{api} = 'network::backbox::restapi::custom::api';
return $self;
}
1;
__END__
=head1 PLUGIN DESCRIPTION
Check Backbox using Rest API.
=cut

View File

@ -18,4 +18,22 @@
<header_sessionname>SESSION</header_sessionname>
<header_state>^.*?TAT</header_state>
</qwinsta>
<qwinsta language="it">
<created>Totale sessioni create</created>
<disconnected>Totale sessioni disconnesse</disconnected>
<reconnected>Totale sessioni riconnesse</reconnected>
<activestate>Attivo</activestate>
<disconnectedstate>Disc</disconnectedstate>
<header_sessionname>NOMESESSIONE</header_sessionname>
<header_state>STATO</header_state>
</qwinsta>
<qwinsta language="de">
<created>Erstellte Sitzungen gesamt</created>
<disconnected>Getrennte Sitzungen gesamt</disconnected>
<reconnected>Erneut verbundene Sitzungen gesamt</reconnected>
<activestate>Aktiv</activestate>
<disconnectedstate>Getr\.</disconnectedstate>
<header_sessionname>SITZUNGSNAME</header_sessionname>
<header_state>STATUS</header_state>
</qwinsta>
</root>

View File

@ -16,7 +16,7 @@
# 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 snmp_standard::mode::udpcon;
@ -301,7 +301,7 @@ __END__
=head1 MODE
Check udp connections.
Check UDP connections.
=over 8
@ -315,7 +315,7 @@ Critical threshold for total connections.
=item B<--service>
Check udp connections following rules:
Check UDP connections following rules:
tag,[type],[port],[filter-ip],[threshold-warning],[threshold-critical]
Example to test NTP connections on the server: --service="ntp,,123,1,2"
@ -342,7 +342,7 @@ nagios-perfdata - number of connections.
=item B<--application>
Check udp connections of mutiple services:
Check UDP connections of multiple services:
tag,[services],[threshold-warning],[threshold-critical]
Example:

View File

@ -16,7 +16,7 @@
# 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 snmp_standard::mode::uptime;
@ -205,7 +205,7 @@ Display system description.
=item B<--force-oid>
Can choose your oid (numeric format only).
Can choose your OID (numeric format only).
=item B<--check-overload>

View File

@ -54,7 +54,7 @@ sub new {
'critical-http-status:s' => { name => 'critical_http_status' }
});
}
$options{options}->add_help(package => __PACKAGE__, sections => 'HPE PRIMERA API OPTIONS', once => 1);
$options{options}->add_help(package => __PACKAGE__, sections => 'HPE Primera API OPTIONS', once => 1);
$self->{output} = $options{output};
$self->{http} = centreon::plugins::http->new(%options, default_backend => 'curl');

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Check the hosts mode with api custom mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Check the jobs mode with api custom mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Eclipse Mosquitto MQTT plugin tests
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -0,0 +1,41 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}ipfabric.mockoon.json
${CMD} ${CENTREON_PLUGINS} --plugin=apps::ipfabric::plugin
... --api-key=EEECGFCGFCGF
... --mode=discovery
... --http-peer-addr=127.0.0.1
... --proto=http
... --port=3000
... --prettify
*** Test Cases ***
Discovery ${tc}
[Tags] apps api ipfabric
${command} Catenate ${CMD}
... --hostname=${server_name}
${output} Run ${command} | wc -l
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${expected_result}
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n
... values=False
... collapse_spaces=True
Examples: tc server_name expected_result --
... 1 cisco-live02.ipf.cx 5468
... 2 demo1.eu.ipfabric.io 99

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,767 @@
[
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER01",
"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"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER02",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER03",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER04",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"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": true
},
{
"primary_operational_status": "OK",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER06",
"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": true
},
{
"primary_operational_status": "OK",
"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": "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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER08",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER09",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER09",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER10",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER11",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER12",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER13",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER14",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER15",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER16",
"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": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
}
]

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Application Microsoft HyperV 2022
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
@ -13,19 +13,35 @@ ${CMD} ${CENTREON_PLUGINS}
... --command=cat
... --command-path=/usr/bin
... --no-ps
... --command-options=${CURDIR}/nodeintegrationservice-2022.json
*** Test Cases ***
HyperV 2022 ${tc}/3
HyperV 2022-1 ${tc}
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization
${command} Catenate
... ${CMD}
... --command-options=${CURDIR}/nodeintegrationservice-2022-1.json
... --filter-vm='${filter_vm}'
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
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
HyperV 2022-2 ${tc}
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization
${command} Catenate
... ${CMD}
... --command-options=${CURDIR}/nodeintegrationservice-2022-2.json
... --filter-vm='${filter_vm}'
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc filter_vm expected_result --
... 1 ${EMPTY} OK: All integration services are ok
... 2 VSERVER05 OK: VM 'VSERVER05' 0 problem(s) detected - VM 'VSERVER05' 0 problem(s) detected
... 3 VSERVER07 OK: VM 'VSERVER07' 0 problem(s) detected - VM 'VSERVER07' 0 problem(s) detected

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Collections of HTTP Protocol plugin testing a mock of Centreon-web API
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware UPS Sputnik SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
@ -20,7 +20,7 @@ SNMP Collection - Sputnik Environment ${tc}/3
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=apps/protocols/snmp/collection-sputnik
... --config=${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}src/contrib/collection/snmp/sputnik-environment.json
... --config=${CURDIR}${/}..${/}..${/}..${/}..${/}src/contrib/collection/snmp/sputnik-environment.json
Ctn Run Command And Check Result As Strings ${command} ${expected_result}

View File

@ -1,5 +1,5 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon

View File

@ -0,0 +1,51 @@
#!/usr/bin/perl
use strict;
use warnings;
use Test2::V0;
use Test2::Plugin::NoWarnings echo => 1;
use FindBin;
use lib "$FindBin::RealBin/../../../src";
use centreon::plugins::perfdata;
my $perfdata = centreon::plugins::perfdata->new();
###############################################################################
# Testing trim() #
###############################################################################
is($perfdata->trim(' toto '), 'toto');
is($perfdata->trim(' toto'), 'toto');
is($perfdata->trim('toto '), 'toto');
is($perfdata->trim('toto'), 'toto');
is($perfdata->trim(' toto '), 'toto');
is($perfdata->trim(' toto titi '), 'toto titi');
is($perfdata->trim(' toto titi'), 'toto titi');
is($perfdata->trim('toto titi '), 'toto titi');
is($perfdata->trim('toto titi'), 'toto titi');
is($perfdata->trim(' '), '');
is($perfdata->trim(' '), '');
is($perfdata->trim(''), '');
is($perfdata->trim("\ttoto\t"), "toto");
is($perfdata->trim("\t toto"), "toto");
is($perfdata->trim("toto\t "), "toto");
is($perfdata->trim("toto"), "toto");
is($perfdata->trim(" \ttoto \t"), "toto");
is($perfdata->trim("\t toto titi\t "), "toto titi");
is($perfdata->trim(" \ttoto titi"), "toto titi");
is($perfdata->trim("toto\ttiti\t"), "toto\ttiti");
is($perfdata->trim("toto\ttiti"), "toto\ttiti");
is($perfdata->trim("\t"), "");
is($perfdata->trim("\t\t\t\t\t"), "");
is($perfdata->trim(""), "");
###############################################################################
# Testing change_bytes() #
###############################################################################
#is(join('', $perfdata->change_bytes(value => 1024)), '1.00KiB');
#is(join('', $perfdata->change_bytes(value => 1024, network => 1)), '1.02Kb');
done_testing();

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Azure PolicyInsights PolicyStates plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
@ -13,7 +13,7 @@ ${MOCKOON_JSON} ${CURDIR}${/}cloud-azure-policyinsights-policystates.jso
${BASE_URL} http://${HOSTNAME}:${APIPORT}
${LOGIN_ENDPOINT} ${BASE_URL}/login
${CMD} ${CENTREON_PLUGINS} --plugin=cloud::azure::policyinsights::policystates::plugin --subscription=subscription --tenant=tenant --client-id=client_id --client-secret=secret --statefile-dir=/tmp/cache/ --login-endpoint=${LOGIN_ENDPOINT}
${CMD} ${CENTREON_PLUGINS} --plugin=cloud::azure::policyinsights::policystates::plugin --subscription=subscription --tenant=tenant --client-id=client_id --client-secret=secret --statefile-dir=/dev/shm/ --login-endpoint=${LOGIN_ENDPOINT}
&{compliance_value1}
... endpoint=${BASE_URL}/ok

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation VeloCloud REST API Edge Status
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation VeloCloud REST API Edge Status
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Database Mysql plugin
Resource ${CURDIR}${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware Camera Avigilon memory
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware Camera Avigilon storage
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware Camera Avigilon temperature
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation hardware::kvm::avocent::acs::8000::snmp::plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
@ -15,14 +15,14 @@ Cpu-Detailed
[Documentation] cpu-detailed mode
[Tags] hardware kvm avocent cpu snmp
Remove File /dev/shm/snmpstandard_127.0.0.1_2024_cpu-detailed*
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/tmp/cache/
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: CPU Usage: user : Buffer creation, nice : Buffer creation, system : Buffer creation, idle : Buffer creation, wait : Buffer creation, kernel : Buffer creation, interrupt : Buffer creation, softirq : Buffer creation, steal : Buffer creation, guest : Buffer creation, guestnice : Buffer creation
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/tmp/cache/
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Remove File /dev/shm/snmpstandard_127.0.0.1_2024_cpu-detailed*
Should Be Equal As Strings
@ -67,14 +67,14 @@ Serial Ports
[Documentation] serial-ports mode
[Tags] hardware kvm avocent serial snmp
Remove File /dev/shm/avocent_acs_8000_127.0.0.1_2024_serial-ports*
${output} Run Avocent 8000 Plugin "serial-ports" --statefile-dir=/tmp/cache/
${output} Run Avocent 8000 Plugin "serial-ports" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: All serial ports are ok
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
${output} Run Avocent 8000 Plugin "serial-ports" --statefile-dir=/tmp/cache/
${output} Run Avocent 8000 Plugin "serial-ports" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Remove File /dev/shm/avocent_acs_8000_127.0.0.1_2024_serial-ports*
Should Be Equal As Strings

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware Sensors APC SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware UPS Sputnik SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware UPS Socomec Netvision SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Hardware UPS standard SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Network Aruba Instant SNMP plugin - AP Usage
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -0,0 +1,158 @@
{
"uuid": "adb51fea-62b9-4e06-87dc-13d2b21bd3d8",
"lastMigration": 32,
"name": "Backbox",
"endpointPrefix": "",
"latency": 0,
"port": 3000,
"hostname": "",
"folders": [],
"routes": [
{
"uuid": "9276ab2a-9101-46fd-ab5b-445ba5198ba7",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "rest/data/token/api/dashboard/backupStatus",
"responses": [
{
"uuid": "970b8727-a9c3-48ca-b022-1dc13aeacf11",
"body": "[\n {\n \"name\": \"All\",\n \"successDevices\": 0,\n \"suspectDevices\": 1,\n \"failureDevices\": 4,\n \"totalDevices\": 5\n },\n {\n \"name\": \"Backup1\",\n \"successDevices\": 1,\n \"suspectDevices\": 2,\n \"failureDevices\": 3,\n \"totalDevices\": 6\n }\n]",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": true,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
},
{
"uuid": "fe7039c5-f27e-41ce-8c17-2cc25d4a7820",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "rest/data/token/api/dashboard/configStatus",
"responses": [
{
"uuid": "bb3d0a3a-c0d1-4788-82ae-f4bc7f1957ea",
"body": "{\n \"identical\": 3,\n \"changed\": 4,\n \"na\": 5\n}",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": true,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
},
{
"uuid": "101f818e-0ef5-4468-8c2a-f0f7ab2f1d49",
"type": "http",
"documentation": "",
"method": "get",
"endpoint": "rest/data/token/api/dashboard/intelliCheckStatus",
"responses": [
{
"uuid": "64d99a57-49cf-4ce0-8e89-70c76263bd9e",
"body": "[\n {\n \"successDevices\":3,\n \"suspectDevices\":4,\n \"failureDevices\":5,\n \"Name\":\"All\",\n \"ID\":0,\n \"total_devices\":12,\n \"id\":0,\n \"name\":\"All\"\n },\n {\n \"successDevices\":5,\n \"suspectDevices\":4,\n \"failureDevices\":3,\n \"Name\":\"IntelliCheck1\",\n \"ID\":0,\n \"total_devices\":12,\n \"id\":0,\n \"name\":\"IntelliCheck1\"\n }\n]",
"latency": 0,
"statusCode": 200,
"label": "",
"headers": [],
"bodyType": "INLINE",
"filePath": "",
"databucketID": "",
"sendFileAsBody": false,
"rules": [],
"rulesOperator": "OR",
"disableTemplating": false,
"fallbackTo404": false,
"default": true,
"crudKey": "id",
"callbacks": []
}
],
"responseMode": null
}
],
"rootChildren": [
{
"type": "route",
"uuid": "9276ab2a-9101-46fd-ab5b-445ba5198ba7"
},
{
"type": "route",
"uuid": "fe7039c5-f27e-41ce-8c17-2cc25d4a7820"
},
{
"type": "route",
"uuid": "101f818e-0ef5-4468-8c2a-f0f7ab2f1d49"
}
],
"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": [],
"callbacks": []
}

View File

@ -0,0 +1,42 @@
*** Settings ***
Documentation Check the backup status
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}backbox.json
${cmd} ${CENTREON_PLUGINS}
... --plugin=network::backbox::restapi::plugin
... --custommode=api
... --hostname=${HOSTNAME}
... --port=${APIPORT}
... --proto=http
... --api-token=token
*** Test Cases ***
backups ${tc}
[Documentation] Check the backups status
[Tags] network backbox restapi backup
${command} Catenate
... ${cmd}
... --mode=backup
... ${extraoptions}
Log ${cmd}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extraoptions expected_result --
... 1 ${EMPTY} OK: All backups are ok | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;;;0;5 'All#backups.failure.count'=4;;;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;;;0;6 'Backup1#backups.failure.count'=3;;;0;6
... 2 --warning-failure=3 WARNING: Backup 'All' - failure: 4 | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;;;0;5 'All#backups.failure.count'=4;0:3;;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;;;0;6 'Backup1#backups.failure.count'=3;0:3;;0;6
... 3 --critical-failure=3 CRITICAL: Backup 'All' - failure: 4 | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;;;0;5 'All#backups.failure.count'=4;;0:3;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;;;0;6 'Backup1#backups.failure.count'=3;;0:3;0;6
... 4 --warning-failure=2 WARNING: Backup 'All' - failure: 4 - Backup 'Backup1' - failure: 3 | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;;;0;5 'All#backups.failure.count'=4;0:2;;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;;;0;6 'Backup1#backups.failure.count'=3;0:2;;0;6
... 5 --critical-failure=2 CRITICAL: Backup 'All' - failure: 4 - Backup 'Backup1' - failure: 3 | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;;;0;5 'All#backups.failure.count'=4;;0:2;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;;;0;6 'Backup1#backups.failure.count'=3;;0:2;0;6
... 6 --warning-suspect=1 WARNING: Backup 'Backup1' - suspect: 2 | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;0:1;;0;5 'All#backups.failure.count'=4;;;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;0:1;;0;6 'Backup1#backups.failure.count'=3;;;0;6
... 7 --critical-suspect=1 CRITICAL: Backup 'Backup1' - suspect: 2 | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;;0:1;0;5 'All#backups.failure.count'=4;;;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;;0:1;0;6 'Backup1#backups.failure.count'=3;;;0;6
... 8 --filter-type=1 OK: All backups are ok | 'All#backups.total.count'=5;;;0; 'All#backups.success.count'=0;;;0;5 'All#backups.suspect.count'=1;;;0;5 'All#backups.failure.count'=4;;;0;5 'Backup1#backups.total.count'=6;;;0; 'Backup1#backups.success.count'=1;;;0;6 'Backup1#backups.suspect.count'=2;;;0;6 'Backup1#backups.failure.count'=3;;;0;6

View File

@ -0,0 +1,42 @@
*** Settings ***
Documentation Check the config status
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}backbox.json
${cmd} ${CENTREON_PLUGINS}
... --plugin=network::backbox::restapi::plugin
... --custommode=api
... --hostname=${HOSTNAME}
... --port=${APIPORT}
... --proto=http
... --api-token=token
... --mode=configstatus
*** Test Cases ***
configstatus ${tc}
[Documentation] Check the config status
[Tags] network backbox restapi configstatus
${command} Catenate
... ${cmd}
... ${extraoptions}
Log ${cmd}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extraoptions expected_result --
... 1 ${EMPTY} OK: identical: 3, changed: 4, n/a: 5 | 'config.identical.count'=3;;;0; 'config.changed.count'=4;;;0; 'config.na.count'=5;;;0;
... 2 --warning-identical=2 WARNING: identical: 3 | 'config.identical.count'=3;0:2;;0; 'config.changed.count'=4;;;0; 'config.na.count'=5;;;0;
... 3 --critical-identical=2 CRITICAL: identical: 3 | 'config.identical.count'=3;;0:2;0; 'config.changed.count'=4;;;0; 'config.na.count'=5;;;0;
... 4 --warning-changed=2 WARNING: changed: 4 | 'config.identical.count'=3;;;0; 'config.changed.count'=4;0:2;;0; 'config.na.count'=5;;;0;
... 5 --critical-changed=2 CRITICAL: changed: 4 | 'config.identical.count'=3;;;0; 'config.changed.count'=4;;0:2;0; 'config.na.count'=5;;;0;
... 6 --warning-na=2 WARNING: n/a: 5 | 'config.identical.count'=3;;;0; 'config.changed.count'=4;;;0; 'config.na.count'=5;0:2;;0;
... 7 --critical-na=2 CRITICAL: n/a: 5 | 'config.identical.count'=3;;;0; 'config.changed.count'=4;;;0; 'config.na.count'=5;;0:2;0;
... 8 --filter-type=1 OK: identical: 3, changed: 4, n/a: 5 | 'config.identical.count'=3;;;0; 'config.changed.count'=4;;;0; 'config.na.count'=5;;;0;

View File

@ -0,0 +1,44 @@
*** Settings ***
Documentation Check the intellichecks status
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}backbox.json
${cmd} ${CENTREON_PLUGINS}
... --plugin=network::backbox::restapi::plugin
... --custommode=api
... --hostname=${HOSTNAME}
... --port=${APIPORT}
... --proto=http
... --api-token=token
... --mode=intellicheck
*** Test Cases ***
intellichecks ${tc}
[Documentation] Check the intellichecks status
[Tags] network backbox restapi intellicheck
${command} Catenate
... ${cmd}
... ${extraoptions}
Log ${cmd}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extraoptions expected_result --
... 1 ${EMPTY} OK: All intellichecks are ok | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;;0;12 'All#intellicheck.failure.count'=5;;;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;;;0;12
... 2 --warning-failure=3 WARNING: Intellicheck 0 'All' - failure: 5 | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;;0;12 'All#intellicheck.failure.count'=5;0:3;;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;0:3;;0;12
... 3 --critical-failure=3 CRITICAL: Intellicheck 0 'All' - failure: 5 | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;;0;12 'All#intellicheck.failure.count'=5;;0:3;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;;0:3;0;12
... 4 --warning-failure=2 WARNING: Intellicheck 0 'All' - failure: 5 - Intellicheck 0 'IntelliCheck1' - failure: 3 | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;;0;12 'All#intellicheck.failure.count'=5;0:2;;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;0:2;;0;12
... 5 --critical-failure=2 CRITICAL: Intellicheck 0 'All' - failure: 5 - Intellicheck 0 'IntelliCheck1' - failure: 3 | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;;0;12 'All#intellicheck.failure.count'=5;;0:2;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;;0:2;0;12
... 6 --warning-suspect=1 WARNING: Intellicheck 0 'All' - suspect: 4 - Intellicheck 0 'IntelliCheck1' - suspect: 4 | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;0:1;;0;12 'All#intellicheck.failure.count'=5;;;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;0:1;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;;;0;12
... 7 --critical-suspect=1 CRITICAL: Intellicheck 0 'All' - suspect: 4 - Intellicheck 0 'IntelliCheck1' - suspect: 4 | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;0:1;0;12 'All#intellicheck.failure.count'=5;;;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;0:1;0;12 'IntelliCheck1#intellicheck.failure.count'=3;;;0;12
... 8 --filter-type=1 OK: All intellichecks are ok | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;;0;12 'All#intellicheck.failure.count'=5;;;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;;;0;12
... 9 --report-id=1 UNKNOWN: Need to specify --filter-type option.
... 10 --filter-type=1 --report-id=1 OK: All intellichecks are ok | 'All#intellicheck.total.count'=12;;;0; 'All#intellicheck.success.count'=3;;;0;12 'All#intellicheck.suspect.count'=4;;;0;12 'All#intellicheck.failure.count'=5;;;0;12 'IntelliCheck1#intellicheck.total.count'=12;;;0; 'IntelliCheck1#intellicheck.success.count'=5;;;0;12 'IntelliCheck1#intellicheck.suspect.count'=4;;;0;12 'IntelliCheck1#intellicheck.failure.count'=3;;;0;12

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Meraki VPN Tunnels
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Network citrix netscaler health
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Network Fortinet Fortigate SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Network Teldat SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Network Teldat SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Network Teldat SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -1,7 +1,7 @@
*** Settings ***
Documentation Linux Local list-systemdservices
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

View File

@ -2,7 +2,7 @@
Documentation Linux Local Systemd-sc-status
# systemd changed the output format of the command starting from version 252, so we need to check for a systemd version and use the correct parameter.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s

Some files were not shown because too many files have changed in this diff Show More