diff --git a/.github/actions/deb-delivery-legacy/action.yml b/.github/actions/deb-delivery-legacy/action.yml new file mode 100644 index 000000000..00cba4df8 --- /dev/null +++ b/.github/actions/deb-delivery-legacy/action.yml @@ -0,0 +1,46 @@ +name: "deb-delivery-legacy" +description: "Deliver legacy DEB packages" +inputs: + distrib: + description: "The distribution used for packaging" + required: true + major_version: + description: "The major version" + required: true + nexus_username: + description: The nexus username + required: true + nexus_password: + description: The nexus password + required: true + cache_key: + description: "The cached package key" + required: true + stability: + description: "The package stability (stable, testing, unstable)" + required: true + +runs: + using: "composite" + steps: + - name: Use cache DEB files + uses: actions/cache@v3 + with: + path: ./*.deb + key: ${{ inputs.cache_key }} + + - name: Publish DEBs to Nexus + run: | + echo "Delivering to ${{ inputs.major_version }} ${{ inputs.stability }}" + + FOLDER_SUFFIX="-${{ inputs.stability }}" + if [[ "${{ inputs.stability }}" == "stable" ]]; then + FOLDER_SUFFIX="" + fi + + for FILE in *.deb; do + sleep 2 + echo "Delivering $FILE" + curl --connect-timeout 10 --retry 2 --retry-max-time 30 --fail --silent --show-error -u '${{ inputs.nexus_username }}':'${{ inputs.nexus_password }}' -H 'Content-Type: multipart/form-data' --data-binary "@./$FILE" https://apt.centreon.com/repository/${{ inputs.major_version }}$FOLDER_SUFFIX/ || echo "::error::Fail to deliver $FILE ${{ inputs.major_version }}" + done + shell: bash diff --git a/.github/actions/deb-delivery/action.yml b/.github/actions/deb-delivery/action.yml index 892338fe7..6d57f6f98 100644 --- a/.github/actions/deb-delivery/action.yml +++ b/.github/actions/deb-delivery/action.yml @@ -1,5 +1,5 @@ -name: "deb-package" -description: "Package DEB Centreon" +name: "deb-delivery" +description: "Deliver DEB packages" inputs: distrib: description: "The distribution used for packaging" @@ -38,17 +38,3 @@ runs: run: | jf rt upload "*.deb" "apt-plugins-${{ inputs.stability }}/pool/" --deb "${{ inputs.distrib }}/main/all" shell: bash - - - name: Publish DEBs to Nexus - run: | - for MAJOR in "22.04" "22.10"; do - echo "Delivering to $MAJOR ${{ inputs.stability }}" - - FOLDER_SUFFIX="-${{ inputs.stability }}" - if [[ "${{ inputs.stability }}" == "stable" ]]; then - FOLDER_SUFFIX="" - fi - - find -name "*.deb" -print0 | xargs -0 -t -I % -P 2 sh -c "curl --connect-timeout 10 --retry 2 --retry-max-time 30 --fail --silent --show-error -u '${{ inputs.nexus_username }}':'${{ inputs.nexus_password }}' -H 'Content-Type: multipart/form-data' --data-binary '@%' https://apt.centreon.com/repository/$MAJOR$FOLDER_SUFFIX/ >/dev/null || exit 255" || break - done - shell: bash diff --git a/.github/actions/rpm-delivery-legacy/action.yml b/.github/actions/rpm-delivery-legacy/action.yml new file mode 100644 index 000000000..dba196186 --- /dev/null +++ b/.github/actions/rpm-delivery-legacy/action.yml @@ -0,0 +1,96 @@ +name: "rpm-delivery-legacy" +description: "rpm delivery in legacy repositories" +inputs: + module_name: + description: "The package module name" + required: true + major_version: + description: "The major version" + required: true + distrib: + description: "The distribution used for packaging" + required: true + cache_key: + description: "The cached package key" + required: true + yum_repo_url: + description: "The legacy yum repo url" + required: true + update_repo_path: + description: "The update repo script path" + required: true + cloudfront_id: + description: "The cloudfront ID for repo url" + required: true + yum_repo_address: + description: "The legacy yum repo address" + required: true + yum_repo_key: + description: "The repo key" + required: true + stability: + description: "The package stability (stable, testing, unstable)" + required: true + +runs: + using: "composite" + steps: + - name: Use cache RPM files + uses: actions/cache@v3 + with: + path: ./*.rpm + key: ${{ inputs.cache_key }} + + - name: Setup awscli + run: | + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + sudo unzip -q awscliv2.zip + sudo ./aws/install + shell: bash + + - name: Publish RPMs to standard repositories + run: | + FILES="*.rpm" + + REPOTYPE="${{ inputs.stability }}" + PROJECT_PATH="standard" + DISTRIB="${{ inputs.distrib }}" + ARCH="noarch" + + eval `ssh-agent` + ssh-add - <<< "${{ inputs.yum_repo_key }}" + + echo "Delivering to ${{ inputs.major_version }} $REPOTYPE" + + if [ "$REPOTYPE" == "stable" ]; then + TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/${{ inputs.major_version }}/$DISTRIB/$REPOTYPE/$ARCH/RPMS" + else + TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/${{ inputs.major_version }}/$DISTRIB/$REPOTYPE/$ARCH/${{ inputs.module_name }}" + PROJECT_LOCATION="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/${{ inputs.major_version }}/$DISTRIB/$REPOTYPE/$ARCH/${{ inputs.module_name }}" + fi + + echo "[DEBUG] - Target : $TARGET" + echo "[DEBUG] - PROJECT_LOCATION : $PROJECT_LOCATION" + + ssh -o StrictHostKeyChecking=no "${{ inputs.yum_repo_address }}" mkdir -p "$TARGET" + scp -o StrictHostKeyChecking=no ./*.rpm "${{ inputs.yum_repo_address }}:$TARGET" + + # Update repository metadata + METADATAS="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/${{ inputs.major_version }}/$DISTRIB/$REPOTYPE/$ARCH" + sleep $((RANDOM % 120)) # wait random time to avoid simultaneous createrepo + ssh -o StrictHostKeyChecking=no "${{ inputs.yum_repo_address }}" "sh "${{ inputs.update_repo_path }}" $METADATAS" 2>&- + + # Invalidate cloudfront cache + ID="${{ inputs.cloudfront_id }}" + PATHS="/$PROJECT_PATH/${{ inputs.major_version }}/$DISTRIB/$REPOTYPE/$ARCH/*" + ITERATIONS=1 + + until aws cloudfront create-invalidation --distribution-id "$ID" --paths "$PATHS"; do + if [ ${ITERATIONS} -eq 10 ]; then + return 0 + fi + echo "couldn't invalidate cache, AWS quota might have been reached, retrying in 30 seconds..." + sleep 30s + ITERATIONS=$((ITERATIONS+1)) + done + shell: bash diff --git a/.github/actions/rpm-delivery/action.yml b/.github/actions/rpm-delivery/action.yml index fcddf4e84..99b16e438 100644 --- a/.github/actions/rpm-delivery/action.yml +++ b/.github/actions/rpm-delivery/action.yml @@ -10,21 +10,6 @@ inputs: cache_key: description: "The cached package key" required: true - yum_repo_url: - description: "The legacy yum repo url" - required: true - update_repo_path: - description: "The update repo script path" - required: true - cloudfront_id: - description: "The cloudfront ID for repo url" - required: true - yum_repo_address: - description: "The legacy yum repo address" - required: true - yum_repo_key: - description: "The repo key" - required: true stability: description: "The package stability (stable, testing, unstable)" required: true @@ -84,60 +69,3 @@ runs: fi done shell: bash - - - name: Setup awscli - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - sudo unzip -q awscliv2.zip - sudo ./aws/install - shell: bash - - - name: Publish RPMs to standard repositories - run: | - FILES="*.rpm" - - REPOTYPE="${{ inputs.stability }}" - PROJECT_PATH="standard" - DISTRIB="${{ inputs.distrib }}" - ARCH="noarch" - - eval `ssh-agent` - ssh-add - <<< "${{ inputs.yum_repo_key }}" - - for MAJOR in "21.10" "22.04" "22.10"; do - echo "::group::Delivering to $MAJOR $REPOTYPE" - - if [ "$REPOTYPE" == "stable" ]; then - TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/RPMS" - else - TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/${{ inputs.module_name }}" - PROJECT_LOCATION="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/${{ inputs.module_name }}" - fi - - echo "[DEBUG] - Target : $TARGET" - echo "[DEBUG] - PROJECT_LOCATION : $PROJECT_LOCATION" - - ssh -o StrictHostKeyChecking=no "${{ inputs.yum_repo_address }}" mkdir -p "$TARGET" - scp -o StrictHostKeyChecking=no ./*.rpm "${{ inputs.yum_repo_address }}:$TARGET" - - # Update repository metadata - METADATAS="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH" - ssh -o StrictHostKeyChecking=no "${{ inputs.yum_repo_address }}" "sh "${{ inputs.update_repo_path }}" $METADATAS" 2>&- - - # Invalidate cloudfront cache - ID="${{ inputs.cloudfront_id }}" - PATHS="/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/*" - ITERATIONS=1 - - until aws cloudfront create-invalidation --distribution-id "$ID" --paths "$PATHS"; do - if [ ${ITERATIONS} -eq 10 ]; then - return 0 - fi - echo "couldn't invalidate cache, AWS quota might have been reached, retrying in 30 seconds..." - sleep 30s - ITERATIONS=$((ITERATIONS+1)) - done - - echo "::endgroup::" - done - shell: bash diff --git a/.github/docker/Dockerfile.packaging-plugins-alma8 b/.github/docker/Dockerfile.packaging-plugins-alma8 index 5e162edb8..5337a9edb 100644 --- a/.github/docker/Dockerfile.packaging-plugins-alma8 +++ b/.github/docker/Dockerfile.packaging-plugins-alma8 @@ -2,9 +2,15 @@ ARG REGISTRY_URL FROM ${REGISTRY_URL}/almalinux:8 -RUN <<EOF +RUN bash -e <<EOF -dnf -y install git gettext rpm-build dos2unix python3 epel-release +echo '[goreleaser] +name=GoReleaser +baseurl=https://repo.goreleaser.com/yum/ +enabled=1 +gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo + +dnf -y install git gettext rpm-build dos2unix python3 epel-release nfpm zstd dnf -y install perl-App-cpanminus perl-JSON cpanm App::FatPacker cpanm File::Copy::Recursive diff --git a/.github/docker/Dockerfile.packaging-plugins-alma9 b/.github/docker/Dockerfile.packaging-plugins-alma9 index e905349bb..458541df3 100644 --- a/.github/docker/Dockerfile.packaging-plugins-alma9 +++ b/.github/docker/Dockerfile.packaging-plugins-alma9 @@ -2,9 +2,15 @@ ARG REGISTRY_URL FROM ${REGISTRY_URL}/almalinux:9 -RUN <<EOF +RUN bash -e <<EOF -dnf -y install git gettext rpm-build dos2unix python3 epel-release +echo '[goreleaser] +name=GoReleaser +baseurl=https://repo.goreleaser.com/yum/ +enabled=1 +gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo + +dnf -y install git gettext rpm-build dos2unix python3 epel-release nfpm zstd dnf -y install perl-App-cpanminus perl-JSON cpanm App::FatPacker cpanm File::Copy::Recursive diff --git a/.github/docker/Dockerfile.packaging-plugins-bullseye b/.github/docker/Dockerfile.packaging-plugins-bullseye index 06134181e..86136321a 100644 --- a/.github/docker/Dockerfile.packaging-plugins-bullseye +++ b/.github/docker/Dockerfile.packaging-plugins-bullseye @@ -2,8 +2,10 @@ ARG REGISTRY_URL FROM ${REGISTRY_URL}/debian:bullseye +ENV DEBIAN_FRONTEND noninteractive + # fix locale -RUN <<EOF +RUN bash -e <<EOF apt-get update apt-get install -y locales @@ -15,12 +17,14 @@ EOF ENV LANG en_US.utf8 -RUN <<EOF +RUN bash -e <<EOF apt-get update + apt-get install -y \ dh-make \ aptitude \ + ca-certificates \ lintian \ pbuilder \ quilt \ @@ -34,7 +38,13 @@ apt-get install -y \ libjson-perl \ libapp-fatpacker-perl \ libfile-copy-recursive-perl \ - jq + jq \ + zstd + +echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list +apt-get update +apt-get install -y nfpm + apt-get clean EOF diff --git a/.github/docker/Dockerfile.packaging-plugins-centos7 b/.github/docker/Dockerfile.packaging-plugins-centos7 index 4a56e1a8a..b43fc6571 100644 --- a/.github/docker/Dockerfile.packaging-plugins-centos7 +++ b/.github/docker/Dockerfile.packaging-plugins-centos7 @@ -2,9 +2,15 @@ ARG REGISTRY_URL FROM ${REGISTRY_URL}/centos:7 -RUN <<EOF +RUN bash -e <<EOF -yum -y install git gettext rpm-build dos2unix python3 epel-release +echo '[goreleaser] +name=GoReleaser +baseurl=https://repo.goreleaser.com/yum/ +enabled=1 +gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo + +yum -y install git gettext rpm-build dos2unix python3 epel-release nfpm zstd yum -y install perl-App-FatPacker perl-File-Copy-Recursive perl-JSON yum clean all diff --git a/.github/workflows/connector-vmware.yml b/.github/workflows/connector-vmware.yml new file mode 100644 index 000000000..6afd589d3 --- /dev/null +++ b/.github/workflows/connector-vmware.yml @@ -0,0 +1,102 @@ +name: connector-vmware + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + workflow_dispatch: + pull_request: + paths: + - 'connectors/vmware/src/**' + - 'connectors/vmware/packaging/**' + push: + branches: + - develop + - master + paths: + - 'connectors/vmware/src/**' + - 'connectors/vmware/packaging/**' + tags: + - centreon-connector-vmware-* + +jobs: + get-environment: + uses: ./.github/workflows/get-environment.yml + with: + version_file: connectors/vmware/src/centreon/script/centreon_vmware.pm + + package: + needs: + - get-environment + strategy: + matrix: + include: + - package_extension: rpm + image: packaging-plugins-alma8 + distrib: el8 + - package_extension: rpm + image: packaging-plugins-alma9 + distrib: el9 + - package_extension: deb + image: packaging-plugins-bullseye + distrib: bullseye + name: package ${{ matrix.distrib }} + + uses: ./.github/workflows/package.yml + with: + nfpm_file_pattern: "connectors/vmware/packaging/centreon-plugin-virtualization-vmware-daemon.yaml" + distrib: ${{ matrix.distrib }} + package_extension: ${{ matrix.package_extension }} + image_name: ${{ matrix.image }} + version: ${{ needs.get-environment.outputs.version }} + release: ${{ needs.get-environment.outputs.release }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} + secrets: inherit + + deliver-rpm: + needs: + - get-environment + - package + if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} + runs-on: [self-hosted, common] + + strategy: + matrix: + distrib: [el8, el9] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Delivery + uses: ./.github/actions/rpm-delivery + with: + module_name: connector-vmware + distrib: ${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} + stability: ${{ needs.get-environment.outputs.stability }} + artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} + + deliver-deb: + needs: + - get-environment + - package + if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} + runs-on: [self-hosted, common] + + strategy: + matrix: + distrib: [bullseye] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Delivery + uses: ./.github/actions/deb-delivery + with: + distrib: ${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} + stability: ${{ needs.get-environment.outputs.stability }} + artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} diff --git a/.github/workflows/get-environment.yml b/.github/workflows/get-environment.yml index 359f3e8f7..fe41e6e73 100644 --- a/.github/workflows/get-environment.yml +++ b/.github/workflows/get-environment.yml @@ -1,5 +1,9 @@ on: workflow_call: + inputs: + version_file: + required: false + type: string outputs: stability: description: "branch stability (stable, testing, unstable, canary)" @@ -20,6 +24,9 @@ jobs: release: ${{ steps.get_environment.outputs.release }} steps: + - name: Checkout sources + uses: actions/checkout@v3 + - id: get_environment run: | if [[ -z "$GITHUB_HEAD_REF" ]]; then @@ -45,9 +52,13 @@ jobs: echo "stability=$STABILITY" >> $GITHUB_OUTPUT - VERSION=`date '+%Y%m%d'` + if [[ "${{ inputs.version_file }}" == "" ]]; then + VERSION=$(date '+%Y%m%d') + else + VERSION=$(grep VERSION ${{ inputs.version_file }} | cut -d "'" -f 2) + fi echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT - RELEASE=`date '+%H%M%S'` + RELEASE=$(date '+%H%M%S') echo "release=$(echo $RELEASE)" >> $GITHUB_OUTPUT shell: bash diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 000000000..aef00f0ce --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,117 @@ +on: + workflow_call: + inputs: + nfpm_file_pattern: + type: string + description: The pattern of the nfpm configuration file(s) + required: true + distrib: + type: string + description: The distrib + required: true + package_extension: + type: string + description: The package extension (deb or rpm) + required: true + image_name: + type: string + description: The image name + required: true + version: + type: string + description: The package version + required: false + release: + type: string + description: The release number + required: false + source_cache_key: + type: string + description: The source files cache key + required: false + source_cache_path: + type: string + description: The source files path + required: false + cache_key: + type: string + description: The package files cache key + required: true + +jobs: + package: + runs-on: ubuntu-22.04 + container: + image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ inputs.image_name }} + credentials: + username: ${{ secrets.DOCKER_REGISTRY_ID }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Import gpg key + env: + RPM_GPG_SIGNING_KEY: ${{ secrets.RPM_GPG_SIGNING_KEY }} + run: echo -n "$RPM_GPG_SIGNING_KEY" > key.gpg + shell: bash + + - if: ${{ inputs.source_cache_key != '' && inputs.source_cache_path != '' }} + name: Import source files + uses: actions/cache/restore@v3 + with: + path: ${{ inputs.source_cache_path }} + key: ${{ inputs.source_cache_key }} + fail-on-cache-miss: true + + - name: Build ${{ inputs.package_extension }} files + env: + RPM_GPG_SIGNING_KEY_ID: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }} + RPM_GPG_SIGNING_PASSPHRASE: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} + run: | + export VERSION="${{ inputs.version }}" + export RELEASE="${{ inputs.release }}" + + if [ "${{ inputs.package_extension }}" = "rpm" ]; then + export DIST=".${{ inputs.distrib }}" + export APACHE_USER="apache" + export APACHE_GROUP="apache" + else + export DIST="" + export APACHE_USER="www-data" + export APACHE_GROUP="www-data" + fi + + export PERL_SITELIB="$(eval "$(perl -V:installsitelib)"; echo $installsitelib)" + export PERL_VENDORLIB="$(eval "$(perl -V:installvendorlib)"; echo $installvendorlib)" + + export RPM_SIGNING_KEY_FILE="$(pwd)/key.gpg" + export RPM_SIGNING_KEY_ID="$RPM_GPG_SIGNING_KEY_ID" + export NFPM_RPM_PASSPHRASE="$RPM_GPG_SIGNING_PASSPHRASE" + + for FILE in ${{ inputs.nfpm_file_pattern }}; do + DIRNAME=$(dirname $FILE) + BASENAME=$(basename $FILE) + cd $DIRNAME + sed -i \ + "s/@COMMIT_HASH@/${{ github.sha }}/g; s#@PERL_SITELIB@#${PERL_SITELIB}#g; s#@PERL_VENDORLIB@#${PERL_VENDORLIB}#g" \ + $BASENAME + nfpm package --config $BASENAME --packager ${{ inputs.package_extension }} + cd - + mv $DIRNAME/*.${{ inputs.package_extension }} ./ + done + shell: bash + + - name: Upload package artifacts + uses: actions/upload-artifact@v3 + with: + name: packages-${{ inputs.distrib }} + path: ./*.${{ inputs.package_extension }} + retention-days: 1 + + - name: Cache packages + uses: actions/cache@v3 + with: + path: ./*.${{ inputs.package_extension }} + key: ${{ inputs.cache_key }} diff --git a/.github/workflows/perl-vmware-vsphere.yml b/.github/workflows/perl-vmware-vsphere.yml new file mode 100644 index 000000000..be2485f30 --- /dev/null +++ b/.github/workflows/perl-vmware-vsphere.yml @@ -0,0 +1,122 @@ +name: perl-vmware-vsphere + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + workflow_dispatch: + pull_request: + paths: + - 'dependencies/perl-vmware-vsphere/**' + push: + branches: + - develop + - master + paths: + - 'dependencies/perl-vmware-vsphere/**' + tags: + - perl-vmware-vsphere-* + +jobs: + get-environment: + uses: ./.github/workflows/get-environment.yml + with: + version_file: connectors/vmware/src/centreon/script/centreon_vmware.pm + + get-sources: + runs-on: ubuntu-22.04 + steps: + - name: Download vsphere cli sources + run: | + wget https://gitlab.labexposed.com/centreon-lab/perl-VMware-vSphere/-/raw/master/storage/VMware-vSphere-Perl-SDK-7.0.0-17698549.x86_64.tar.gz + tar zxf VMware-vSphere-Perl-SDK-7.0.0-17698549.x86_64.tar.gz + shell: bash + + - name: Build vsphere cli sources + run: | + cd vmware-vsphere-cli-distrib + perl Makefile.PL + sudo make pure_install + shell: bash + + - name: Cache vsphere cli sources + uses: actions/cache/save@v3 + with: + path: vmware-vsphere-cli-distrib + key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere + + package: + needs: + - get-sources + strategy: + matrix: + include: + - package_extension: rpm + image: packaging-plugins-alma8 + distrib: el8 + - package_extension: rpm + image: packaging-plugins-alma9 + distrib: el9 + - package_extension: deb + image: packaging-plugins-bullseye + distrib: bullseye + name: package ${{ matrix.distrib }} + + uses: ./.github/workflows/package.yml + with: + nfpm_file_pattern: "dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml" + distrib: ${{ matrix.distrib }} + package_extension: ${{ matrix.package_extension }} + image_name: ${{ matrix.image }} + source_cache_key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere + source_cache_path: vmware-vsphere-cli-distrib + cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} + secrets: inherit + + deliver-rpm: + needs: + - get-environment + - package + if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} + runs-on: [self-hosted, common] + + strategy: + matrix: + distrib: [el8, el9] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Delivery + uses: ./.github/actions/rpm-delivery + with: + module_name: perl-vmware-vsphere + distrib: ${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} + stability: ${{ needs.get-environment.outputs.stability }} + artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} + + deliver-deb: + needs: + - get-environment + - package + if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} + runs-on: [self-hosted, common] + + strategy: + matrix: + distrib: [bullseye] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Delivery + uses: ./.github/actions/deb-delivery + with: + distrib: ${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} + stability: ${{ needs.get-environment.outputs.stability }} + artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} diff --git a/.github/workflows/plugin-delivery.yml b/.github/workflows/plugin-delivery.yml index 66fbc7541..56958e9bb 100644 --- a/.github/workflows/plugin-delivery.yml +++ b/.github/workflows/plugin-delivery.yml @@ -64,6 +64,7 @@ jobs: deliver-rpm: runs-on: [self-hosted, common] strategy: + fail-fast: false matrix: distrib: [el7, el8, el9] @@ -77,16 +78,38 @@ jobs: module_name: plugins distrib: ${{ matrix.distrib }} cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} + stability: ${{ inputs.stability }} + artifactory_token: ${{ secrets.artifactory_token }} + + deliver-rpm-legacy: + runs-on: [self-hosted, common] + strategy: + fail-fast: false + matrix: + distrib: [el7, el8] + major_version: ["21.10", "22.04", "22.10"] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Delivery + uses: ./.github/actions/rpm-delivery-legacy + with: + module_name: plugins + major_version: ${{ matrix.major_version }} + distrib: ${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} update_repo_path: ${{ secrets.update_repo_path }} cloudfront_id: ${{ secrets.cloudfront_id }} yum_repo_address: ${{ secrets.yum_repo_address }} yum_repo_key: ${{ secrets.yum_repo_key }} stability: ${{ inputs.stability }} - artifactory_token: ${{ secrets.artifactory_token }} deliver-deb: runs-on: [self-hosted, common] strategy: + fail-fast: false matrix: distrib: [bullseye] @@ -98,8 +121,28 @@ jobs: uses: ./.github/actions/deb-delivery with: distrib: ${{ matrix.distrib }} + cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} + stability: ${{ inputs.stability }} + artifactory_token: ${{ secrets.artifactory_token }} + + deliver-deb-legacy: + runs-on: [self-hosted, common] + strategy: + fail-fast: false + matrix: + distrib: [bullseye] + major_version: ["22.04", "22.10"] + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Delivery + uses: ./.github/actions/deb-delivery-legacy + with: + distrib: ${{ matrix.distrib }} + major_version: ${{ matrix.major_version }} nexus_username: ${{ secrets.nexus_username }} nexus_password: ${{ secrets.nexus_password }} cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} stability: ${{ inputs.stability }} - artifactory_token: ${{ secrets.artifactory_token }} diff --git a/.github/workflows/plugin-package.yml b/.github/workflows/plugin-package.yml index 81bade299..9a75f5fe4 100644 --- a/.github/workflows/plugin-package.yml +++ b/.github/workflows/plugin-package.yml @@ -19,9 +19,6 @@ on: jobs: fatpacker: runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.get_version.outputs.version }} - release: ${{ steps.get_version.outputs.release }} steps: - name: Checkout sources uses: actions/checkout@v3 @@ -29,17 +26,16 @@ jobs: fetch-depth: 1 - name: Prepare FatPacker - uses: perl-actions/install-with-cpm@stable + uses: shogo82148/actions-setup-perl@v1 with: - install: | - App::FatPacker - File::Copy::Recursive - JSON + perl-version: '5.34' + install-modules-with: cpm + install-modules: App::FatPacker File::Copy::Recursive JSON - name: Run FatPacker run: | COMMIT=$(git log -1 HEAD --pretty=format:%h) - perl .github/scripts/plugins-source.container.pl "${{ inputs.plugins }}" "${{ steps.get_version.outputs.version }} ($COMMIT)" + perl .github/scripts/plugins-source.container.pl "${{ inputs.plugins }}" "${{ inputs.version }} ($COMMIT)" - uses: actions/cache@v3 with: diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 850d3c166..6af13d3d1 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -55,19 +55,17 @@ jobs: - name: transform to directories run: | folders=() - for f in ${{ steps.filter.outputs.packages_files }}; \ - do \ - echo "Adding $(dirname $f) to folders"; \ - folders+=($(dirname $f)); \ + for f in ${{ steps.filter.outputs.packages_files }}; do + echo "Adding $(dirname $f) to folders" + folders+=($(dirname $f)) done unique_folders=($(printf "%s\n" "${folders[@]}" | sort -u | tr '\n' ' ')) jq --compact-output --null-input '$ARGS.positional' --args -- ${unique_folders[@]} > package_directories.txt files=() - for f in ${{ steps.filter.outputs.plugins_files }}; \ - do \ - echo "Adding $f to files"; \ - files+=($f); \ + for f in ${{ steps.filter.outputs.plugins_files }}; do + echo "Adding $f to files" + files+=($f) done unique_files=($(printf "%s\n" "${files[@]}" | sort -u | tr '\n' ' ')) jq --compact-output --null-input '$ARGS.positional' --args -- ${unique_files[@]} > plugins.txt diff --git a/.github/workflows/tests-functional.yml b/.github/workflows/tests-functional.yml new file mode 100644 index 000000000..31f20ccf5 --- /dev/null +++ b/.github/workflows/tests-functional.yml @@ -0,0 +1,61 @@ +name: Run mock API server +on: + workflow_dispatch: + push: + branches: + - MON-** + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: "14.x" + - name: Install Mockoon CLI + run: npm install -D @mockoon/cli + - name: Install perl dependencies + uses: perl-actions/install-with-cpm@stable + with: + install: | + DateTime + Digest::MD5 + Encode + HTTP::ProxyPAC + IO::Socket::SSL + JSON::XS + LWP::Protocol::https + LWP::UserAgent + MIME::Base64 + Paws + POSIX + Storable + URI + URI::Encode + - name: Run Mockoon CLI + run: npx mockoon-cli start --data tests/resources/mockoon/cloud-aws-cloudtrail.json --port 3000 + - name: Run plugin + run: | + sudo chmod -R +x tests/functional/ + sudo mkdir -p /var/lib/centreon/centplugins/ + sudo chmod 777 /var/lib/centreon/centplugins/ + TESTS="$(tests/functional/cloud/aws/cloudtrail/checktrailstatus.sh)" + echo "tests=$(echo $TESTS)" >> $GITHUB_OUTPUT + if [[ $TESTS = "OK:"* ]]; then + echo "OK" + else + echo $TESTS + exit 1 + fi + TESTS="$(tests/functional/cloud/aws/cloudtrail/countevents.sh)" + echo "tests=$(echo $TESTS)" >> $GITHUB_OUTPUT + if [[ $TESTS = "OK:"* ]]; then + echo "OK" + else + echo $TESTS + exit 1 + fi + shell: bash \ No newline at end of file diff --git a/connectors/vmware/README.md b/connectors/vmware/README.md new file mode 100644 index 000000000..3dff1357e --- /dev/null +++ b/connectors/vmware/README.md @@ -0,0 +1,78 @@ +# centreon-vmware + +"centreon-vmware" is a free and open source project. The project can be used with Centreon and all monitoring softwares compatible with Nagios plugins. +It's a Perl daemon in charged to get back VMWare indicators. This program uses the SDK Perl provided by VMWare. + +The connector could get following indicators: +* For ESX Server: + * Current alarms + * CPU usage + * Memory usage + * Swap usage + * Interface trafics + * Count VMs + * Health status + * Global status + * Uptime +* For Virtual Machines: + * CPU usage + * Memory usage + * Swap usage + * IOPs on datastores + * Limits configured (CPU, memory and disks) + * Snapshot age and consolidation + * Thinprovisioning configuration + * VMTools state +* For Datastores: + * Usage + * IOPs + * Usage in bytes/s + * Snapshost sizes +* For Cluster: + * Operations on virtual machines (Clone, VMotion,...) +* For Datacenter: + * Current alarms + +You can check one or X entities for each checks. Moreover, you can also "scope" it. It means: i can check the virtual machines of a datacenter(s) and/or a cluster(s). + +Please follow the documentation for the installation: https://github.com/centreon/centreon-vmware/blob/master/doc/en/installation/index.rst + +## Examples + +Check vmtools states of virtual machines (with name matching the regexp 'prd'): + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --connector-hostname=127.0.0.1 --container=default --verbose --mode=tools-vm --display-description --vm-hostname='prd' --filter + WARNING: 1 VM with VMTools not installed | + vmtools not installed: + prd-Reporting - 10.0.0.1 [description xxxx] + +Check datastore IOPs of virtual machines (with name matching the regexp 'centreon-central-1|Formation'): + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --connector-hostname=127.0.0.1 --container=default --verbose --mode=datastore-vm --vm-hostname='woot|test-migration' --filter + OK: All virtual machines are ok | 'max_total_latency_test-migration'=2.00ms;;;0; 'riops_test-migration_INTEGRATION'=0.41iops;;;0; 'wiops_test-migration_INTEGRATION'=4.84iops;;;0;4.84 'riops_test-migration_ISOs'=0.00iops;;;0; 'wiops_test-migration_ISOs'=0.00iops;;;0;0.00 'max_total_latency_woot'=23.00ms;;;0; 'riops_woot'=0.02iops;;;0; 'wiops_woot'=0.67iops;;;0;0.67 + checking virtual machine 'test-migration' + [connection state connected][power state poweredOn] + max total latency is 2.00 ms + datastore 'INTEGRATION' 0.41 read iops, 4.84 write iops + datastore 'ISOs' 0.00 read iops, 0.00 write iops + checking virtual machine 'woot' + [connection state connected][power state poweredOn] + max total latency is 23.00 ms + datastore 'DSI' 0.02 read iops, 0.67 write iops + +Check the health of ESX Servers: + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --connector-hostname=127.0.0.1 --container=default --verbose --mode=health-host --esx-hostname='.*' --filter --disconnect-status='ok' + OK: 0 total health issue(s) found - All ESX hosts are ok | 'total_problems'=0;;;0;1034 'problems_srvi-clus-esx-n1.int.centreon.com'=0;;;0;315 'problems_yellow_srvi-clus-esx-n1.int.centreon.com'=0;;;0;315 'problems_red_srvi-clus-esx-n1.int.centreon.com'=0;;;0;315 'problems_srvi-clus-esx-n2.int.centreon.com'=0;;;0;315 'problems_yellow_srvi-clus-esx-n2.int.centreon.com'=0;;;0;315 'problems_red_srvi-clus-esx-n2.int.centreon.com'=0;;;0;315 'problems_srvi-clus-esx-n3.int.centreon.com'=0;;;0;202 'problems_yellow_srvi-clus-esx-n3.int.centreon.com'=0;;;0;202 'problems_red_srvi-clus-esx-n3.int.centreon.com'=0;;;0;202 'problems_srvi-clus-esx-n4.int.centreon.com'=0;;;0;202 'problems_yellow_srvi-clus-esx-n4.int.centreon.com'=0;;;0;202 'problems_red_srvi-clus-esx-n4.int.centreon.com'=0;;;0;202 + checking host 'srvi-clus-esx-n1.int.centreon.com' + status connected + 315 health checks are green, 0 total health issue(s) found, 0 yellow health issue(s) found, 0 red health issue(s) found + checking host 'srvi-clus-esx-n2.int.centreon.com' + status connected + 315 health checks are green, 0 total health issue(s) found, 0 yellow health issue(s) found, 0 red health issue(s) found + checking host 'srvi-clus-esx-n3.int.centreon.com' + status connected + 202 health checks are green, 0 total health issue(s) found, 0 yellow health issue(s) found, 0 red health issue(s) found + checking host 'srvi-clus-esx-n4.int.centreon.com' + status connected + 202 health checks are green, 0 total health issue(s) found, 0 yellow health issue(s) found, 0 red health issue(s) found diff --git a/connectors/vmware/changelog b/connectors/vmware/changelog new file mode 100644 index 000000000..0b146c7b0 --- /dev/null +++ b/connectors/vmware/changelog @@ -0,0 +1,95 @@ +2022-08-09 Quentin Garnier <qgarnier@centreon.com> - 3.2.5 + * Enhancement: add tags in discovery + +2022-04-14 Quentin Garnier <qgarnier@centreon.com> - 3.2.4 + * Fix: custom attributes retrieved for vcenter only + +2022-04-14 Quentin Garnier <qgarnier@centreon.com> - 3.2.3 + * Enhancement: add custom attributes in discovery + +2021-12-21 Quentin Garnier <qgarnier@centreon.com> - 3.2.2 + * Enhancement: add 'storage-host' + * Enhancement: add 'cpu-cluster' (issue #90) + * Enhancement: add 'licenses' + * Enhancement: add refresh capability for datastore-usage (issue #96) + * Enhancement: container label in configuration is case-insensitive (issue #83) + * Enhancement: add capability to use empty-continue option (issue #77) + +2020-11-03 Quentin Garnier <qgarnier@centreon.com> - 3.2.1 + * Fix: daemon cannot start (issue #92) + +2020-11-02 Quentin Garnier <qgarnier@centreon.com> - 3.2.0 + * Enhancement: add 'net-vm' + * Enhancement: add 'hosts' attached to datastores for 'datastore-usage' + * Fix: remove vm without uuid for 'discovery' + +2020-04-06 Quentin Garnier <qgarnier@centreon.com> - 3.1.2 + * Enhancement: add drs and das config enable 'cluster-status' + * Enhancement: remove carriage return from vm annotation in discovery + * Fix: remove errors in logs 'net-host' + +2020-02-20 Quentin Garnier <qgarnier@centreon.com> - 3.1.1 + * Fix: discovery folders management + * Fix: no virtual machines running for 'datastore-vm' + * Fix: undefined error for 'thinprovisioning-vm' + +2019-08-27 Quentin Garnier <qgarnier@centreon.com> - 3.1.0 + * Enhancement: add 'status-cluster' and 'vsan-cluster-usage' + * Fix: Can listen only on localhost (issue #81) + * Fix: Can configure ipc_file location + +2019-07-04 Colin Gagnaire <cgagnaire@centreon.com> - 3.0.3 + * Fix: Datacenter with no cluster causes discovery to crash + * Fix: Cluster with no ESX causes discovery to crash + +2019-06-06 Colin Gagnaire <cgagnaire@centreon.com> - 3.0.2 + * Fix: ESX with no VMs causes VM discovery to crash + * Fix: VM with no folder causes VM discovery to crash + +2019-04-12 Colin Gagnaire <cgagnaire@centreon.com> - 3.0.1 + * Enhancement: add resource type filter option for discovery + * Enhancement: add uuid and folder to vm discovery + * Enhancement: add uuid filter in vm modes + +2019-01-06 Quentin Garnier <qgarnier@centreon.com> - 3.0.0 + * Enhancement: checking intelligence is moved in centreon-plugins + * Enhancement: autonomous daemon - remove dependency with centreon-plugins-base and perl centreon base library + * Enhancement: update debian doc + * Enhancement: Can filter on guest os virtual machine (option --filter-os in centreon-plugins) + * Enhancement: Can choose case insensitive searching (option --case-insensitive in centreon-plugins) + +2017-05-31 Quentin Garnier <qgarnier@centreon.com> - 2.4.0 + * Enhance: Use ZMQ4 library + +2017-05-16 Quentin Garnier <qgarnier@centreon.com> - 2.3.2 + * Fix: miscalcultion in datastores-snapshot (issue #39) + * Fix: problem with --tools-notinstalled-status option (issue #38) + * Fix: host memory state problem (issue #40) + +2016-11-17 Quentin Garnier <qgarnier@centreon.com> - 2.3.1 + * Enhance: Add an option to not check memory ESX state + +2016-08-04 Quentin Garnier <qgarnier@centreon.com> - 2.3.0 + * Enhance: Add a mode to check connected device (issue #20) + * Enhance: Option to use case-insensitive search (issue #14) + * Enhance: Add memory state for ESX check + * Fix: Hardening connector about blocked childs + +2016-05-26 Quentin Garnier <qgarnier@centreon.com> - 2.2.1 + * Enhance: Better management of ESX/VCenter disconnect + * Enhance: Add counter 'max-total-latency' for mode 'datastore-vm' + +2016-01-15 Quentin Garnier <qgarnier@centreon.com> - 2.2.0 + * Enhance: Can check ESX time offset (issue #9) + * Fix: displaying object name in alarm-* modes (issue #12) + +2015-12-03 Quentin Garnier <qgarnier@centreon.com> - 2.1.0 + * Enhance: Add a command to monitor ESX services (issue #3) + * Enhance: Can choose the sampling period (issue #1) + * Enhance: Display ESX version in command 'getmap' (issue #2) + * Fix: Hardening connector (issue #5) + * Fix: error for 'alarm-*' commands (issue #4) + * Fix: counter 'active' for command 'memory-vm' (issue #6) + +2015-09-23 Quentin Garnier <qgarnier@centreon.com> - 2.0.0 + * initial release diff --git a/connectors/vmware/doc/en/Makefile b/connectors/vmware/doc/en/Makefile new file mode 100644 index 000000000..2370a79c0 --- /dev/null +++ b/connectors/vmware/doc/en/Makefile @@ -0,0 +1,177 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make <target>' where <target> is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CentreonESXD.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CentreonESXD.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/CentreonESXD" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/CentreonESXD" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/connectors/vmware/doc/en/conf.py b/connectors/vmware/doc/en/conf.py new file mode 100644 index 000000000..016e8817d --- /dev/null +++ b/connectors/vmware/doc/en/conf.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +# +# Centreon ESXD documentation build configuration file, created by +# sphinx-quickstart on Mon Apr 22 11:17:38 2013. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Centreon VMWare' +copyright = u'2015, Centreon' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '2.0' +# The full version, including alpha/beta/rc tags. +release = '2.0.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# "<project> v<release> documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a <link> tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'CentreonESXDdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'CentreonESXD.tex', u'Centreon ESXD Documentation', + u'Merethis', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'centreonesxd', u'Centreon ESXD Documentation', + [u'Merethis'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'CentreonESXD', u'Centreon ESXD Documentation', + u'Merethis', 'CentreonESXD', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False diff --git a/connectors/vmware/doc/en/exploitation/index.rst b/connectors/vmware/doc/en/exploitation/index.rst new file mode 100644 index 000000000..6d761af30 --- /dev/null +++ b/connectors/vmware/doc/en/exploitation/index.rst @@ -0,0 +1,120 @@ +============ +Exploitation +============ + +Generals Principles +------------------- + +Centreon-vmware is a Perl program in charged to get back VMWare indicators. This program uses the SDK Perl provided by VMWare in order to connect and get back the informations of one (or more) Virtual Center. To do this, it makes a TCP connection with the VirtualCenter. + +By default "centreon-vmware" starts at least two processes (named "handle-client" and "handle-vsphere-xxxx") : + +*« handle-client »*: + *Process waiting for requests of clients.* + +Steps of operation : + +- A client connects. +- The client ask an monitoring indicator on a VirtualCenter. +- The process "handle-client" sends the request to process "handle-vsphere-xxxx". +- A response is sent by "handle-vsphere-xxxx" to "handle-client". +- The process "handle-client" sends the response to the client. + +*« handle-vsphere-xxxx »*: + *Process responsible to connect and to keep opened a session with the VirtualCenter. To ensure quality performance, a cache of datas description is created.* + +Then, this process gets back the VMWare indicators creating a subprocess per request. + +Centreon-vmware necessitates the utilization of one (or more) VirtualCenter (or ESX). +This is a example of a distributed architecture : + +.. image:: ../images/archi.png + +Operating mode +-------------- + +The "centreon-vmware" program only works in "daemon" mode (a client is needed). + +Connector configuration +----------------------- + +The « centreon-vmware » daemon is configured with the « centreon_vmware.pm » configuration file: +:: + + %centreon_vmware_config = ( + vsphere_server => { + 'default' => {'url' => 'https://vcenter/sdk', + 'username' => 'test@test.fr', + 'password' => 'xxxx'}, + } + ); + +« vsphere_server » attribute configures VirtualCenter access. +In case you have many VirtualCenters, the configuration is (note the use of "," as a separator): +:: + + %centreon_vmware_config = ( + vsphere_server => { + 'default' => {'url' => 'https://vcenter/sdk', + 'username' => 'test@test.fr', + 'password' => 'xxxx'}, + 'other' => {'url' => 'https://other_vcenter/sdk', + 'username' => 'test@test.fr', + 'password' => 'xxxx'}, + }, + ); + +'other' and 'default' are containers name. + +Client Usage +------------ + +Check vmtools states of virtual machines (with name matching the regexp 'prd'): +:: + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --custommode=connector --connector-hostname=127.0.0.1 --container=default --verbose --mode=tools-vm --display-description --vm-hostname='prd' --filter + WARNING: 1 VM with VMTools not installed | + vmtools not installed: + prd-Reporting - 10.0.0.1 [description xxxx] + +Check datastore IOPs of virtual machines (with name matching the regexp 'centreon-central-1|Formation'): +:: + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --custommode=connector --connector-hostname=127.0.0.1 --container=default --verbose --mode=datastore-vm --vm-hostname='centreon-central-1|Formation' --filter + OK: All Datastore IOPS counters are ok | 'riops_Formation-Reporting - 10.30.2.89_R&D-BI'=0.00iops;;;0; 'wiops_Formation-Reporting - 10.30.2.89_R&D-BI'=1.43iops;;;0; 'riops_centreon-central-1_INTEGRATION'=0.00iops;;;0; 'wiops_centreon-central-1_INTEGRATION'=0.60iops;;;0; + 'Formation-Reporting - 10.30.2.89' read iops on 'R&D-BI' is 0.00 + 'Formation-Reporting - 10.30.2.89' write iops on 'R&D-BI' is 1.43 + 'centreon-central-1' read iops on 'INTEGRATION' is 0.00 + 'centreon-central-1' write iops on 'INTEGRATION' is 0.60 + +Check the health of ESX Servers: +:: + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --custommode=connector --connector-hostname=127.0.0.1 --container=default --verbose --mode=health-host --esx-hostname='.*' --filter --disconnect-status='ok' + OK: All ESX health checks are ok | 'problems_srvi-clus-esx-n2.merethis.net'=0;;;0;299 'problems_srvi-clus-esx-n1.merethis.net'=0;;;0;299 'problems_srvi-clus-esx-n4.merethis.net'=0;;;0;186 'problems_srvi-clus-esx-n3.merethis.net'=0;;;0;186 + Checking srvi-clus-esx-n2.merethis.net + 299 health checks are green + Checking srvi-clus-esx-n1.merethis.net + 299 health checks are green + Checking srvi-clus-esx-n4.merethis.net + 186 health checks are green + Checking srvi-clus-esx-n3.merethis.net + 186 health checks are green + +Troubleshooting +--------------- + +It is possible to get this kind of errors in the « logs » of « centreon-vmware »: +:: + + ...SOAP request error - possibly a protocol issue: read failed: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac... + +VMWare Perl SDK sometimes generates this error that does not alter the behaviour of the connector. The bug comes from OpenSSL. It should be fix in OpenSSL 1.0.1h (CVE-2010-5298). + +You can have the following error returns by the connector: +:: + + # perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin ... + Cannot get value for counters... + +Please check that your VirtualCenter and ESX time synchronization. Most of the time, the server with the connector and/or VirtualCenter/ESX are not well synchronized. diff --git a/connectors/vmware/doc/en/images/archi.png b/connectors/vmware/doc/en/images/archi.png new file mode 100644 index 000000000..f83c5281e Binary files /dev/null and b/connectors/vmware/doc/en/images/archi.png differ diff --git a/connectors/vmware/doc/en/index.rst b/connectors/vmware/doc/en/index.rst new file mode 100644 index 000000000..cb63e74a4 --- /dev/null +++ b/connectors/vmware/doc/en/index.rst @@ -0,0 +1,16 @@ +.. Centreon ESXD documentation master file, created by + sphinx-quickstart on Mon Apr 22 11:17:38 2013. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Centreon VMWare's documentation! +=========================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + installation/index + exploitation/index + diff --git a/connectors/vmware/doc/en/installation/index.rst b/connectors/vmware/doc/en/installation/index.rst new file mode 100644 index 000000000..d95e82c32 --- /dev/null +++ b/connectors/vmware/doc/en/installation/index.rst @@ -0,0 +1,303 @@ +============ +Installation +============ + +Prerequisites +============= + +Software Recommandations +```````````````````````` + +The "centreon-vmware" connector has been only tested on red-hat 5 and 6 with rpms. +Installation on other system should be possible. + +====================== ===================== +Software Version +====================== ===================== +VMWare SDK Perl 5.1.0-780721 +Perl 5.8 +centreon-vmware 2.0.0 +perl-centreon-base 2.6.0 +centreon-plugins-base 1.11 +ZeroMQ 4.x +Perl Date::Parse 1.x +Perl ZMQ::LibZMQ4 0.01 +Perl ZMQ::Constants 1.04 +====================== ===================== + +How to install from sources is explained in the current documentation. + +Hardware Recommandations +```````````````````````` + +Hardware prerequisites will depend of check numbers. Minimal used resources are : + +* RAM : 512 Mo (May slightly increase with the number of checks). +* CPU : same as poller server. + +Centreon-vmware Installation - Debian Stretch +============================================= + +SDK Perl VMWare Installation +```````````````````````````` + +The "centreon-vmware" connector uses SDK Perl VMWare for its operation. So we install it with VMWare recommandation (only tested with version below). + +========================== ===================== ====================== +Dependency Version Repository +========================== ===================== ====================== +libwww-perl 6.15 stretch +libxml-libxml-perl 2.0128 stretch +libclass-methodmaker-perl 2.24 stretch +libcrypt-ssleay-perl 0.73 stretch +libsoap-lite-perl 1.20 stretch +libuuid-perl 0.27 stretch +========================== ===================== ====================== + +Install following dependency: +:: + + # apt-get install make libxml-libxml-perl libwww-perl libclass-methodmaker-perl libcrypt-ssleay-perl libsoap-lite-perl libuuid-perl libtext-template-perl + +Download the Perl SDK VMWare and install it: +:: + + # tar zxf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz && cd vmware-vsphere-cli-distrib + # perl Makefile.PL + # make && make install + +Requirements +````````````` + +Following prerequisites are mandatory for « centreon_vmware »: + +* « zeromq » and Perl binding + +centreon-vmware Installation with source +```````````````````````````````````````` + +Install the following package: +:: + + # aptitude install libzmq5 + +Install « zeromq » perl binding dependency (need to patch the installer: https://rt.cpan.org/Public/Bug/Display.html?id=122932): +:: + + # apt-get install gcc libmodule-install-perl libzmq3-dev + # wget https://github.com/lestrrat/p5-ZMQ/archive/master.zip + # unzip master.zip + # cd p5-ZMQ-master/ZMQ-LibZMQ4/ + # perl Makefile.PL + # make && make install + # cd p5-ZMQ-master/ZMQ-Constants/ + # perl Makefile.PL + # make && make install + +Download « centreon-vmware » archive, then install: +:: + + # tar zxvf centreon-vmware-3.0.0.tar.gz + # cd centreon-vmware-3.0.0 + # cp centreon_vmware.pl /usr/bin/ + + # mkdir -p /etc/centreon /var/log/centreon + # useradd centreon + # chown centreon:centreon /var/log/centreon + # cp contrib/config/centreon_vmware-conf.pm /etc/centreon/centreon_vmware.pm + # cp contrib/debian/centreon_vmware-systemd /lib/systemd/system/centreon_vmware.service + # chmod 664 /lib/systemd/system/centreon_vmware.service + + # mkdir -p /usr/share/perl5/centreon/vmware/ /usr/share/perl5/centreon/script/ + # cp centreon/vmware/* /usr/share/perl5/centreon/vmware/ + # cp centreon/script/centreon_vmware.pm /usr/share/perl5/centreon/script/ + +Configure "centreon-vmware" daemon to start at boot: +:: + + # systemctl enable centreon_vmware.service + +Install the client and dependency: +:: + + # apt-get install libtimedate-perl + # git clone http://git.centreon.com/centreon-plugins.git + # cd centreon-plugins + # mkdir -p /usr/lib/nagios/plugins/centreon/plugins/ + # cp centreon/plugins/* /usr/lib/nagios/plugins/centreon/plugins/ + # mkdir -p /usr/lib/nagios/plugins/apps/vmware/ + # cp -R apps/vmware/* /usr/lib/nagios/plugins/apps/vmware/ + # cp centreon_plugins.pl /usr/lib/nagios/plugins/ + +Centreon-vmware Installation - centos/rhel 5 systems +==================================================== + +SDK Perl VMWare Installation +```````````````````````````` + +The "centreon-vmware" connector uses SDK Perl VMWare for its operation. So we install it with VMWare recommandation (only tested with version below). + +======================= ===================== ====================== +Dependency Version Repository +======================= ===================== ====================== +perl-libwww-perl 5.805 redhat/centos base +perl-XML-LibXML 1.58 redhat/centos base +perl-Class-MethodMaker 2.18 ces standard +perl-Crypt-SSLeay 0.51 redhat/centos base +perl-SOAP-Lite 0.712 ces standard +perl-UUID 0.04 ces standard +perl-VMware-vSphere 5.1.0-780721.1 ces standard +======================= ===================== ====================== + +Install following dependency: +:: + + # yum install perl-VMware-vSphere + +Requirements +````````````` + +Following prerequisites are mandatory for « centreon_vmware »: + +* « centreon-plugins-base »: in repository ces standard +* « zeromq » and Perl binding: in repository ces standard or EPEL + +Following prerequisites are optional for « centreon_vmware »: + +* « perl-TimeDate »: in repository redhat/centos base + +centreon-vmware Installation with rpm +````````````````````````````````````` + +Install the connector: +:: + + # yum install ces-plugins-Virtualization-VMWare-daemon + +Install the client: +:: + + # yum install ces-plugins-Virtualization-VMWare-client + +centreon-vmware Installation with source +```````````````````````````````````````` + +Download « centreon-vmware » archive, then install: +:: + + # tar zxvf centreon-vmware-3.0.0.tar.gz + # cd centreon-vmware-3.0.0 + # cp centreon_vmware.pl /usr/bin/ + + # mkdir -p /etc/centreon + # cp contrib/config/centreon_vmware-conf.pm /etc/centreon/centreon_vmware.pm + # cp contrib/redhat/centreon_vmware-init /etc/init.d/centreon_vmware + # cp contrib/redhat/centreon_vmware-sysconfig /etc/sysconfig/centreon_vmware + # chmod 775 /etc/init.d/centreon_vmware /usr/bin/centreon_vmware.pl + + # mkdir -p /usr/lib/perl5/vendor_perl/5.8.8/centreon/vmware/ /usr/lib/perl5/vendor_perl/5.8.8/centreon/script/ + # cp centreon/vmware/* /usr/lib/perl5/vendor_perl/5.8.8/centreon/vmware/ + # cp centreon/script/centreon_vmware.pm /usr/lib/perl5/vendor_perl/5.8.8/centreon/script/ + +Configure "centreon-vmware" daemon to start at boot: +:: + + # chkconfig --level 2345 centreon_vmware on + +Install the client and dependency: +:: + + # git clone http://git.centreon.com/centreon-plugins.git + # cd centreon-plugins + # mkdir -p /usr/lib/nagios/plugins/centreon/plugins/ + # cp centreon/plugins/* /usr/lib/nagios/plugins/centreon/plugins/ + # mkdir -p /usr/lib/nagios/plugins/apps/vmware/ + # cp -R apps/vmware/* /usr/lib/nagios/plugins/apps/vmware/ + # cp centreon_plugins.pl /usr/lib/nagios/plugins/ + +Centreon-vmware Installation - centos/rhel 6 systems & centos 7 +==================================================== + +SDK Perl VMWare Installation +```````````````````````````` + +The "centreon-vmware" connector uses SDK Perl VMWare for its operation. So we install it with VMWare recommendation (only tested with version below). + +======================= ===================== ====================== +Dependency Version Repository +======================= ===================== ====================== +perl-libwww-perl 5.833 redhat/centos base +perl-XML-LibXML 1.70 redhat/centos base +perl-Class-MethodMaker 2.16 redhat/centos base +perl-Crypt-SSLeay 0.57 redhat/centos base +perl-SOAP-Lite 0.710.10 redhat/centos base +perl-UUID 0.04 ces standard +perl-VMware-vSphere 5.1.0-780721.1 ces standard +======================= ===================== ====================== + +Install following dependency: +:: + + root # yum install perl-VMware-vSphere + +Requirements +```````````` + +Following prerequisites are mandatory for « centreon_vmware »: + +* « perl-centreon-base »: module since Centreon 2.5 (repository ces standard) +* « centreon-plugins-base »: in repository ces standard +* « zeromq » and Perl binding: in repository ces standard or EPEL + +Following prerequisites are optional for « centreon_vmware »: + +* « perl-TimeDate »: in repository redhat/centos base + +centreon-vmware Installation with rpm +````````````````````````````````````` + +Install the connector: +:: + + # yum install centreon-plugin-Virtualization-VMWare-daemon + +Install the client: +:: + + # yum install centreon-plugin-Virtualization-Vmware2-Connector-Plugin + +centreon-vmware Installation with source +```````````````````````````````````````` + +Download « centreon-vmware » archive, then install: +:: + + # tar zxvf centreon-vmware-3.0.0.tar.gz + # cd centreon-vmware-3.0.0 + # cp centreon_vmware.pl /usr/bin/ + + # mkdir -p /etc/centreon + # cp contrib/config/centreon_vmware-conf.pm /etc/centreon/centreon_vmware.pm + # cp contrib/redhat/centreon_vmware-init /etc/init.d/centreon_vmware + # cp contrib/redhat/centreon_vmware-sysconfig /etc/sysconfig/centreon_vmware + # chmod 775 /etc/init.d/centreon_vmware /usr/bin/centreon_vmware.pl + + # mkdir -p /usr/share/perl5/vendor_perl/centreon/vmware/ /usr/share/perl5/vendor_perl/centreon/script/ + # cp centreon/vmware/* /usr/share/perl5/vendor_perl/centreon/vmware/ + # cp centreon/script/centreon_vmware.pm /usr/share/perl5/vendor_perl/centreon/script/ + +Configure "centreon-vmware" daemon to start at boot: +:: + + # chkconfig --level 2345 centreon_vmware on + +Install the client and dependency: +:: + + # git clone http://git.centreon.com/centreon-plugins.git + # cd centreon-plugins + # mkdir -p /usr/lib/nagios/plugins/centreon/plugins/ + # cp centreon/plugins/* /usr/lib/nagios/plugins/centreon/plugins/ + # mkdir -p /usr/lib/nagios/plugins/apps/vmware/ + # cp -R apps/vmware/* /usr/lib/nagios/plugins/apps/vmware/ + # cp centreon_plugins.pl /usr/lib/nagios/plugins/ diff --git a/connectors/vmware/doc/fr/Makefile b/connectors/vmware/doc/fr/Makefile new file mode 100644 index 000000000..2370a79c0 --- /dev/null +++ b/connectors/vmware/doc/fr/Makefile @@ -0,0 +1,177 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make <target>' where <target> is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CentreonESXD.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CentreonESXD.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/CentreonESXD" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/CentreonESXD" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/connectors/vmware/doc/fr/conf.py b/connectors/vmware/doc/fr/conf.py new file mode 100644 index 000000000..016e8817d --- /dev/null +++ b/connectors/vmware/doc/fr/conf.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +# +# Centreon ESXD documentation build configuration file, created by +# sphinx-quickstart on Mon Apr 22 11:17:38 2013. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Centreon VMWare' +copyright = u'2015, Centreon' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '2.0' +# The full version, including alpha/beta/rc tags. +release = '2.0.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# "<project> v<release> documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a <link> tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'CentreonESXDdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'CentreonESXD.tex', u'Centreon ESXD Documentation', + u'Merethis', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'centreonesxd', u'Centreon ESXD Documentation', + [u'Merethis'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'CentreonESXD', u'Centreon ESXD Documentation', + u'Merethis', 'CentreonESXD', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False diff --git a/connectors/vmware/doc/fr/exploitation/index.rst b/connectors/vmware/doc/fr/exploitation/index.rst new file mode 100644 index 000000000..7b4e12208 --- /dev/null +++ b/connectors/vmware/doc/fr/exploitation/index.rst @@ -0,0 +1,121 @@ +============ +Exploitation +============ + +Principes Généraux +------------------ + +Centreon-esxd est un programme Perl chargé de récupérer des indicateurs VMWare. Ce programme utilise le SDK Perl fourni par VMWare afin de se connecter et récupérer les informations d'un (ou plusieurs) VirtualCenter. Pour cela il effectue une connexion TCP avec le(s) VirtualCenter. + +Par défaut, « centreon-vmware » lance au moins deux processus (nommé respectivement « handle-client », « handle-vsphere-xxxx ») : + +*« handle-client »*: + *Processus en attente des demandes clientes.* + +Voici le fonctionnement : + +- Un client se connecte. +- Le client demande un indicateur de supervision sur un VirtualCenter. +- Le processus « handle-client » fourni cette demande au processus « handle-vsphere-xxxx ». +- Une réponse est fournie par « handle-vsphere-xxxx » à « handle-client ». +- Le processus « handle-client » fourni la réponse au client. + +*« handle-vsphere-xxxx »*: + *Processus ayant le rôle de se connecter et garder ouverte une session avec son VirtualCenter (De plus, dans un souci de performances, un cache de description des données de performances est créé).* + +Enfin, ce processus récupère les indicateurs VMWare en créant un sous-processus par demande. + +Centreon-vmware nécessite l'utilisation d'un (ou plusieurs) VirtualCenter (ou ESX). + +Voici un exemple d'architecture éclaté : + +.. image:: ../images/archi.png + +Mode de fonctionnement +---------------------- + +Le programme « centreon-vmware » fonctionne uniquement en mode « daemon ». (dans le sens où il ne peut fournir les indicateurs sans l'utilisation d'un client). + +Configuration du connecteur +--------------------------- + +Le daemon « centreon-vmware » possède un fichier de configuration « centreon_vmware.pm » de la forme suivante : +:: + + %centreon_vmware_config = ( + vsphere_server => { + 'default' => {'url' => 'https://vcenter/sdk', + 'username' => 'test@test.fr', + 'password' => 'xxxx'}, + } + ); + +L'attribut « vsphere_server » permet de configurer les accès aux différents VirtualCenter. +Dans le cas ou il y a plusieurs VirtualCenters, la configuration devient (noter la "," de séparation) : +:: + + %centreon_vmware_config = ( + vsphere_server => { + 'default' => {'url' => 'https://vcenter/sdk', + 'username' => 'test@test.fr', + 'password' => 'xxxx'}, + 'other' => {'url' => 'https://other_vcenter/sdk', + 'username' => 'test@test.fr', + 'password' => 'xxxx'}, + } + ); + +'other' et 'default' sont des containeurs. + +Client Usage +------------ + +Vérifie l'état des VMTools des machines virtuelles avec 'prd' dans leur nom: +:: + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --custommode=connector --connector-hostname=127.0.0.1 --container=default --verbose --mode=tools-vm --display-description --vm-hostname='prd' --filter + WARNING: 1 VM with VMTools not installed | + vmtools not installed: + prd-Reporting - 10.0.0.1 [description xxxx] + +Vérifie les IOPs des machines virtuelles (avec 'centreon-central-1|Formation' dans leur nom. Cela est une expression régulière) sur leurs datastores: +:: + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --custommode=connector --connector-hostname=127.0.0.1 --container=default --verbose --mode=datastore-vm --vm-hostname='centreon-central-1|Formation' --filter + OK: All Datastore IOPS counters are ok | 'riops_Formation-Reporting - 10.30.2.89_R&D-BI'=0.00iops;;;0; 'wiops_Formation-Reporting - 10.30.2.89_R&D-BI'=1.43iops;;;0; 'riops_centreon-central-1_INTEGRATION'=0.00iops;;;0; 'wiops_centreon-central-1_INTEGRATION'=0.60iops;;;0; + 'Formation-Reporting - 10.30.2.89' read iops on 'R&D-BI' is 0.00 + 'Formation-Reporting - 10.30.2.89' write iops on 'R&D-BI' is 1.43 + 'centreon-central-1' read iops on 'INTEGRATION' is 0.00 + 'centreon-central-1' write iops on 'INTEGRATION' is 0.60 + +Vérifie l'état de santé des serveurs ESX: +:: + + $ perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --custommode=connector --connector-hostname=127.0.0.1 --container=default --verbose --mode=health-host --esx-hostname='.*' --filter --disconnect-status='ok' + OK: All ESX health checks are ok | 'problems_srvi-clus-esx-n2.merethis.net'=0;;;0;299 'problems_srvi-clus-esx-n1.merethis.net'=0;;;0;299 'problems_srvi-clus-esx-n4.merethis.net'=0;;;0;186 'problems_srvi-clus-esx-n3.merethis.net'=0;;;0;186 + Checking srvi-clus-esx-n2.merethis.net + 299 health checks are green + Checking srvi-clus-esx-n1.merethis.net + 299 health checks are green + Checking srvi-clus-esx-n4.merethis.net + 186 health checks are green + Checking srvi-clus-esx-n3.merethis.net + 186 health checks are green + +Troubleshooting +--------------- + +Il est possible de retrouver des erreurs de ce type dans les « logs » de « centreon-esxd » : +:: + + ...SOAP request error - possibly a protocol issue: read failed: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac... + +Le SDK Perl VMWare génère cette erreur de temps en temps mais ne bloque pas le fonctionnement du connecteur. Le bug provient d'OpenSSL. Il devrait être fix dans la version 1.0.1h (CVE-2010-5298). + +Le connecteur peut retourner l'erreur suivante: +:: + + # perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin ... + Cannot get value for counters... + +Vérifier la synchronisation du temps du VirtualCenter et de ses serveurs ESX. La plupart du temps, le serveur hébergeant le connecteur ou le VirtualCenter/ESX ne sont pas bien synchronisés. diff --git a/connectors/vmware/doc/fr/images/archi.png b/connectors/vmware/doc/fr/images/archi.png new file mode 100644 index 000000000..82dca91fe Binary files /dev/null and b/connectors/vmware/doc/fr/images/archi.png differ diff --git a/connectors/vmware/doc/fr/index.rst b/connectors/vmware/doc/fr/index.rst new file mode 100644 index 000000000..cb63e74a4 --- /dev/null +++ b/connectors/vmware/doc/fr/index.rst @@ -0,0 +1,16 @@ +.. Centreon ESXD documentation master file, created by + sphinx-quickstart on Mon Apr 22 11:17:38 2013. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Centreon VMWare's documentation! +=========================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + installation/index + exploitation/index + diff --git a/connectors/vmware/doc/fr/installation/index.rst b/connectors/vmware/doc/fr/installation/index.rst new file mode 100644 index 000000000..fceb4399d --- /dev/null +++ b/connectors/vmware/doc/fr/installation/index.rst @@ -0,0 +1,307 @@ +============ +Installation +============ + +Pré-Requis +========== + +Préconisations logicielles +`````````````````````````` + +Le connecteur "centreon-vmware" est testé et validé sur red-hat 6 uniquement avec des rpms. +L'installation sur d'autres environnements n'est pas exclu mais non présenté dans ce document (Debian, ...). + +====================== ===================== +Logiciels Version +====================== ===================== +VMWare SDK Perl 5.1.0-780721 +Perl 5.8 +centreon-vmware 2.0.0 +perl-centreon-base 2.5.0 +centreon-plugins-base 1.10 +ZeroMQ 4.x +Perl Date::Parse 1.x +Perl ZMQ::LibZMQ4 0.01 +Perl ZMQ::Constants 1.04 +====================== ===================== + +Il est expliqué comment installer par les sources dans ce document. + +Préconisations matérielles +`````````````````````````` + +Le matériel nécessaire dépend du nombre de demandes de vérifications. Par défaut, le connecteur n'effectue aucunes vérifications. Les ressources minimales sont de : + +* mémoire vive : 512 Mo minimum (Peut sensiblement augmenter en fonction du nombre de contrôle). +* CPU : même pré-requis que pour le serveur de collecte. + +Centreon-vmware Installation - Debian Wheezy +============================================ + +Installation du SDK Perl VMWare +``````````````````````````````` + +Le connecteur « centreon-vmware » utilise le SDK Perl VMWare pour son fonctionnement. Nous allons donc l'installer en suivant les versions recommandées par VMWare (en dehors de ces versions, le fonctionnement n'est pas garanti). + +========================== ===================== ====================== +Dependency Version Repository +========================== ===================== ====================== +libwww-perl 6.15 stretch +libxml-libxml-perl 2.0128 stretch +libclass-methodmaker-perl 2.24 stretch +libcrypt-ssleay-perl 0.73 stretch +libsoap-lite-perl 1.20 stretch +libuuid-perl 0.27 stretch +========================== ===================== ====================== + +Installer les dépendances suivantes: +:: + + # apt-get install make libxml-libxml-perl libwww-perl libclass-methodmaker-perl libcrypt-ssleay-perl libsoap-lite-perl libuuid-perl libtext-template-perl + +Télécharger et installer le Perl SDK VMWare: +:: + + # tar zxf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz && cd vmware-vsphere-cli-distrib + # perl Makefile.PL + # make && make install + +Pré-requis +`````````` + +Les dépendances suivantes sont nécessaires pour le fonctionnement de « centreon_vmware »: + +* « zeromq » et son module Perl + +Installation de centreon-vmware par les sources +``````````````````````````````````````````````` + +Installer le paquet suivant: +:: + + # apt-get install libzmq5 + +Installer le perl binding « zeromq » (nécessite l'application du patch: https://rt.cpan.org/Public/Bug/Display.html?id=122932): +:: + + # apt-get install gcc libmodule-install-perl libzmq3-dev + # wget https://github.com/lestrrat/p5-ZMQ/archive/master.zip + # unzip master.zip + # cd p5-ZMQ-master/ZMQ-LibZMQ4/ + # perl Makefile.PL + # make && make install + # cd p5-ZMQ-master/ZMQ-Constants/ + # perl Makefile.PL + # make && make install + +Télécharger l'archive de « centreon-vmware » et installer le connecteur: +:: + + # tar zxvf centreon-vmware-3.0.0.tar.gz + # cd centreon-vmware-3.0.0 + # cp centreon_vmware.pl /usr/bin/ + + # mkdir -p /etc/centreon /var/log/centreon + # useradd centreon + # chown centreon:centreon /var/log/centreon + # cp contrib/config/centreon_vmware-conf.pm /etc/centreon/centreon_vmware.pm + # cp contrib/debian/centreon_vmware-systemd /lib/systemd/system/centreon_vmware.service + # chmod 664 /lib/systemd/system/centreon_vmware.service + + # mkdir -p /usr/share/perl5/centreon/vmware/ /usr/share/perl5/centreon/script/ + # cp centreon/vmware/* /usr/share/perl5/centreon/vmware/ + # cp centreon/script/centreon_vmware.pm /usr/share/perl5/centreon/script/ + +Activer le daemon « centreon-vmware » au démarrage: +:: + + # systemctl enable centreon_vmware.service + +Installer le client et les dépendances: +:: + + # apt-get install libtimedate-perl + # git clone http://git.centreon.com/centreon-plugins.git + # cd centreon-plugins + # mkdir -p /usr/lib/nagios/plugins/centreon/plugins/ + # cp centreon/plugins/* /usr/lib/nagios/plugins/centreon/plugins/ + # mkdir -p /usr/lib/nagios/plugins/apps/vmware/ + # cp -R apps/vmware/* /usr/lib/nagios/plugins/apps/vmware/ + # cp centreon_plugins.pl /usr/lib/nagios/plugins/ + +Installation de centreon-vmware - Environnement centos/rhel 5 +============================================================= + +Installation du SDK Perl VMWare +``````````````````````````````` + +Le connecteur « centreon-vmware » utilise le SDK Perl VMWare pour son fonctionnement. Nous allons donc l'installer en suivant les versions recommandées par VMWare (en dehors de ces versions, le fonctionnement n'est pas garanti). + +======================= ===================== ====================== +Dépendance Version Dépôt +======================= ===================== ====================== +perl-libwww-perl 5.805 redhat/centos base +perl-XML-LibXML 1.58 redhat/centos base +perl-Class-MethodMaker 2.18 ces standard +perl-Crypt-SSLeay 0.51 redhat/centos base +perl-SOAP-Lite 0.712 ces standard +perl-UUID 0.04 ces standard +perl-VMware-vSphere 5.1.0-780721.1 ces standard +======================= ===================== ====================== + +Installer la dépendance suivante: +:: + + # yum install perl-VMware-vSphere + +Pré-requis +`````````` + +Les dépendances suivantes sont nécessaires pour le fonctionnement de « centreon_vmware »: + +* « centreon-plugins-base »: dépôt ces standard +* « zeromq » and Perl binding: dépôt ces standard ou EPEL + +Les dépendances suivantes sont optionnelles pour le fonctionnement de « centreon_vmware »: + +* « perl-TimeDate »: dépôt redhat/centos base + +Installation de centreon-vmware par rpm +``````````````````````````````````````` + +Installer le connecteur: +:: + + # yum install centreon-plugin-Virtualization-VMWare-daemon + +Installer le client: +:: + + # yum install centreon-plugin-Virtualization-Vmware2-Connector-Plugin + +Installation de centreon-vmware par les sources +``````````````````````````````````````````````` + +Télécharger l'archive de « centreon-vmware ». + +Installer les fichiers: +:: + + # tar zxvf centreon-vmware-2.0.0.tar.gz + # cd centreon-vmware-2.0.0 + # cp centreon_vmware.pl /usr/bin/ + + # mkdir -p /etc/centreon + # cp contrib/config/centreon_vmware-conf.pm /etc/centreon/centreon_vmware.pm + # cp contrib/redhat/centreon_vmware-init /etc/init.d/centreon_vmware + # cp contrib/redhat/centreon_vmware-sysconfig /etc/sysconfig/centreon_vmware + # chmod 775 /etc/init.d/centreon_vmware /usr/bin/centreon_vmware.pl + + # mkdir -p /usr/lib/perl5/vendor_perl/5.8.8/centreon/vmware/ /usr/lib/perl5/vendor_perl/5.8.8/centreon/script/ + # cp centreon/vmware/* /usr/lib/perl5/vendor_perl/5.8.8/centreon/vmware/ + # cp centreon/script/centreon_vmware.pm /usr/lib/perl5/vendor_perl/5.8.8/centreon/script/ + +Activer le daemon « centreon-vmware » au démarrage: +:: + + # chkconfig --level 2345 centreon_vmware on + +Installer le client et les dépendances: +:: + + # git clone http://git.centreon.com/centreon-plugins.git + # cd centreon-plugins + # mkdir -p /usr/lib/nagios/plugins/centreon/plugins/ + # cp centreon/plugins/* /usr/lib/nagios/plugins/centreon/plugins/ + # mkdir -p /usr/lib/nagios/plugins/apps/vmware/ + # cp -R apps/vmware/* /usr/lib/nagios/plugins/apps/vmware/ + # cp centreon_plugins.pl /usr/lib/nagios/plugins/ + +Installation de centreon-vmware - Environnement centos/rhel 6 +============================================================= + +Installation du SDK Perl VMWare +``````````````````````````````` + +Le connecteur « centreon-vmware » utilise le SDK Perl VMWare pour son fonctionnement. Nous allons donc l'installer en suivant les versions recommandées par VMWare (en dehors de ces versions, le fonctionnement n'est pas garanti). + +======================= ===================== ====================== +Dépendance Version Dépôt +======================= ===================== ====================== +perl-libwww-perl 5.833 redhat/centos base +perl-XML-LibXML 1.70 redhat/centos base +perl-Class-MethodMaker 2.16 redhat/centos base +perl-Crypt-SSLeay 0.57 redhat/centos base +perl-SOAP-Lite 0.710.10 redhat/centos base +perl-UUID 0.04 ces standard +perl-VMware-vSphere 5.1.0-780721.1 ces standard +======================= ===================== ====================== + +Installer la dépendance suivante: +:: + + # yum install perl-VMware-vSphere + +Pré-requis +`````````` + +Les dépendances suivantes sont nécessaires pour le fonctionnement de « centreon_vmware »: + +* « perl-centreon-base » : module est présent à partir de Centreon 2.5 (dépôt ces standard) +* « centreon-plugins-base » : présent dans le dépôt ces standard +* « zeromq » et le binding Perl : présent dans le dépôt ces standard ou EPEL + +Les dépendances suivantes sont optionnelles pour le fonctionnement de « centreon_vmware »: + +* « perl-TimeDate »: dépôt redhat/centos base + +Installation de centreon-vmware par rpm +``````````````````````````````````````` + +Installer le connecteur: +:: + + # yum install ces-plugins-Virtualization-VMWare-daemon + +Installer le client: +:: + + # yum install ces-plugins-Virtualization-VMWare-client + +Installation de centreon-vmware par les sources +``````````````````````````````````````````````` + +Télécharger l'archive de « centreon-vmware ». + +Installer le connecteur: +:: + + # tar zxvf centreon-vmware-2.0.0.tar.gz + # cd centreon-vmware-2.0.0 + # cp centreon_vmware.pl /usr/bin/ + + # mkdir -p /etc/centreon + # cp contrib/config/centreon_vmware-conf.pm /etc/centreon/centreon_vmware.pm + # cp contrib/redhat/centreon_vmware-init /etc/init.d/centreon_vmware + # cp contrib/redhat/centreon_vmware-sysconfig /etc/sysconfig/centreon_vmware + # chmod 775 /etc/init.d/centreon_vmware /usr/bin/centreon_vmware.pl + + # mkdir -p /usr/share/perl5/vendor_perl/centreon/vmware/ /usr/share/perl5/vendor_perl/centreon/script/ + # cp centreon/vmware/* /usr/share/perl5/vendor_perl/centreon/vmware/ + # cp centreon/script/centreon_vmware.pm /usr/share/perl5/vendor_perl/centreon/script/ + +Activer le daemon « centreon-vmware » au démarrage: +:: + + # chkconfig --level 2345 centreon_vmware on + +Installer le client et les dépendances: +:: + + # git clone http://git.centreon.com/centreon-plugins.git + # cd centreon-plugins + # mkdir -p /usr/lib/nagios/plugins/centreon/plugins/ + # cp -R centreon/plugins/* /usr/lib/nagios/plugins/centreon/plugins/ + # mkdir -p /usr/lib/nagios/plugins/apps/vmware/ + # cp -R apps/vmware/* /usr/lib/nagios/plugins/apps/vmware/ + # cp centreon_plugins.pl /usr/lib/nagios/plugins/ diff --git a/connectors/vmware/packaging/centreon-plugin-virtualization-vmware-daemon.yaml b/connectors/vmware/packaging/centreon-plugin-virtualization-vmware-daemon.yaml new file mode 100644 index 000000000..8e54f62c1 --- /dev/null +++ b/connectors/vmware/packaging/centreon-plugin-virtualization-vmware-daemon.yaml @@ -0,0 +1,100 @@ +name: "centreon-plugin-Virtualization-VMWare-daemon" +arch: "all" +platform: "linux" +version_schema: "none" +version: "${VERSION}" +release: "${RELEASE}${DIST}" +section: "default" +priority: "optional" +maintainer: "Centreon <contact@centreon.com>" +description: | + Perl daemon to monitor VSphere Infrastructure + Commit: @COMMIT_HASH@ +vendor: "Centreon" +homepage: "https://centreon.com" +license: "Apache-2.0" + +replaces: + - ces-plugins-Virtualization-VMWare-daemon + - centreon-plugin-Virtualisation-VMWare-daemon +conflicts: + - ces-plugins-Virtualization-VMWare-daemon + - centreon-plugin-Virtualisation-VMWare-daemon +provides: + - ces-plugins-Virtualization-VMWare-daemon + - centreon-plugin-Virtualisation-VMWare-daemon + +contents: + - src: "../src/centreon/vmware" + dst: "/usr/share/perl5/vendor_perl/centreon/vmware" + packager: rpm + - src: "../src/centreon/vmware" + dst: "/usr/share/perl5/centreon/vmware" + packager: deb + + - src: "../src/centreon/script/centreon_vmware.pm" + dst: "/usr/share/perl5/vendor_perl/centreon/script/centreon_vmware.pm" + packager: rpm + - src: "../src/centreon/script/centreon_vmware.pm" + dst: "/usr/share/perl5/centreon/script/centreon_vmware.pm" + packager: deb + + - src: "../src/centreon_vmware.pl" + dst: "/usr/bin/centreon_vmware.pl" + file_info: + mode: 0755 + + - src: "redhat/centreon_vmware-systemd" + dst: "/etc/systemd/system/centreon_vmware.service" + file_info: + mode: 0755 + packager: rpm + - src: "debian/centreon_vmware-systemd" + dst: "/lib/systemd/system/centreon_vmware.service" + file_info: + mode: 0755 + packager: deb + + - src: "redhat/centreon_vmware-sysconfig" + dst: "/etc/sysconfig/centreon_vmware" + packager: rpm + - src: "debian/centreon_vmware-default" + dst: "/etc/default/centreon_vmware" + packager: deb + + - src: "config/centreon_vmware-conf.pm" + dst: "/etc/centreon/centreon_vmware.pm" + type: config|noreplace + packager: rpm + - src: "config/centreon_vmware-conf.pm" + dst: "/etc/centreon/centreon_vmware.pm.new" + packager: deb + +scripts: + postinstall: ./scripts/postinstall.sh + +overrides: + rpm: + depends: + - perl-VMware-vSphere >= 5.1 + - perl(ZMQ::LibZMQ4) + - perl(ZMQ::Constants) + - perl(LWP::Protocol::https) + - perl(IO::Socket::INET6) + - perl(JSON::XS) + - perl-Net-Curl + deb: + depends: + - perl-vmware-vsphere + - libzmq-libzmq4-perl + - libzmq-constants-perl + - liblwp-protocol-https-perl + - libio-socket-inet6-perl + - libjson-xs-perl + - libnet-curl-perl + - libtext-template-perl + +rpm: + signature: + key_file: ${RPM_SIGNING_KEY_FILE} + key_id: ${RPM_SIGNING_KEY_ID} diff --git a/connectors/vmware/packaging/config/centreon_vmware-conf.pm b/connectors/vmware/packaging/config/centreon_vmware-conf.pm new file mode 100644 index 000000000..f8ffae8cd --- /dev/null +++ b/connectors/vmware/packaging/config/centreon_vmware-conf.pm @@ -0,0 +1,10 @@ + +%centreon_vmware_config = ( + vsphere_server => { + 'default' => {'url' => 'https://vcenter/sdk', + 'username' => 'XXXXXX', + 'password' => 'XXXXXX'} + } +); + +1; diff --git a/connectors/vmware/packaging/debian/centreon_vmware-default b/connectors/vmware/packaging/debian/centreon_vmware-default new file mode 100644 index 000000000..e67053299 --- /dev/null +++ b/connectors/vmware/packaging/debian/centreon_vmware-default @@ -0,0 +1,2 @@ +# centreon_vmware command line options +OPTIONS="--logfile=/var/log/centreon_vmware.log --severity=error" \ No newline at end of file diff --git a/connectors/vmware/packaging/debian/centreon_vmware-init b/connectors/vmware/packaging/debian/centreon_vmware-init new file mode 100644 index 000000000..7a44d6d80 --- /dev/null +++ b/connectors/vmware/packaging/debian/centreon_vmware-init @@ -0,0 +1,105 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: centreon_vmware.pl +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Should-Start: +# Should-Stop: +# Short-Description: Start daemon centreon_vmware.pl at boot +# Description: +### END INIT INFO + +PKGNAME=centreon_vmware +DESC="centreon-vmware" +DAEMON=/usr/bin/centreon_vmware.pl +PIDFILE=/var/run/centreon/centreon_vmware.pid +FOLDER=/var/run/centreon/ +if [ ! -d "$FOLDER" ]; then # Control will enter here if $DIRECTORY doesn't exist. + mkdir $FOLDER +fi + +if [ ! -x "${DAEMON}" ]; then + echo "The program ${DAEMON} does not exists or is not executable" + exit 3 +fi + +# Include the default user configuration if exists +[ -r /etc/default/${PKGNAME} ] && . /etc/default/${PKGNAME} + +# Load the VERBOSE setting and other rcS variables +[ -f /etc/init/vars.sh ] && . /etc/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +if [ -z "${RUN_AT_STARTUP}" -o "${RUN_AT_STARTUP}" != "YES" ]; then + log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it." + exit 0 +fi + +if [ -z "${CENTREON_USER}" ]; then + log_warning_msg "Not starting $PKGNAME, CENTREON_USER not set in /etc/default/$PKGNAME." + exit 0 +fi + +do_start() +{ + start-stop-daemon --start --background --quiet --pidfile ${PIDFILE} --exec ${DAEMON} \ + --chuid ${CENTREON_USER} --user ${CENTREON_USER} --test -- $OPTIONS + [ "$?" = "0" ] || return 1 + start-stop-daemon --start --background --quiet --pidfile ${PIDFILE} --exec ${DAEMON} \ + --make-pidfile --chuid ${CENTREON_USER} --user ${CENTREON_USER} -- $OPTIONS + [ "$?" = "0" ] || return 2 + return 0 +} + +do_stop() +{ + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user ${CENTREON_USER} --pidfile ${PIDFILE} + [ "$?" = "2" ] && return 2 + rm -rf ${PIDFILE} + [ "$?" = 0 ] && return 0 || return 1 +} + +case "$1" in + start) + [ "${VERBOSE}" != "no" ] && log_daemon_msg "Starting ${DESC}" "${PKGNAME}" + do_start + case "$?" in + 0|1) [ "${VERBOSE}" != "no" ] && log_end_msg 0 ;; + 2) [ "${VERBOSE}" != "no" ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "${VERBOSE}" != no ] && log_daemon_msg "Stopping ${DESC}" "${PKGNAME}" + do_stop + case "$?" in + 0|1) [ "${VERBOSE}" != no ] && log_end_msg 0 ;; + 2) [ "${VERBOSE}" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc ${DAEMON} ${PKGNAME} -p ${PIDFILE} + ;; + restart|force-reload) + [ "${VERBOSE}" != no ] && log_daemon_msg "Restarting ${DESC}" "${PKGNAME}" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; + *) log_end_msg 1 ;; + esac + ;; + *) log_end_msg 1 ;; + esac + ;; + *) + echo "Usage: ${SCRIPTNAME} (start|stop|status|restart|force-reload)" >&2 + exit 3 +esac \ No newline at end of file diff --git a/connectors/vmware/packaging/debian/centreon_vmware-systemd b/connectors/vmware/packaging/debian/centreon_vmware-systemd new file mode 100644 index 000000000..c0660a430 --- /dev/null +++ b/connectors/vmware/packaging/debian/centreon_vmware-systemd @@ -0,0 +1,27 @@ +## Copyright 2016 Centreon +## +## 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. +## +## For more information : contact@centreon.com +## + +[Unit] +Description=Centreon VMWare + +[Service] +ExecStart=/usr/bin/perl /usr/bin/centreon_vmware.pl --logfile=/var/log/centreon/centreon_vmware.log --severity=error +Type=simple +User=centreon + +[Install] +WantedBy=multi-user.target diff --git a/connectors/vmware/packaging/redhat/centreon_vmware-init b/connectors/vmware/packaging/redhat/centreon_vmware-init new file mode 100644 index 000000000..dd48e48c6 --- /dev/null +++ b/connectors/vmware/packaging/redhat/centreon_vmware-init @@ -0,0 +1,132 @@ +#! /bin/bash +# +# centreon_vmware Start/Stop the centreon_vmware daemon. +# +# chkconfig: 2345 80 20 +# description: centreon_vmware is a Centreon program that manage Vpshere Checks +# processname: centreon_vmware.pl +# config: /etc/centreon/centreon_vmware.pm +# pidfile: /var/run/centreon_vmware.pid + +# Source function library. +. /etc/init.d/functions + +binary=/usr/bin/centreon_vmware.pl +servicename=$(basename "$0") +OPTIONS="" +user=root +timeout=60 +start_timeout=5 + +pidfile=/var/run/centreon_vmware.pid + +[ -e /etc/sysconfig/centreon_vmware ] && . /etc/sysconfig/centreon_vmware + +# Check if we can find the binary. +if [ ! -x $binary ]; then + echo -n $"Starting $servicename."; + failure $"Executable file $binary not found. Exiting." + echo + exit 2 +fi + +start() { + echo -n $"Starting $servicename: " + if [ -e "$pidfile" ] && [ -n "$(cat $pidfile)" ] && [ -e "/proc/`cat $pidfile`" ]; then + echo -n $"cannot start $servicename: $servicename is already running."; + failure $"cannot start $servicename: $servicename already running."; + echo + return 1 + fi + if [ ! -e "$pidfile" ] ; then + pid=$(pidofproc $binary) + if [ -n "$pid" ] ; then + echo -n $"cannot start $servicename: $servicename is already running."; + failure $"cannot start $servicename: $servicename already running."; + echo + return 1 + fi + fi + + if [ "$(id -u -n)" = "$user" ] ; then + daemon --check centreon_vmware ''$binary' '$OPTIONS' > /dev/null 2>&1 &' + else + daemon --user $user --check centreon_vmware ''$binary' '$OPTIONS' > /dev/null 2>&1 &' + fi + + sleep 2 + + i=0 + while : ; do + if [ "$i" -gt $start_timeout ] ; then + failure $"service not launched" + echo + return 1 + fi + pid=$(pidofproc $binary) + if [ -n "$pid" ] ; then + echo $pid > $pidfile + break + fi + sleep 1 + i=$(($i + 1)) + done + success $"service launched" + echo + return 0 +} + +stop() { + echo -n $"Stopping $servicename: " + if [ ! -e "$pidfile" ] || [ -z "$(cat $pidfile)" ] ; then + killproc -d $timeout "$binary" + else + killproc -p "$pidfile" -d $timeout "$binary" + fi + RETVAL=$? + echo + return $RETVAL +} + +rhstatus() { + status -p "$pidfile" "$binary" +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading $servicename daemon configuration: " + killproc -p "$pidfile" "$binary" -HUP + RETVAL=$? + echo + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + rhstatus + ;; + condrestart) + [ -f /var/lock/subsys/centreon_vmware ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" + exit 1 +esac + + diff --git a/connectors/vmware/packaging/redhat/centreon_vmware-sysconfig b/connectors/vmware/packaging/redhat/centreon_vmware-sysconfig new file mode 100644 index 000000000..0d8a63ddb --- /dev/null +++ b/connectors/vmware/packaging/redhat/centreon_vmware-sysconfig @@ -0,0 +1,2 @@ +# centreon_vmware command line options +OPTIONS="--logfile=/var/log/centreon/centreon_vmware.log --severity=error" \ No newline at end of file diff --git a/connectors/vmware/packaging/redhat/centreon_vmware-systemd b/connectors/vmware/packaging/redhat/centreon_vmware-systemd new file mode 100644 index 000000000..c0660a430 --- /dev/null +++ b/connectors/vmware/packaging/redhat/centreon_vmware-systemd @@ -0,0 +1,27 @@ +## Copyright 2016 Centreon +## +## 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. +## +## For more information : contact@centreon.com +## + +[Unit] +Description=Centreon VMWare + +[Service] +ExecStart=/usr/bin/perl /usr/bin/centreon_vmware.pl --logfile=/var/log/centreon/centreon_vmware.log --severity=error +Type=simple +User=centreon + +[Install] +WantedBy=multi-user.target diff --git a/connectors/vmware/packaging/scripts/postinstall.sh b/connectors/vmware/packaging/scripts/postinstall.sh new file mode 100644 index 000000000..33b8a2557 --- /dev/null +++ b/connectors/vmware/packaging/scripts/postinstall.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$1" = "configure" ]; then # deb + if [ ! -f "/etc/centreon/centreon_vmware.pm" ]; then + mv /etc/centreon/centreon_vmware.pm.new /etc/centreon/centreon_vmware.pm + fi +fi diff --git a/connectors/vmware/src/centreon/script/centreon_vmware.pm b/connectors/vmware/src/centreon/script/centreon_vmware.pm new file mode 100644 index 000000000..a82c46432 --- /dev/null +++ b/connectors/vmware/src/centreon/script/centreon_vmware.pm @@ -0,0 +1,613 @@ +#!/usr/bin/perl +# Copyright 2015 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 centreon::script::centreon_vmware; + +use strict; +use warnings; +use VMware::VIRuntime; +use VMware::VILib; +use ZMQ::LibZMQ4; +use ZMQ::Constants qw(:all); +use File::Basename; +use Digest::MD5 qw(md5_hex); +use POSIX ":sys_wait_h"; +use JSON::XS; +use centreon::vmware::script; +use centreon::vmware::common; +use centreon::vmware::connector; + +my ($centreon_vmware, $frontend); + +BEGIN { + # In new version version of LWP (version 6), the backend is now 'IO::Socket::SSL' (instead Crypt::SSLeay) + # it's a hack if you unset that + #$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL"; + + # The option is not omit to verify the certificate chain. + $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; + + eval { + # required for new IO::Socket::SSL versions + require IO::Socket::SSL; + IO::Socket::SSL->import(); + IO::Socket::SSL::set_ctx_defaults( SSL_verify_mode => 0, SSL_no_shutdown => 1 ); + }; +} + +use base qw(centreon::vmware::script); +use vars qw(%centreon_vmware_config); + +my $VERSION = '3.2.5'; +my %handlers = (TERM => {}, HUP => {}, CHLD => {}); + +my @load_modules = ( + 'centreon::vmware::cmdalarmdatacenter', + 'centreon::vmware::cmdalarmhost', + 'centreon::vmware::cmdcountvmhost', + 'centreon::vmware::cmdcpucluster', + 'centreon::vmware::cmdcpuhost', + 'centreon::vmware::cmdcpuvm', + 'centreon::vmware::cmddatastorecountvm', + 'centreon::vmware::cmddatastoreio', + 'centreon::vmware::cmddatastoreiops', + 'centreon::vmware::cmddatastorehost', + 'centreon::vmware::cmddatastoresnapshot', + 'centreon::vmware::cmddatastorevm', + 'centreon::vmware::cmddatastoreusage', + 'centreon::vmware::cmddevicevm', + 'centreon::vmware::cmddiscovery', + 'centreon::vmware::cmdgetmap', + 'centreon::vmware::cmdhealthhost', + 'centreon::vmware::cmdlicenses', + 'centreon::vmware::cmdlimitvm', + 'centreon::vmware::cmdlistclusters', + 'centreon::vmware::cmdlistdatacenters', + 'centreon::vmware::cmdlistdatastores', + 'centreon::vmware::cmdlistnichost', + 'centreon::vmware::cmdmemhost', + 'centreon::vmware::cmdmaintenancehost', + 'centreon::vmware::cmdmemvm', + 'centreon::vmware::cmdnethost', + 'centreon::vmware::cmdnetvm', + 'centreon::vmware::cmdservicehost', + 'centreon::vmware::cmdsnapshotvm', + 'centreon::vmware::cmdstatuscluster', + 'centreon::vmware::cmdstatushost', + 'centreon::vmware::cmdstatusvm', + 'centreon::vmware::cmdstoragehost', + 'centreon::vmware::cmdswaphost', + 'centreon::vmware::cmdswapvm', + 'centreon::vmware::cmdthinprovisioningvm', + 'centreon::vmware::cmdtimehost', + 'centreon::vmware::cmdtoolsvm', + 'centreon::vmware::cmduptimehost', + 'centreon::vmware::cmdvmoperationcluster', + 'centreon::vmware::cmdvsanclusterusage' +); + +sub new { + my $class = shift; + my $self = $class->SUPER::new('centreon_vmware'); + + bless $self, $class; + $self->add_options( + 'config-extra=s' => \$self->{opt_extra} + ); + + %{$self->{centreon_vmware_default_config}} = + ( + credstore_use => 0, + credstore_file => '/root/.vmware/credstore/vicredentials.xml', + timeout_vsphere => 60, + timeout => 60, + timeout_kill => 30, + dynamic_timeout_kill => 86400, + refresh_keeper_session => 15, + bind => '*', + port => 5700, + ipc_file => '/tmp/centreon_vmware/routing.ipc', + case_insensitive => 0, + vsphere_server => { + #'default' => {'url' => 'https://XXXXXX/sdk', + # 'username' => 'XXXXX', + # 'password' => 'XXXXX'}, + #'testvc' => {'url' => 'https://XXXXXX/sdk', + # 'username' => 'XXXXX', + # 'password' => 'XXXXXX'} + }, + vsan_sdk_path => '/usr/local/share/perl5/VMware' + ); + + $self->{return_child} = {}; + $self->{stop} = 0; + $self->{childs_vpshere_pid} = {}; + $self->{counter_stats} = {}; + $self->{whoaim} = undef; # to know which vsphere to connect + $self->{modules_registry} = {}; + + return $self; +} + +sub init { + my $self = shift; + $self->SUPER::init(); + + # redefine to avoid out when we try modules + $SIG{__DIE__} = undef; + + if (!defined($self->{opt_extra})) { + $self->{opt_extra} = "/etc/centreon/centreon_vmware.pm"; + } + if (-f $self->{opt_extra}) { + require $self->{opt_extra}; + } else { + $self->{logger}->writeLogInfo("Can't find extra config file $self->{opt_extra}"); + } + + $self->{centreon_vmware_config} = {%{$self->{centreon_vmware_default_config}}, %centreon_vmware_config}; + + foreach my $name (keys %{$self->{centreon_vmware_config}->{vsphere_server}}) { + my $iname = lc($name); + $self->{centreon_vmware_config}->{vsphere_server}->{$iname} = delete $self->{centreon_vmware_config}->{vsphere_server}->{$name}; + } + + ##### Load modules + $self->load_module(@load_modules); + + $self->{vsan_enabled} = 0; + eval { + centreon::vmware::common::load_vsanmgmt_binding_files( + path => $self->{centreon_vmware_config}->{vsan_sdk_path}, + files => ['VIM25VsanmgmtStub.pm', 'VIM25VsanmgmtRuntime.pm'], + ); + $self->{vsan_enabled} = 1; + }; + + ##### credstore check ##### + if (defined($self->{centreon_vmware_config}->{credstore_use}) && defined($self->{centreon_vmware_config}->{credstore_file}) && + $self->{centreon_vmware_config}->{credstore_use} == 1 && -e "$self->{centreon_vmware_config}->{credstore_file}") { + eval 'require VMware::VICredStore'; + if ($@) { + $self->{logger}->writeLogError("Could not load module VMware::VICredStore"); + exit(1); + } + require VMware::VICredStore; + + if (VMware::VICredStore::init(filename => $self->{centreon_vmware_config}->{credstore_file}) == 0) { + $self->{logger}->writeLogError("Credstore init failed: $@"); + exit(1); + } + + ### + # Get password + ### + foreach (keys %{$self->{centreon_vmware_config}->{vsphere_server}}) { + my $lpassword = VMware::VICredStore::get_password(server => $_, username => $self->{centreon_vmware_config}->{vsphere_server}->{$_}->{username}); + if (!defined($lpassword)) { + $self->{logger}->writeLogError("Can't get password for couple host='" . $_ . "', username='" . $self->{centreon_vmware_config}->{vsphere_server}->{$_}->{username} . "' : $@"); + exit(1); + } + $self->{centreon_vmware_config}->{vsphere_server}->{$_}->{password} = $lpassword; + } + } + + $self->set_signal_handlers; +} + +sub set_signal_handlers { + my $self = shift; + + $SIG{TERM} = \&class_handle_TERM; + $handlers{TERM}->{$self} = sub { $self->handle_TERM() }; + $SIG{HUP} = \&class_handle_HUP; + $handlers{HUP}->{$self} = sub { $self->handle_HUP() }; + $SIG{CHLD} = \&class_handle_CHLD; + $handlers{CHLD}->{$self} = sub { $self->handle_CHLD() }; +} + +sub class_handle_TERM { + foreach (keys %{$handlers{TERM}}) { + &{$handlers{TERM}->{$_}}(); + } +} + +sub class_handle_HUP { + foreach (keys %{$handlers{HUP}}) { + &{$handlers{HUP}->{$_}}(); + } +} + +sub class_handle_CHLD { + foreach (keys %{$handlers{CHLD}}) { + &{$handlers{CHLD}->{$_}}(); + } +} + +sub handle_TERM { + my $self = shift; + $self->{logger}->writeLogInfo("$$ Receiving order to stop..."); + $self->{stop} = 1; + + foreach (keys %{$self->{childs_vpshere_pid}}) { + kill('TERM', $_); + $self->{logger}->writeLogInfo("Send -TERM signal to '" . $self->{childs_vpshere_pid}->{$_} . "' process.."); + } +} + +sub handle_HUP { + my $self = shift; + $self->{logger}->writeLogInfo("$$ Receiving order to reload..."); + # TODO +} + +sub handle_CHLD { + my $self = shift; + my $child_pid; + + while (($child_pid = waitpid(-1, &WNOHANG)) > 0) { + $self->{return_child}{$child_pid} = {status => 1, rtime => time()}; + } + + $SIG{CHLD} = \&class_handle_CHLD; +} + +sub load_module { + my $self = shift; + + for (@_) { + (my $file = "$_.pm") =~ s{::}{/}g; + require $file; + my $obj = $_->new(logger => $self->{logger}, case_insensitive => $self->{centreon_vmware_config}->{case_insensitive}); + $self->{modules_registry}->{ $obj->getCommandName() } = $obj; + } +} + +sub verify_child_vsphere { + my $self = shift; + + # Some dead process. need to relaunch it + foreach (keys %{$self->{return_child}}) { + delete $self->{return_child}->{$_}; + + if (defined($self->{childs_vpshere_pid}->{$_})) { + if ($self->{stop} == 0) { + my $name = $self->{childs_vpshere_pid}->{$_}; + $self->{logger}->writeLogError("Sub-process for '" . $self->{childs_vpshere_pid}->{$_} . "'???!! we relaunch it!!!"); + + if ($self->{centreon_vmware_config}->{vsphere_server}->{$self->{childs_vpshere_pid}->{$_}}->{dynamic} == 0) { + # Can have the same pid (so we delete before) + delete $self->{childs_vpshere_pid}->{$_}; + $self->create_vsphere_child(vsphere_name => $name, dynamic => 0); + } else { + $self->{logger}->writeLogError("Sub-process for '" . $self->{childs_vpshere_pid}->{$_} . "' is dead. But we don't relaunch it (dynamic sub-process)"); + delete $self->{centreon_vmware_config}->{vsphere_server}->{$self->{childs_vpshere_pid}->{$_}}; + delete $self->{childs_vpshere_pid}->{$_}; + } + } else { + $self->{logger}->writeLogInfo("Sub-process for '" . $self->{childs_vpshere_pid}->{$_} . "' dead ???!!"); + $self->{centreon_vmware_config}->{vsphere_server}->{$self->{childs_vpshere_pid}->{$_}}->{running} = 0; + delete $self->{childs_vpshere_pid}->{$_}; + } + } + } + + my $count = 0; + foreach (keys %{$self->{centreon_vmware_config}->{vsphere_server}}) { + if ($self->{centreon_vmware_config}->{vsphere_server}->{$_}->{running} == 1) { + $count++; + } + if ($self->{centreon_vmware_config}->{vsphere_server}->{$_}->{dynamic} == 1 && + time() - $self->{centreon_vmware_config}->{dynamic_timeout_kill} > $self->{centreon_vmware_config}->{vsphere_server}->{$_}->{last_request}) { + $self->{logger}->writeLogError("Send TERM signal for process '" . $_ . "': too many times without requests. We clean it."); + kill('TERM', $self->{centreon_vmware_config}->{vsphere_server}->{$_}->{pid}); + } + } + + return $count; +} + +sub waiting_ready { + my ($self, %options) = @_; + + return 1 if ($self->{centreon_vmware_config}->{vsphere_server}->{$options{container}}->{ready} == 1); + + # Need to check if we need to relaunch (maybe it can have a problem) + $self->check_childs(); + + my $time = time(); + # We wait 10 seconds + while ($self->{centreon_vmware_config}->{vsphere_server}->{$options{container}}->{ready} == 0 && + time() - $time < 10) { + zmq_poll($self->{poll}, 5000); + } + + if ($self->{centreon_vmware_config}->{vsphere_server}->{$options{container}}->{ready} == 0) { + centreon::vmware::common::set_response(code => -1, short_message => "connector still not ready."); + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $options{identity}); + return 0; + } + + return 1; +} + +sub request_dynamic { + my ($self, %options) = @_; + + if (!defined($options{result}->{vsphere_username}) || $options{result}->{vsphere_username} eq '' || + !defined($options{result}->{vsphere_password}) || $options{result}->{vsphere_password} eq '') { + centreon::vmware::common::set_response(code => -1, short_message => "Please set vsphere username or password"); + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $options{identity}); + return ; + } + + my $container = md5_hex($options{result}->{vsphere_address} . $options{result}->{vsphere_username} . $options{result}->{vsphere_password}); + # Need to create fork + if (!defined($self->{centreon_vmware_config}->{vsphere_server}->{$container})) { + $self->{centreon_vmware_config}->{vsphere_server}->{$container} = { + url => 'https://' . $options{result}->{vsphere_address} . '/sdk', + username => $options{result}->{vsphere_username}, + password => $options{result}->{vsphere_password}, + last_request => time() + }; + $self->{logger}->writeLogError( + sprintf( + "Dynamic creation: identity = %s [address: %s] [username: %s] [password: %s]", + $container, $options{result}->{vsphere_address}, $options{result}->{vsphere_username}, $options{result}->{vsphere_password} + ) + ); + $centreon_vmware->create_vsphere_child(vsphere_name => $container, dynamic => 1); + } + + return if ($self->waiting_ready( + container => $container, manager => $options{manager}, + identity => $options{identity}) == 0); + + $self->{centreon_vmware_config}->{vsphere_server}->{$container}->{last_request} = time(); + + my $flag = ZMQ_NOBLOCK | ZMQ_SNDMORE; + my $msg = zmq_msg_init_data("server-" . $container); + zmq_msg_send($msg, $frontend, $flag); + zmq_msg_close($msg); + $msg = zmq_msg_init_data('REQCLIENT ' . $options{data}); + zmq_msg_send($msg, $frontend, ZMQ_NOBLOCK); + zmq_msg_close($msg); +} + +sub request { + my ($self, %options) = @_; + + # Decode json + my $result; + eval { + $result = JSON::XS->new->utf8->decode($options{data}); + }; + if ($@) { + centreon::vmware::common::set_response(code => 1, short_message => "Cannot decode json result: $@"); + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $options{identity}); + return ; + } + if ($result->{command} eq 'stats') { + centreon::vmware::common::stats_info(counters => $self->{counter_stats}); + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $options{identity}); + return ; + } + if (!defined($self->{modules_registry}->{ $result->{command} })) { + centreon::vmware::common::set_response(code => 1, short_message => "Unknown method name '$result->{command}'"); + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $options{identity}); + return ; + } + if ($self->{modules_registry}->{ $result->{command} }->checkArgs( + manager => $options{manager}, + arguments => $result)) { + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $options{identity}); + return ; + } + + # Mode dynamic + if (defined($result->{vsphere_address}) && $result->{vsphere_address} ne '') { + $self->request_dynamic(result => $result, %options); + return ; + } + + $result->{container} = lc($result->{container}); + if (!defined($self->{centreon_vmware_config}->{vsphere_server}->{ $result->{container} })) { + centreon::vmware::common::set_response(code => 1, short_message => "Unknown container name '$result->{container}'"); + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $options{identity}); + return ; + } + + return if ($self->waiting_ready( + container => $result->{container}, manager => $options{manager}, + identity => $options{identity}) == 0); + + $self->{counter_stats}->{ $result->{container} }++; + + my $flag = ZMQ_NOBLOCK | ZMQ_SNDMORE; + my $msg = zmq_msg_init_data('server-' . $result->{container}); + zmq_msg_send($msg, $frontend, $flag); + zmq_msg_close($msg); + $msg = zmq_msg_init_data('REQCLIENT ' . $options{data}); + zmq_msg_send($msg, $frontend, ZMQ_NOBLOCK); + zmq_msg_close($msg); +} + +sub repserver { + my ($self, %options) = @_; + + # Decode json + my $result; + eval { + $result = JSON::XS->new->utf8->decode($options{data}); + }; + if ($@) { + $self->{logger}->writeLogError("Cannot decode JSON: $@ (options{data}"); + return ; + } + + $result->{identity} =~ /^client-(.*)$/; + my $identity = 'client-' . pack('H*', $1); + + centreon::vmware::common::response( + token => 'RESPSERVER', endpoint => $frontend, + identity => $identity, force_response => $options{data} + ); +} + +sub router_event { + while (1) { + # Process all parts of the message + my $msg = zmq_msg_init(); + zmq_msg_recv($msg, $frontend, ZMQ_DONTWAIT); + my $identity = zmq_msg_data($msg); + zmq_msg_close($msg); + + $msg = zmq_msg_init(); + zmq_msg_recv($msg, $frontend, ZMQ_DONTWAIT); + my $data = zmq_msg_data($msg); + zmq_msg_close($msg); + + centreon::vmware::common::init_response(); + if ($centreon_vmware->{stop} != 0) { + # We quit so we say we're leaving ;) + centreon::vmware::common::set_response(code => -1, short_message => 'Daemon is restarting/stopping...'); + centreon::vmware::common::response(token => 'RESPSERVER', endpoint => $frontend, identity => $identity); + } elsif ($data =~ /^REQCLIENT\s+(.*)$/msi) { + $centreon_vmware->request(identity => $identity, data => $1); + } elsif ($data =~ /^RESPSERVER2\s+(.*)$/msi) { + $centreon_vmware->repserver(data => $1); + } elsif ($data =~ /^READY/msi) { + $identity =~ /server-(.*)/; + $centreon_vmware->{centreon_vmware_config}->{vsphere_server}->{$1}->{ready} = 1; + } + + centreon::vmware::common::free_response(); + my $more = zmq_getsockopt($frontend, ZMQ_RCVMORE); + last unless $more; + } +} + +sub check_childs { + my ($self, %options) = @_; + + my $count = $self->verify_child_vsphere(); + if ($self->{stop} == 1) { + # No childs + if ($count == 0) { + $self->{logger}->writeLogInfo("Quit main process"); + zmq_close($frontend); + exit(0); + } + } +} + +sub create_vsphere_child { + my ($self, %options) = @_; + + $self->{whoaim} = $options{vsphere_name}; + $self->{centreon_vmware_config}->{vsphere_server}->{$self->{whoaim}}->{running} = 0; + $self->{centreon_vmware_config}->{vsphere_server}->{$self->{whoaim}}->{ready} = 0; + $self->{logger}->writeLogInfo("Create vsphere sub-process for '" . $options{vsphere_name} . "'"); + + my $child_vpshere_pid = fork(); + if (!defined($child_vpshere_pid)) { + $self->{logger}->writeLogError("Cannot fork for '" . $options{vsphere_name} . "': $!"); + return -1; + } + if ($child_vpshere_pid == 0) { + my $connector = centreon::vmware::connector->new( + name => $self->{whoaim}, + modules_registry => $self->{modules_registry}, + config => $self->{centreon_vmware_config}, + logger => $self->{logger}, + vsan_enabled => $self->{vsan_enabled} + ); + $connector->run(); + exit(0); + } + $self->{childs_vpshere_pid}->{$child_vpshere_pid} = $self->{whoaim}; + $self->{centreon_vmware_config}->{vsphere_server}->{$self->{whoaim}}->{running} = 1; + $self->{centreon_vmware_config}->{vsphere_server}->{$self->{whoaim}}->{dynamic} = $options{dynamic}; + $self->{centreon_vmware_config}->{vsphere_server}->{$self->{whoaim}}->{pid} = $child_vpshere_pid; +} + +sub bind_ipc { + my ($self, %options) = @_; + + if (zmq_bind($options{socket}, 'ipc://' . $options{ipc_file}) == -1) { + $self->{logger}->writeLogError("Cannot bind ipc '$options{ipc_file}': $!"); + # try create dir + $self->{logger}->writeLogError("Maybe directory does not exist. Attempting to create it!!!"); + if (!mkdir(dirname($options{ipc_file}))) { + zmq_close($options{socket}); + exit(1); + } + if (zmq_bind($options{socket}, 'ipc://' . $options{ipc_file}) == -1) { + zmq_close($options{socket}); + exit(1); + } + } +} + +sub run { + $centreon_vmware = shift; + + $centreon_vmware->SUPER::run(); + $centreon_vmware->{logger}->redirect_output(); + + $centreon_vmware->{logger}->writeLogDebug("centreon_vmware launched...."); + $centreon_vmware->{logger}->writeLogDebug("PID: $$"); + + my $context = zmq_init(); + $frontend = zmq_socket($context, ZMQ_ROUTER); + if (!defined($frontend)) { + $centreon_vmware->{logger}->writeLogError("Can't setup server: $!"); + exit(1); + } + + zmq_setsockopt($frontend, ZMQ_LINGER, 0); # we discard + zmq_bind($frontend, 'tcp://' . $centreon_vmware->{centreon_vmware_config}->{bind} . ':' . $centreon_vmware->{centreon_vmware_config}->{port}); + $centreon_vmware->bind_ipc(socket => $frontend, ipc_file => $centreon_vmware->{centreon_vmware_config}->{ipc_file}); + + foreach (keys %{$centreon_vmware->{centreon_vmware_config}->{vsphere_server}}) { + $centreon_vmware->{counter_stats}->{$_} = 0; + $centreon_vmware->create_vsphere_child(vsphere_name => $_, dynamic => 0); + } + + $centreon_vmware->{logger}->writeLogInfo("[Server accepting clients]"); + + # Initialize poll set + $centreon_vmware->{poll} = [ + { + socket => $frontend, + events => ZMQ_POLLIN, + callback => \&router_event + } + ]; + + # Switch messages between sockets + while (1) { + $centreon_vmware->check_childs(); + zmq_poll($centreon_vmware->{poll}, 5000); + } +} + +1; + +__END__ diff --git a/connectors/vmware/src/centreon/vmware/cisTags.pm b/connectors/vmware/src/centreon/vmware/cisTags.pm new file mode 100644 index 000000000..5d4656deb --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cisTags.pm @@ -0,0 +1,268 @@ +# +# Copyright 2019 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 centreon::vmware::cisTags; + +use strict; +use warnings; +use centreon::vmware::http::http; +use JSON::XS; + +# https://developer.vmware.com/apis/vsphere-automation/v7.0U2/cis/ + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + $self->{is_error} = 1; + $self->{error} = 'configuration missing'; + $self->{is_logged} = 0; + + return $self; +} + +sub json_decode { + my ($self, %options) = @_; + + my $decoded; + eval { + $decoded = JSON::XS->new->utf8->decode($options{content}); + }; + if ($@) { + $self->{is_error} = 1; + $self->{error} = "cannot decode json response: $@"; + return undef; + } + + return $decoded; +} + +sub error { + my ($self, %options) = @_; + + return $self->{error}; +} + +sub configuration { + my ($self, %options) = @_; + + foreach (('url', 'username', 'password')) { + if (!defined($options{$_}) || + $options{$_} eq '') { + $self->{error} = $_ . ' configuration missing'; + return 1; + } + + $self->{$_} = $options{$_}; + } + + if ($self->{url} =~ /^((?:http|https):\/\/.*?)\//) { + $self->{url} = $1; + } + + $self->{http_backend} = defined($options{backend}) ? $options{backend} : 'curl'; + + $self->{curl_opts} = ['CURLOPT_SSL_VERIFYPEER => 0', 'CURLOPT_POSTREDIR => CURL_REDIR_POST_ALL']; + my $curl_opts = []; + if (defined($options{curlopts})) { + foreach (keys %{$options{curlopts}}) { + push @{$curl_opts}, $_ . ' => ' . $options{curlopts}->{$_}; + } + } + if (scalar(@$curl_opts) > 0) { + $self->{curl_opts} = $curl_opts; + } + + $self->{http} = centreon::vmware::http::http->new(logger => $options{logger}); + $self->{is_error} = 0; + return 0; +} + +sub authenticate { + my ($self, %options) = @_; + + my ($code, $content) = $self->{http}->request( + http_backend => $self->{http_backend}, + method => 'POST', + query_form_post => '', + hostname => '', + full_url => $self->{url} . '/rest/com/vmware/cis/session', + header => [ + 'Accept-Type: application/json; charset=utf-8', + 'Content-Type: application/json; charset=utf-8', + ], + curl_opt => $self->{curl_opts}, + credentials => 1, + basic => 1, + username => $self->{username}, + password => $self->{password}, + warning_status => '', + unknown_status => '', + critical_status => '' + ); + if ($code) { + $self->{is_error} = 1; + $self->{error} = 'http request error'; + return undef; + } + if ($self->{http}->get_code() < 200 || $self->{http}->get_code() >= 300) { + $self->{is_error} = 1; + $self->{error} = "Login error [code: '" . $self->{http}->get_code() . "'] [message: '" . $self->{http}->get_message() . "']"; + return undef; + } + + my $decoded = $self->json_decode(content => $content); + return if (!defined($decoded)); + + my $token = defined($decoded->{value}) ? $decoded->{value} : undef; + if (!defined($token)) { + $self->{is_error} = 1; + $self->{error} = 'authenticate issue - cannot get token'; + return undef; + } + + $self->{token} = $token; + $self->{is_logged} = 1; +} + +sub request { + my ($self, %options) = @_; + + if (!defined($self->{url})) { + $self->{is_error} = 1; + $self->{error} = 'configuration missing'; + return 1; + } + + $self->{is_error} = 0; + if ($self->{is_logged} == 0) { + $self->authenticate(); + } + + return 1 if ($self->{is_logged} == 0); + + my ($code, $content) = $self->{http}->request( + http_backend => $self->{http_backend}, + method => $options{method}, + hostname => '', + full_url => $self->{url} . $options{endpoint}, + query_form_post => $options{query_form_post}, + get_param => $options{get_param}, + header => [ + 'Accept-Type: application/json; charset=utf-8', + 'Content-Type: application/json; charset=utf-8', + 'vmware-api-session-id: ' . $self->{token} + ], + curl_opt => $self->{curl_opts}, + warning_status => '', + unknown_status => '', + critical_status => '' + ); + + my $decoded = $self->json_decode(content => $content); + + # code 403 means forbidden (token not good maybe) + if ($self->{http}->get_code() < 200 || $self->{http}->get_code() >= 300) { + $self->{token} = undef; + $self->{is_logged} = 0; + $self->{is_error} = 1; + $self->{error} = $content; + $self->{error} = $decoded->{value}->[0]->{default_message} if (defined($decoded) && defined($decoded->{value}->[0]->{default_message})); + return 1; + } + + return 1 if (!defined($decoded)); + + return (0, $decoded); +} + +sub tagsByResource { + my ($self, %options) = @_; + + my ($code, $tag_ids) = $self->request( + method => 'GET', + endpoint => '/rest/com/vmware/cis/tagging/tag' + ); + return $code if ($code); + + my $tags = {}; + my $result = { esx => {} , vm => {} }; + if (defined($tag_ids->{value})) { + my $json_req = { tag_ids => [] }; + foreach my $tag_id (@{$tag_ids->{value}}) { + my ($code, $tag_detail) = $self->request( + method => 'GET', + endpoint => '/rest/com/vmware/cis/tagging/tag/id:' . $tag_id + ); + return $code if ($code); + + push @{$json_req->{tag_ids}}, $tag_id; + $tags->{ $tag_id } = { name => $tag_detail->{value}->{name}, description => $tag_detail->{value}->{description} }; + } + + my $data; + eval { + $data = encode_json($json_req); + }; + if ($@) { + $self->{is_error} = 1; + $self->{error} = "cannot encode json request: $@"; + return undef; + } + + my ($code, $tags_assoc) = $self->request( + method => 'POST', + endpoint => '/rest/com/vmware/cis/tagging/tag-association', + get_param => ['~action=list-attached-objects-on-tags'], + query_form_post => $data + ); + return $code if ($code); + + if (defined($tags_assoc->{value})) { + foreach my $entry (@{$tags_assoc->{value}}) { + foreach my $entity (@{$entry->{object_ids}}) { + if ($entity->{type} eq 'VirtualMachine') { + $result->{vm}->{ $entity->{id} } = [] if (!defined($result->{vm}->{ $entity->{id} })); + push @{$result->{vm}->{ $entity->{id} }}, $tags->{ $entry->{tag_id} }; + } elsif ($entity->{type} eq 'HostSystem') { + $result->{esx}->{ $entity->{id} } = [] if (!defined($result->{esx}->{ $entity->{id} })); + push @{$result->{esx}->{ $entity->{id} }}, $tags->{ $entry->{tag_id} }; + } + } + } + } + } + + return (0, $result); +} + +sub DESTROY { + my ($self) = @_; + + if ($self->{is_logged} == 1) { + $self->request( + method => 'DELETE', + endpoint => '/rest/com/vmware/cis/session' + ); + } +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdalarmdatacenter.pm b/connectors/vmware/src/centreon/vmware/cmdalarmdatacenter.pm new file mode 100644 index 000000000..e9c779dc7 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdalarmdatacenter.pm @@ -0,0 +1,77 @@ +# Copyright 2015 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 centreon::vmware::cmdalarmdatacenter; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'alarmdatacenter'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{datacenter}) && $options{arguments}->{datacenter} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datacenter cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'datacenter', is_regexp => 'filter'); + my @properties = ('name', 'triggeredAlarmState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datacenter', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $datacenter_view (@$result) { + $data->{$datacenter_view->{mo_ref}->{value}} = { name => $datacenter_view->name, red => 0, yellow => 0, alarms => {} }; + next if (!defined($datacenter_view->triggeredAlarmState)); + foreach (@{$datacenter_view->triggeredAlarmState}) { + next if ($_->overallStatus->val !~ /(red|yellow)/i); + + my $entity = centreon::vmware::common::get_view($self->{connector}, $_->entity, ['name']); + my $alarm = centreon::vmware::common::get_view($self->{connector}, $_->alarm, ['info']); + + $data->{$datacenter_view->{mo_ref}->{value}}->{alarms}->{$_->key} = { type => $_->entity->type, entity_name => $entity->name, + time => $_->time, name => $alarm->info->name, + description => $alarm->info->description, + status => $_->overallStatus->val + }; + $data->{$datacenter_view->{mo_ref}->{value}}->{$_->overallStatus->val}++; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdalarmhost.pm b/connectors/vmware/src/centreon/vmware/cmdalarmhost.pm new file mode 100644 index 000000000..23588f642 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdalarmhost.pm @@ -0,0 +1,78 @@ +# Copyright 2015 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 centreon::vmware::cmdalarmhost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'alarmhost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'triggeredAlarmState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $host_view (@$result) { + $data->{$host_view->{mo_ref}->{value}} = { name => $host_view->name, red => 0, yellow => 0, alarms => {} }; + next if (!defined($host_view->triggeredAlarmState)); + foreach(@{$host_view->triggeredAlarmState}) { + next if ($_->overallStatus->val !~ /(red|yellow)/i); + + my $entity = centreon::vmware::common::get_view($self->{connector}, $_->entity, ['name']); + my $alarm = centreon::vmware::common::get_view($self->{connector}, $_->alarm, ['info']); + + $data->{$host_view->{mo_ref}->{value}}->{alarms}->{$_->key} = { + type => $_->entity->type, entity_name => $entity->name, + time => $_->time, name => $alarm->info->name, + description => $alarm->info->description, + status => $_->overallStatus->val + }; + $data->{$host_view->{mo_ref}->{value}}->{$_->overallStatus->val}++; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdbase.pm b/connectors/vmware/src/centreon/vmware/cmdbase.pm new file mode 100644 index 000000000..0725e93f9 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdbase.pm @@ -0,0 +1,136 @@ +# Copyright 2015 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 centreon::vmware::cmdbase; + +use strict; +use warnings; +use centreon::vmware::common; +use VMware::VIRuntime; +use VMware::VILib; + +my %handlers = (ALRM => {}); + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + $self->{logger} = $options{logger}; + $self->{global_case_insensitive} = defined($options{case_insensitive}) ? $options{case_insensitive} : 0; + + return $self; +} + +sub getCommandName { + my $self = shift; + return $self->{commandName}; +} + +sub set_signal_handlers { + my $self = shift; + + $SIG{ALRM} = \&class_handle_ALRM; + $handlers{ALRM}->{$self} = sub { $self->handle_ALRM() }; +} + +sub class_handle_ALRM { + foreach (keys %{$handlers{ALRM}}) { + &{$handlers{ALRM}->{$_}}(); + } +} + +sub handle_ALRM { + my $self = shift; + + $self->{logger}->writeLogError('Child process autokill!!'); + exit(0); +} + +sub is_vsan_enabled { + my ($self, %options) = @_; + + if ($self->{connector}->{vsan_enabled} == 1) { + return 1; + } + + return 0; +} + +sub set_connector { + my ($self, %options) = @_; + + $self->{connector} = $options{connector}; + + #$self->{connector}->{session_clone} = Vim::load_session(service_url => $self->{connector}->{service_url}, session_file => '/tmp/plop.save'); + #$self->{connector}->{session_clone} = Vim->new(service_url => $self->{connector}->{service_url}); + #$self->{connector}->{session_clone}->load_session(session_file => '/tmp/plop.save'); + + $self->set_signal_handlers(); + alarm(300); +} + +sub initArgs { + my ($self, %options) = @_; + + foreach (keys %{$options{arguments}}) { + $self->{$_} = $options{arguments}->{$_}; + } + centreon::vmware::common::init_response(identity => $options{arguments}->{identity}); + + if ($self->{global_case_insensitive} == 0 && defined($self->{case_insensitive})) { + $self->{global_case_insensitive} = 1; + } +} + +sub build_filter { + my ($self, %options) = @_; + + my $filters = {}; + if (defined($self->{$options{search_option}}) && !defined($self->{$options{is_regexp}})) { + if ($self->{global_case_insensitive} == 1) { + $filters->{name} = qr/^\Q$self->{$options{search_option}}\E$/i; + } else { + $filters->{name} = qr/^\Q$self->{$options{search_option}}\E$/; + } + } elsif (!defined($self->{$options{search_option}})) { + $filters->{name} = qr/.*/; + } else { + if ($self->{global_case_insensitive} == 1) { + $filters->{name} = qr/$self->{$options{search_option}}/i; + } else { + $filters->{name} = qr/$self->{$options{search_option}}/; + } + } + + return $filters; +} + +sub add_filter { + my ($self, %options) = @_; + + if (defined($self->{$options{search_option}}) && $self->{$options{search_option}} ne '') { + if ($self->{global_case_insensitive} == 1) { + $options{filters}->{$options{label}} = qr/$self->{$options{search_option}}/i; + } else { + $options{filters}->{$options{label}} = qr/$self->{$options{search_option}}/; + } + } +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdcountvmhost.pm b/connectors/vmware/src/centreon/vmware/cmdcountvmhost.pm new file mode 100644 index 000000000..75640d781 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdcountvmhost.pm @@ -0,0 +1,94 @@ +# Copyright 2015 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 centreon::vmware::cmdcountvmhost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'countvmhost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'vm', 'runtime.connectionState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + #return if (centreon::vmware::common::host_state($self->{connector}, $self->{lhost}, + # $$result[0]->{'runtime.connectionState'}->val) == 0); + + my @vm_array = (); + foreach my $entity_view (@$result) { + if (defined($entity_view->vm)) { + @vm_array = (@vm_array, @{$entity_view->vm}); + } + } + @properties = ('runtime.powerState'); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@vm_array, \@properties); + return if (!defined($result2)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + my %vm_states = (poweredon => 0, poweredoff => 0, suspended => 0); + if (defined($entity_view->vm)) { + foreach my $vm_host (@{$entity_view->vm}) { + foreach my $vm (@{$result2}) { + if ($vm_host->{value} eq $vm->{mo_ref}->{value}) { + my $power_value = lc($vm->{'runtime.powerState'}->val); + $vm_states{$power_value}++; + last; + } + } + } + } + + $data->{$entity_value} = { %{$data->{$entity_value}}, %vm_states }; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdcpucluster.pm b/connectors/vmware/src/centreon/vmware/cmdcpucluster.pm new file mode 100644 index 000000000..ed4127e10 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdcpucluster.pm @@ -0,0 +1,97 @@ +# Copyright 2015 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 centreon::vmware::cmdcpucluster; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'cpucluster'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{cluster_name}) && $options{arguments}->{cluster_name} eq '') { + centreon::vmware::common::set_response(code => 100, short_message => 'Argument error: cluster name cannot be null'); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'cluster_name', is_regexp => 'filter'); + my @properties = ('name'); + my $views = centreon::vmware::common::search_entities(command => $self, view_type => 'ClusterComputeResource', properties => \@properties, filter => $filters); + return if (!defined($views)); + + my $values = centreon::vmware::common::generic_performance_values_historic( + $self->{connector}, + $views, + [ + { label => 'cpu.usage.average', instances => [''] }, + { label => 'cpu.usagemhz.average', instances => [''] } + ], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, + time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1 + ); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $interval_min = centreon::vmware::common::get_interval_min( + speriod => $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, + time_shift => $self->{time_shift} + ); + + my $data = {}; + foreach my $view (@$views) { + my $entity_value = $view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $view->{name} }; + + my $total_cpu_average = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{ $self->{connector}->{perfcounter_cache}->{'cpu.usage.average'}->{key} . ':' } * 0.01)); + my $total_cpu_mhz_average = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{ $self->{connector}->{perfcounter_cache}->{'cpu.usagemhz.average'}->{key} . ':' })); + + $data->{$entity_value}->{'interval_min'} = $interval_min; + $data->{$entity_value}->{'cpu.usage.average'} = $total_cpu_average; + $data->{$entity_value}->{'cpu.usagemhz.average'} = $total_cpu_mhz_average; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdcpuhost.pm b/connectors/vmware/src/centreon/vmware/cmdcpuhost.pm new file mode 100644 index 000000000..508289e34 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdcpuhost.pm @@ -0,0 +1,112 @@ +# Copyright 2015 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 centreon::vmware::cmdcpuhost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'cpuhost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'runtime.connectionState', 'summary.hardware.numCpuCores', 'summary.hardware.cpuMhz'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my @instances = ('*'); + my $values = centreon::vmware::common::generic_performance_values_historic( + $self->{connector}, + $result, + [ + { label => 'cpu.usage.average', 'instances' => \@instances}, + { label => 'cpu.usagemhz.average', 'instances' => \@instances} + ], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, + time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1 + ); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $interval_min = centreon::vmware::common::get_interval_min( + speriod => $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift} + ); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + my $total_cpu_average = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'cpu.usage.average'}->{'key'} . ":"} * 0.01)); + my $total_cpu_mhz_average = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'cpu.usagemhz.average'}->{'key'} . ":"})); + + $data->{$entity_value}->{'interval_min'} = $interval_min; + $data->{$entity_value}->{'cpu.usage.average'} = $total_cpu_average; + $data->{$entity_value}->{'cpu.usagemhz.average'} = $total_cpu_mhz_average; + $data->{$entity_value}->{'numCpuCores'} = $entity_view->{'summary.hardware.numCpuCores'}; + $data->{$entity_value}->{'cpuMhz'} = $entity_view->{'summary.hardware.cpuMhz'}; + $data->{$entity_value}->{'cpu'} = {}; + + foreach my $id (sort { my ($cida, $cia) = split /:/, $a; + my ($cidb, $cib) = split /:/, $b; + $cia = -1 if (!defined($cia) || $cia eq ""); + $cib = -1 if (!defined($cib) || $cib eq ""); + $cia <=> $cib} keys %{$values->{$entity_value}}) { + my ($counter_id, $instance) = split /:/, $id; + if ($instance ne "") { + $data->{$entity_value}->{cpu}->{$instance} = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$id}) * 0.01); + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdcpuvm.pm b/connectors/vmware/src/centreon/vmware/cmdcpuvm.pm new file mode 100644 index 000000000..a8de65599 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdcpuvm.pm @@ -0,0 +1,132 @@ +# Copyright 2015 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 centreon::vmware::cmdcpuvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'cpuvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my @instances = ('*'); + my $values = centreon::vmware::common::generic_performance_values_historic( + $self->{connector}, + $result, + [ + {'label' => 'cpu.usage.average', 'instances' => \@instances}, + {'label' => 'cpu.usagemhz.average', 'instances' => \@instances}, + {'label' => 'cpu.ready.summation', 'instances' => \@instances} + ], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1 + ); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $interval_sec = $self->{connector}->{perfcounter_speriod}; + if (defined($self->{sampling_period}) && $self->{sampling_period} ne '') { + $interval_sec = $self->{sampling_period}; + } + my $interval_min = centreon::vmware::common::get_interval_min( + speriod => $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift} + ); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_running(power => $entity_view->{'runtime.powerState'}->val) == 0); + + my $total_cpu_average = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'cpu.usage.average'}->{'key'} . ":"} * 0.01)); + my $total_cpu_mhz_average = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'cpu.usagemhz.average'}->{'key'} . ":"})); + my $total_cpu_ready = centreon::vmware::common::simplify_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'cpu.ready.summation'}->{'key'} . ":"} / ($interval_sec * 1000) * 100); + + $data->{$entity_value}->{'cpu.usage.average'} = $total_cpu_average; + $data->{$entity_value}->{'cpu.usagemhz.average'} = $total_cpu_mhz_average; + $data->{$entity_value}->{'cpu_ready'} = $total_cpu_ready; + $data->{$entity_value}->{'interval_min'} = $interval_min; + $data->{$entity_value}->{'cpu'} = {}; + + foreach my $id (sort { my ($cida, $cia) = split /:/, $a; + my ($cidb, $cib) = split /:/, $b; + $cia = -1 if (!defined($cia) || $cia eq ""); + $cib = -1 if (!defined($cib) || $cib eq ""); + $cia <=> $cib} keys %{$values->{$entity_value}}) { + my ($counter_id, $instance) = split /:/, $id; + next if ($self->{connector}->{perfcounter_cache}->{'cpu.usagemhz.average'}->{key} != $counter_id); + if ($instance ne "") { + $data->{$entity_value}->{cpu}->{$instance} = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$id})); + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddatastorecountvm.pm b/connectors/vmware/src/centreon/vmware/cmddatastorecountvm.pm new file mode 100644 index 000000000..97734b494 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddatastorecountvm.pm @@ -0,0 +1,91 @@ +# Copyright 2015 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 centreon::vmware::cmddatastorecountvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'datastorecountvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{datastore_name}) && $options{arguments}->{datastore_name} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datastore name cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'datastore_name', is_regexp => 'filter'); + my @properties = ('summary.name', 'vm', 'summary.accessible'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datastore', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my @vm_array = (); + foreach my $entity_view (@$result) { + if (defined($entity_view->vm)) { + @vm_array = (@vm_array, @{$entity_view->vm}); + } + } + @properties = ('runtime.powerState'); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@vm_array, \@properties); + return if (!defined($result2)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{'summary.name'}, accessible => $entity_view->{'summary.accessible'} }; + next if (centreon::vmware::common::is_accessible(accessible => $entity_view->{'summary.accessible'}) == 0); + + my %vm_states = (poweredon => 0, poweredoff => 0, suspended => 0); + if (defined($entity_view->vm)) { + foreach my $vm_host (@{$entity_view->vm}) { + foreach my $vm (@{$result2}) { + if ($vm_host->{value} eq $vm->{mo_ref}->{value}) { + my $power_value = lc($vm->{'runtime.powerState'}->val); + $vm_states{$power_value}++; + last; + } + } + } + } + + $data->{$entity_value} = { %{$data->{$entity_value}}, %vm_states }; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddatastorehost.pm b/connectors/vmware/src/centreon/vmware/cmddatastorehost.pm new file mode 100644 index 000000000..974fc98c2 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddatastorehost.pm @@ -0,0 +1,153 @@ +# Copyright 2015 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 centreon::vmware::cmddatastorehost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use File::Basename; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'datastorehost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + if (defined($options{arguments}->{datastore_name}) && $options{arguments}->{datastore_name} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datastore name cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'config.fileSystemVolume.mountInfo', 'runtime.connectionState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my %uuid_list = (); + #my %disk_name = (); + my $query_perfs = []; + my $ds_regexp; + if (defined($self->{datastore_name}) && !defined($self->{filter_datastore})) { + $ds_regexp = qr/^\Q$self->{datastore_name}\E$/; + } elsif (!defined($self->{datastore_name})) { + $ds_regexp = qr/.*/; + } else { + $ds_regexp = qr/$self->{datastore_name}/; + } + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val, datastore => {} }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + my $instances = []; + foreach (@{$entity_view->{'config.fileSystemVolume.mountInfo'}}) { + if ($_->volume->isa('HostVmfsVolume')) { + next if ($_->volume->name !~ /$ds_regexp/); + + $uuid_list{$_->volume->uuid} = $_->volume->name; + push @$instances, $_->volume->uuid; + # Not need. We are on Datastore level (not LUN level) + #foreach my $extent (@{$_->volume->extent}) { + # $disk_name{$extent->diskName} = $_->volume->name; + #} + } + if ($_->volume->isa('HostNasVolume')) { + next if ($_->volume->name !~ /$ds_regexp/); + + $uuid_list{basename($_->mountInfo->path)} = $_->volume->name; + push @$instances, basename($_->mountInfo->path); + } + } + + if (scalar(@$instances) > 0) { + push @$query_perfs, { + entity => $entity_view, + metrics => [ + { label => 'datastore.totalReadLatency.average', instances => $instances }, + { label => 'datastore.totalWriteLatency.average', instances => $instances } + ] + }; + } + } + + if (scalar(@$query_perfs) == 0) { + centreon::vmware::common::set_response(code => 100, short_message => "Can't get a single datastore."); + return ; + } + + # Vsphere >= 4.1 + # You get counters even if datastore is disconnect... + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + undef, + $query_perfs, + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + foreach my $entity_view (@$result) { + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + my $entity_value = $entity_view->{mo_ref}->{value}; + + my $checked = {}; + foreach (keys %{$values->{$entity_value}}) { + my ($id, $uuid) = split /:/; + next if (defined($checked->{$uuid})); + $checked->{$uuid} = 1; + + my $read_counter = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'datastore.totalReadLatency.average'}->{'key'} . ":" . $uuid})); + my $write_counter = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'datastore.totalWriteLatency.average'}->{'key'} . ":" . $uuid})); + + $data->{$entity_value}->{datastore}->{$uuid_list{$uuid}} = { + 'datastore.totalReadLatency.average' => $read_counter, + 'datastore.totalWriteLatency.average' => $write_counter, + }; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddatastoreio.pm b/connectors/vmware/src/centreon/vmware/cmddatastoreio.pm new file mode 100644 index 000000000..27cb1fcdd --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddatastoreio.pm @@ -0,0 +1,88 @@ +# Copyright 2015 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 centreon::vmware::cmddatastoreio; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'datastoreio'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{datastore_name}) && $options{arguments}->{datastore_name} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datastore name cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'datastore_name', is_regexp => 'filter'); + my @properties = ('summary.name', 'summary.accessible'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datastore', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + $result, + [{'label' => 'datastore.read.average', 'instances' => ['']}, + {'label' => 'datastore.write.average', 'instances' => ['']}], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { name => $entity_view->{'summary.name'}, accessible => $entity_view->{'summary.accessible'} }; + next if (centreon::vmware::common::is_accessible(accessible => $entity_view->{'summary.accessible'}) == 0); + + # in KBps + my $read_counter = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'datastore.read.average'}->{'key'} . ":"})) * 1024; + my $write_counter = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'datastore.write.average'}->{'key'} . ":"})) * 1024; + + $data->{$entity_value}->{'datastore.read.average'} = $read_counter; + $data->{$entity_value}->{'datastore.write.average'} = $write_counter; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddatastoreiops.pm b/connectors/vmware/src/centreon/vmware/cmddatastoreiops.pm new file mode 100644 index 000000000..965255d2c --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddatastoreiops.pm @@ -0,0 +1,256 @@ +# Copyright 2015 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 centreon::vmware::cmddatastoreiops; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'datastoreiops'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{datastore_name}) && $options{arguments}->{datastore_name} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datastore name cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'datastore_name', is_regexp => 'filter'); + my @properties = ('summary.accessible', 'summary.name', 'summary.type', 'vm', 'info'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datastore', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $ds_vsan = {}; + + my $data = {}; + #my %uuid_list = (); + my %disk_name = (); + my %datastore_lun = (); + my $ds_checked = 0; + foreach (@$result) { + $data->{$_->{'summary.name'}} = { name => $_->{'summary.name'}, accessible => $_->{'summary.accessible'}, type => $_->{'summary.type'} }; + next if (centreon::vmware::common::is_accessible(accessible => $_->{'summary.accessible'}) == 0); + + if ($_->{'summary.type'} eq 'vsan') { + $ds_vsan->{$_->{mo_ref}->{value}} = $_->{'summary.name'}; + $ds_checked = 1; + } + if ($_->info->isa('VmfsDatastoreInfo')) { + #$uuid_list{$_->volume->uuid} = $_->volume->name; + # Not need. We are on Datastore level (not LUN level) + $ds_checked = 1; + foreach my $extent (@{$_->info->vmfs->extent}) { + $disk_name{$extent->diskName} = $_->info->vmfs->name; + if (!defined($datastore_lun{$_->info->vmfs->name})) { + %{$datastore_lun{$_->info->vmfs->name}} = ('disk.numberRead.summation' => 0, 'disk.numberWrite.summation' => 0); + } + } + } + #if ($_->info->isa('NasDatastoreInfo')) { + # Zero disk Info + #} + } + + if ($ds_checked == 0) { + centreon::vmware::common::set_response(code => 100, short_message => "No Vmfs datastore(s) checked. Cannot get iops from Nas datastore(s)"); + return ; + } + + my @vm_array = (); + my %added_vm = (); + foreach my $entity_view (@$result) { + if (defined($entity_view->vm)) { + foreach (@{$entity_view->vm}) { + next if (defined($added_vm{$_->{value}})); + push @vm_array, $_; + $added_vm{$_->{value}} = 1; + } + } + } + + if (scalar(@vm_array) == 0) { + centreon::vmware::common::set_response(code => 200, short_message => "No virtual machines on the datastore"); + return ; + } + + @properties = ('name', 'summary.config.instanceUuid', 'runtime.connectionState', 'runtime.powerState'); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@vm_array, \@properties); + return if (!defined($result2)); + + # Remove disconnected or not running vm + my ($moref_vm, $uuid_vm) = ({}, {}); + for(my $i = $#{$result2}; $i >= 0; --$i) { + if (!centreon::vmware::common::is_connected(state => $result2->[$i]->{'runtime.connectionState'}->val) || + !centreon::vmware::common::is_running(power => $result2->[$i]->{'runtime.powerState'}->val)) { + splice @$result2, $i, 1; + next; + } + + $uuid_vm->{$result2->[$i]->{'summary.config.instanceUuid'}} = $result2->[$i]->{mo_ref}->{value}; + $moref_vm->{$result2->[$i]->{mo_ref}->{value}} = $result2->[$i]->{name}; + } + + if (scalar(@{$result2}) == 0) { + centreon::vmware::common::set_response(code => 200, short_message => "No active virtual machines on the datastore"); + return ; + } + + my $interval_sec = $self->{connector}->{perfcounter_speriod}; + if (defined($self->{sampling_period}) && $self->{sampling_period} ne '') { + $interval_sec = $self->{sampling_period}; + } + + # VSAN part + if ($self->is_vsan_enabled() && scalar(keys(%$ds_vsan)) > 0) { + my $vsan_performance_mgr = centreon::vmware::common::vsan_create_mo_view( + vsan_vim => $self->{connector}->{vsan_vim}, + type => 'VsanPerformanceManager', + value => 'vsan-performance-manager', + ); + my $cluster_views = centreon::vmware::common::search_entities(command => $self, view_type => 'ComputeResource', properties => ['name', 'datastore'], filter => undef); + my $clusters = {}; + foreach my $cluster_view (@$cluster_views) { + $clusters->{$cluster_view->{name}} = {}; + foreach (@{$cluster_view->{datastore}}) { + if (defined($ds_vsan->{$_->{value}})) { + $clusters->{$cluster_view->{name}}->{ds_vsan} = $ds_vsan->{$_->{value}}; + last; + } + } + + next if (!defined($clusters->{$cluster_view->{name}}->{ds_vsan})); + my $result = centreon::vmware::common::vsan_get_performances( + vsan_performance_mgr => $vsan_performance_mgr, + cluster => $cluster_view, + entityRefId => 'virtual-machine:*', + labels => ['iopsRead', 'iopsWrite'], + interval => $interval_sec, + time_shift => $self->{time_shift} + ); + + $datastore_lun{ $clusters->{$cluster_view->{name}}->{ds_vsan} } = { + 'disk.numberRead.summation' => 0, + 'disk.numberWrite.summation' => 0, + }; + # we recreate format: vm-{movalue}_disk.numberWrite.summation + foreach (keys %$result) { + next if (! /virtual-machine:(.*)/); + next if (!defined($uuid_vm->{$1})); + my $moref = $uuid_vm->{$1}; + $datastore_lun{ $clusters->{$cluster_view->{name}}->{ds_vsan} }->{$moref . '_disk.numberRead.summation'} = $result->{$_}->{iopsRead}; + $datastore_lun{ $clusters->{$cluster_view->{name}}->{ds_vsan} }->{$moref . '_disk.numberWrite.summation'} = $result->{$_}->{iopsWrite}; + $datastore_lun{ $clusters->{$cluster_view->{name}}->{ds_vsan} }->{'disk.numberRead.summation'} += $result->{$_}->{iopsRead}; + $datastore_lun{ $clusters->{$cluster_view->{name}}->{ds_vsan} }->{'disk.numberWrite.summation'} += $result->{$_}->{iopsWrite}; + } + } + } + + # Vsphere >= 4.1 + my $values = centreon::vmware::common::generic_performance_values_historic( + $self->{connector}, + $result2, + [ + { label => 'disk.numberRead.summation', instances => ['*'] }, + { label => 'disk.numberWrite.summation', instances => ['*'] } + ], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1 + ); + + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + foreach (keys %$values) { + my ($vm_id, $id, $disk_name) = split(/:/); + + # RDM Disk. We skip. Don't know how to manage it right now. + next if (!defined($disk_name{$disk_name})); + + my $tmp_value = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$_} / $interval_sec)); + $datastore_lun{$disk_name{$disk_name}}{$self->{connector}->{perfcounter_cache_reverse}->{$id}} += $tmp_value; + if (!defined($datastore_lun{$disk_name{$disk_name}}{$vm_id . '_' . $self->{connector}->{perfcounter_cache_reverse}->{$id}})) { + $datastore_lun{$disk_name{$disk_name}}{$vm_id . '_' . $self->{connector}->{perfcounter_cache_reverse}->{$id}} = $tmp_value; + } else { + $datastore_lun{$disk_name{$disk_name}}{$vm_id . '_' . $self->{connector}->{perfcounter_cache_reverse}->{$id}} += $tmp_value; + } + } + + foreach (keys %datastore_lun) { + my $total_read_counter = $datastore_lun{$_}{'disk.numberRead.summation'}; + my $total_write_counter = $datastore_lun{$_}{'disk.numberWrite.summation'}; + + $data->{$_}->{'disk.numberRead.summation'} = $total_read_counter; + $data->{$_}->{'disk.numberWrite.summation'} = $total_write_counter; + $data->{$_}->{vm} = {}; + + $self->vm_iops_details( + label => 'disk.numberRead.summation', + type => 'read', + detail => $datastore_lun{$_}, + ref_vm => $moref_vm, + data_vm => $data->{$_}->{vm} + ); + $self->vm_iops_details( + label => 'disk.numberWrite.summation', + type => 'write', + detail => $datastore_lun{$_}, + ref_vm => $moref_vm, + data_vm => $data->{$_}->{vm} + ); + } + + centreon::vmware::common::set_response(data => $data); +} + +sub vm_iops_details { + my ($self, %options) = @_; + + foreach my $value (keys %{$options{detail}}) { + # display only for high iops + if ($value =~ /^vm.*?$options{label}$/ && $options{detail}->{$value} >= $self->{detail_iops_min}) { + my ($vm_id) = split(/_/, $value); + $options{data_vm}->{$options{ref_vm}->{$vm_id}} = {} if (!defined($options{data_vm}->{$options{ref_vm}->{$vm_id}})); + $options{data_vm}->{$options{ref_vm}->{$vm_id}}->{$options{label}} = $options{detail}->{$value}; + } + } +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddatastoresnapshot.pm b/connectors/vmware/src/centreon/vmware/cmddatastoresnapshot.pm new file mode 100644 index 000000000..c0e561b9c --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddatastoresnapshot.pm @@ -0,0 +1,114 @@ +# Copyright 2015 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 centreon::vmware::cmddatastoresnapshot; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'datastoresnapshot'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{datastore_name}) && $options{arguments}->{datastore_name} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datastore name cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'datastore_name', is_regexp => 'filter'); + my @properties = ('summary.accessible', 'summary.name', 'browser'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datastore', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my @ds_array = (); + my %ds_names = (); + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { + name => $entity_view->{'summary.name'}, + accessible => $entity_view->{'summary.accessible'}, + error_message => '', + snapshost => [], + }; + next if (centreon::vmware::common::is_accessible(accessible => $entity_view->{'summary.accessible'}) == 0); + if (defined($entity_view->browser)) { + push @ds_array, $entity_view->browser; + $ds_names{$entity_view->{mo_ref}->{value}} = $entity_view->{'summary.name'}; + } + } + + @properties = (); + my $result2; + return if (!($result2 = centreon::vmware::common::get_views($self->{connector}, \@ds_array, \@properties))); + + foreach my $browse_ds (@$result2) { + my $dsName; + my $tmp_name = $browse_ds->{mo_ref}->{value}; + $tmp_name =~ s/^datastoreBrowser-//i; + $dsName = $ds_names{$tmp_name}; + + my ($snapshots, $msg) = centreon::vmware::common::search_in_datastore( + connector => $self->{connector}, + browse_ds => $browse_ds, + ds_name => '[' . $dsName . ']', + matchPattern => [ "*.vmsn", "*.vmsd", "*-000*.vmdk", "*-000*delta.vmdk" ], + searchCaseInsensitive => 1, + query => [ FileQuery->new()], + return => 1 + ); + if (!defined($snapshots)) { + $msg =~ s/\n/ /g; + if ($msg =~ /NoPermissionFault/i) { + $msg = "Not enough permissions"; + } + + $data->{$tmp_name}->{error_message} = $msg; + next; + } + + foreach (@$snapshots) { + if (defined($_->file)) { + foreach my $x (@{$_->file}) { + push @{$data->{$tmp_name}->{snapshost}}, { folder_path => $_->folderPath, path => $x->path, size => $x->fileSize }; + } + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddatastoreusage.pm b/connectors/vmware/src/centreon/vmware/cmddatastoreusage.pm new file mode 100644 index 000000000..1c38e06f0 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddatastoreusage.pm @@ -0,0 +1,115 @@ +# Copyright 2015 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 centreon::vmware::cmddatastoreusage; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'datastoreusage'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{datastore_name}) && $options{arguments}->{datastore_name} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datastore name cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $multiple = 0; + my $filters = $self->build_filter(label => 'name', search_option => 'datastore_name', is_regexp => 'filter'); + my @properties = ('summary', 'host'); + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datastore', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $mapped_host = {}; + my $host_array = []; + foreach my $entity_view (@$result) { + if (defined($entity_view->host)) { + foreach (@{$entity_view->host}) { + if (!defined($mapped_host->{ $_->{key}->{value} } )) { + push @$host_array, $_->{key}; + $mapped_host->{ $_->{key}->{value} } = '-'; + } + } + } + } + + if (scalar(@$host_array) > 0) { + my $result_hosts = centreon::vmware::common::get_views($self->{connector}, $host_array, ['name']); + foreach (@$result_hosts) { + $mapped_host->{ $_->{mo_ref}->{value} } = $_->{name}; + } + } + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { name => $entity_view->summary->name, accessible => $entity_view->summary->accessible, hosts => [] }; + if (defined($entity_view->host)) { + foreach (@{$entity_view->host}) { + push @{$data->{$entity_value}->{hosts}}, $mapped_host->{ $_->{key}->{value} }; + } + } + + next if (centreon::vmware::common::is_accessible(accessible => $entity_view->summary->accessible) == 0); + + if (defined($self->{refresh})) { + $entity_view->RefreshDatastore(); + } + + # capacity 0... + if ($entity_view->summary->capacity <= 0) { + $data->{$entity_value}->{size} = 0; + next; + } + + # in Bytes + $data->{$entity_value}->{size} = $entity_view->summary->capacity; + $data->{$entity_value}->{free} = $entity_view->summary->freeSpace; + + my ($total_uncommited, $prct_uncommited); + my $msg_uncommited = ''; + if (defined($entity_view->summary->uncommitted)) { + $data->{$entity_value}->{uncommitted} = $entity_view->summary->uncommitted; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddatastorevm.pm b/connectors/vmware/src/centreon/vmware/cmddatastorevm.pm new file mode 100644 index 000000000..ddd6fb575 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddatastorevm.pm @@ -0,0 +1,188 @@ +# Copyright 2015 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 centreon::vmware::cmddatastorevm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; +use File::Basename; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'datastorevm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + if (defined($options{arguments}->{datastore_name}) && $options{arguments}->{datastore_name} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datastore name cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $multiple = 0; + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'datastore', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $ds_regexp; + if (defined($self->{datastore_name}) && !defined($self->{filter_datastore})) { + $ds_regexp = qr/^\Q$self->{datastore_name}\E$/; + } elsif (!defined($self->{datastore_name})) { + $ds_regexp = qr/.*/; + } else { + $ds_regexp = qr/$self->{datastore_name}/; + } + + my $data = {}; + my $mapped_datastore = {}; + my @ds_array = (); + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + datastore => {}, + }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_running(power => $entity_view->{'runtime.powerState'}->val) == 0); + + if (defined($entity_view->datastore)) { + foreach (@{$entity_view->datastore}) { + if (!defined($mapped_datastore->{$_->value})) { + push @ds_array, $_; + $mapped_datastore->{$_->value} = 1; + } + } + } + } + + if (scalar(@ds_array) == 0) { + centreon::vmware::common::set_response(code => 200, short_message => "no virtual machines running or no datastore found"); + return ; + } + + @properties = ('info'); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@ds_array, \@properties); + return if (!defined($result2)); + + #my %uuid_list = (); + my %disk_name = (); + my %datastore_lun = (); + foreach (@$result2) { + if ($_->info->isa('VmfsDatastoreInfo')) { + #$uuid_list{$_->volume->uuid} = $_->volume->name; + # Not need. We are on Datastore level (not LUN level) + foreach my $extent (@{$_->info->vmfs->extent}) { + $disk_name{$extent->diskName} = $_->info->vmfs->name; + } + } + #if ($_->info->isa('NasDatastoreInfo')) { + # Zero disk Info + #} + } + + # Vsphere >= 4.1 + # We don't filter. To filter we'll need to get disk from vms + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + $result, + [{label => 'disk.numberRead.summation', instances => ['*']}, + {label => 'disk.numberWrite.summation', instances => ['*']}, + {label => 'disk.maxTotalLatency.latest', instances => ['']}], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $interval_sec = $self->{connector}->{perfcounter_speriod}; + if (defined($self->{sampling_period}) && $self->{sampling_period} ne '') { + $interval_sec = $self->{sampling_period}; + } + + my $finded = 0; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0 && + centreon::vmware::common::is_running(power => $entity_view->{'runtime.powerState'}->val) == 0); + + my %datastore_lun = (); + foreach (keys %{$values->{$entity_value}}) { + my ($id, $disk_name) = split /:/; + + # RDM Disk. We skip. Don't know how to manage it right now. + next if (!defined($disk_name{$disk_name})); + # We skip datastore not filtered + next if ($disk_name{$disk_name} !~ /$ds_regexp/); + $datastore_lun{$disk_name{$disk_name}} = { 'disk.numberRead.summation' => 0, + 'disk.numberWrite.summation' => 0 } if (!defined($datastore_lun{$disk_name{$disk_name}})); + $datastore_lun{$disk_name{$disk_name}}->{$self->{connector}->{perfcounter_cache_reverse}->{$id}} += $values->{$entity_value}->{$_}; + } + + foreach (sort keys %datastore_lun) { + my $read_counter = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($datastore_lun{$_}{'disk.numberRead.summation'} / $interval_sec)); + my $write_counter = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($datastore_lun{$_}{'disk.numberWrite.summation'} / $interval_sec)); + + $data->{$entity_value}->{datastore}->{$_} = { + 'disk.numberRead.summation' => $read_counter, + 'disk.numberWrite.summation' => $write_counter, + }; + } + + my $max_total_latency = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'disk.maxTotalLatency.latest'}->{key} . ":"})); + $data->{$entity_value}->{'disk.maxTotalLatency.latest'} = $max_total_latency; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddevicevm.pm b/connectors/vmware/src/centreon/vmware/cmddevicevm.pm new file mode 100644 index 000000000..0584601f6 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddevicevm.pm @@ -0,0 +1,96 @@ +# Copyright 2015 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 centreon::vmware::cmddevicevm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'devicevm'; + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'runtime.connectionState', 'runtime.powerState', 'config.hardware.device'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + my $total_device_connected = 0; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + total_device_connected => 0, + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_running(power => $entity_view->{'runtime.powerState'}->val) == 0); + + foreach my $dev (@{$entity_view->{'config.hardware.device'}}) { + if (ref($dev) =~ /$self->{device}/) { + if (defined($dev->connectable) && $dev->connectable->connected == 1) { + $data->{$entity_value}->{total_device_connected}++; + } + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmddiscovery.pm b/connectors/vmware/src/centreon/vmware/cmddiscovery.pm new file mode 100644 index 000000000..690641f66 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmddiscovery.pm @@ -0,0 +1,248 @@ +# +# Copyright 2019 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 centreon::vmware::cmddiscovery; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; +use centreon::vmware::cisTags; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'discovery'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{resource_type}) && $options{arguments}->{resource_type} !~ /^vm$|^esx$/) { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: resource type must be 'vm' or 'esx'"); + return 1; + } + + $self->{tags} = $options{arguments}->{tags} if (defined($options{arguments}->{tags})); + $self->{resource_type} = $options{arguments}->{resource_type} if (defined($options{arguments}->{resource_type})); + + return 0; +} + +sub get_folders { + my ($self, %options) = @_; + + my $folder = $options{folder}; + my $parent = $options{parent}; + my $value = $options{value}; + + $parent .= '/' . $folder->name; + $self->{paths}->{$value} = $parent; + + my $children = $folder->childEntity || return; + for my $child (@{$children}) { + next if ($child->type ne 'Folder'); + + $self->get_folders( + folder => centreon::vmware::common::get_view($self->{connector}, $child), + parent => $parent, + value => $child->value + ); + } +} + +sub run { + my $self = shift; + + my @disco_data; + my $disco_stats; + + my ($rv, $tags); + my $customFields = {}; + + my $api_type = $self->{connector}->{session}->get_service_content()->about->apiType; + if ($api_type eq 'VirtualCenter') { + my $entries = centreon::vmware::common::get_view($self->{connector}, $self->{connector}->{session}->get_service_content()->customFieldsManager); + if (defined($entries->{field})) { + foreach (@{$entries->{field}}) { + $customFields->{ $_->{key} } = $_->{name}; + } + } + + if (defined($self->{tags})) { + my $cisTags = centreon::vmware::cisTags->new(); + $cisTags->configuration( + url => $self->{connector}->{config_vsphere_url}, + username => $self->{connector}->{config_vsphere_user}, + password => $self->{connector}->{config_vsphere_pass}, + logger => $self->{connector}->{logger} + ); + ($rv, $tags) = $cisTags->tagsByResource(); + if ($rv) { + $self->{connector}->{logger}->writeLogError("cannot get tags: " . $cisTags->error()); + } + } + } + + $disco_stats->{start_time} = time(); + + my $filters = $self->build_filter(label => 'name', search_option => 'datacenter', is_regexp => 'filter'); + my @properties = ('name', 'hostFolder', 'vmFolder'); + + my $datacenters = centreon::vmware::common::search_entities( + command => $self, + view_type => 'Datacenter', + properties => \@properties, + filter => $filters + ); + return if (!defined($datacenters)); + + foreach my $datacenter (@{$datacenters}) { + my @properties = ('name', 'host'); + + $self->get_folders( + folder => centreon::vmware::common::get_view($self->{connector}, $datacenter->vmFolder), + parent => '', + value => $datacenter->vmFolder->value + ); + + my ($status, $clusters) = centreon::vmware::common::find_entity_views( + connector => $self->{connector}, + view_type => 'ComputeResource', # ClusterComputeResource extends ComputeResource. so no need to check it + properties => \@properties, + filter => $filters, + begin_entity => $datacenter, + output_message => 0 + ); + next if ($status <= 0); + + foreach my $cluster (@$clusters) { + next if (!$cluster->{'host'}); + + my @properties = ( + 'name', 'vm', 'config.virtualNicManagerInfo.netConfig', 'config.product.version', + 'config.product.productLineId', 'hardware.systemInfo.vendor', 'hardware.systemInfo.model', + 'hardware.systemInfo.uuid', 'runtime.powerState', 'runtime.inMaintenanceMode', 'runtime.connectionState' + ); + if ($api_type eq 'VirtualCenter') { + push @properties, 'summary.customValue'; + } + + my $esxs = centreon::vmware::common::get_views($self->{connector}, \@{$cluster->host}, \@properties); + next if (!defined($esxs)); + + foreach my $esx (@$esxs) { + my %esx; + + my $customValuesEsx = []; + if (defined($esx->{'summary.customValue'})) { + foreach (@{$esx->{'summary.customValue'}}) { + push @$customValuesEsx, { key => $customFields->{ $_->{key} }, value => $_->{value} }; + } + } + $esx{type} = 'esx'; + $esx{name} = $esx->name; + $esx{os} = $esx->{'config.product.productLineId'} . ' ' . $esx->{'config.product.version'}; + $esx{hardware} = $esx->{'hardware.systemInfo.vendor'} . ' ' . $esx->{'hardware.systemInfo.model'}; + $esx{power_state} = $esx->{'runtime.powerState'}->val; + $esx{connection_state} = $esx->{'runtime.connectionState'}->val; + $esx{maintenance} = $esx->{'runtime.inMaintenanceMode'}; + $esx{datacenter} = $datacenter->name; + $esx{cluster} = $cluster->name; + $esx{custom_attributes} = $customValuesEsx; + $esx{tags} = []; + if (defined($tags)) { + $esx{tags} = $tags->{esx}->{ $esx->{mo_ref}->{value} } if (defined($tags->{esx}->{ $esx->{mo_ref}->{value} })); + } + + foreach my $nic (@{$esx->{'config.virtualNicManagerInfo.netConfig'}}) { + my %lookup = map { $_->{'key'} => $_->{'spec'}->{'ip'}->{'ipAddress'} } @{$nic->{'candidateVnic'}}; + foreach my $vnic (@{$nic->{'selectedVnic'}}) { + push @{$esx{'ip_' . $nic->{'nicType'}}}, $lookup{$vnic}; + } + } + + push @disco_data, \%esx if (defined($self->{resource_type}) && $self->{resource_type} eq 'esx'); + next if (!defined($self->{resource_type}) || $self->{resource_type} ne 'vm'); + next if (!$esx->vm); + + @properties = ( + 'parent', 'config.name', 'config.annotation', 'config.template', 'config.uuid', 'config.version', + 'config.guestId', 'guest.guestState', 'guest.hostName', 'guest.ipAddress', 'runtime.powerState' + ); + if ($api_type eq 'VirtualCenter') { + push @properties, 'summary.customValue'; + } + + my $vms = centreon::vmware::common::get_views($self->{connector}, \@{$esx->vm}, \@properties); + next if (!defined($vms)); + + foreach my $vm (@{$vms}) { + next if ($vm->{'config.template'} eq 'true'); + next if (!defined($vm->{'config.uuid'}) || $vm->{'config.uuid'} eq ''); + my $entry; + + my $customValuesVm = []; + if (defined($vm->{'summary.customValue'})) { + foreach (@{$vm->{'summary.customValue'}}) { + push @$customValuesVm, { key => $customFields->{ $_->{key} }, value => $_->{value} }; + } + } + $entry->{type} = 'vm'; + $entry->{name} = $vm->{'config.name'}; + $entry->{uuid} = $vm->{'config.uuid'}; + $entry->{folder} = (defined($vm->parent) && $vm->parent->type eq 'Folder') ? $self->{paths}->{$vm->parent->value} : ''; + $entry->{annotation} = $vm->{'config.annotation'}; + $entry->{annotation} =~ s/\n/ /g if (defined($entry->{annotation})); + $entry->{os} = $vm->{'config.guestId'}; + $entry->{hardware} = $vm->{'config.version'}; + $entry->{guest_name} = $vm->{'guest.hostName'}; + $entry->{guest_ip} = $vm->{'guest.ipAddress'}; + $entry->{guest_state} = $vm->{'guest.guestState'}; + $entry->{power_state} = $vm->{'runtime.powerState'}->val; + $entry->{datacenter} = $datacenter->name; + $entry->{cluster} = $cluster->name; + $entry->{custom_attributes} = $customValuesVm; + $entry->{esx} = $esx->name; + $entry->{tags} = []; + if (defined($tags)) { + $entry->{tags} = $tags->{vm}->{ $vm->{mo_ref}->{value} } if (defined($tags->{vm}->{ $vm->{mo_ref}->{value} })); + } + + push @disco_data, $entry; + } + } + } + } + + $disco_stats->{end_time} = time(); + $disco_stats->{duration} = $disco_stats->{end_time} - $disco_stats->{start_time}; + $disco_stats->{discovered_items} = @disco_data; + $disco_stats->{results} = \@disco_data; + + centreon::vmware::common::set_response(data => $disco_stats); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdgetmap.pm b/connectors/vmware/src/centreon/vmware/cmdgetmap.pm new file mode 100644 index 000000000..c131dbef5 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdgetmap.pm @@ -0,0 +1,87 @@ +# Copyright 2015 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 centreon::vmware::cmdgetmap; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'getmap'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'vm', 'config.product.version'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + version => $entity_view->{'config.product.version'}, + vm => {} + }; + + next if (defined($self->{vm_no})); + + my @vm_array = (); + if (defined $entity_view->vm) { + @vm_array = (@vm_array, @{$entity_view->vm}); + } + + @properties = ('name', 'summary.runtime.powerState'); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@vm_array, \@properties); + return if (!defined($result2)); + + foreach my $vm (@$result2) { + $data->{$entity_value}->{vm}->{$vm->{mo_ref}->{value}} = { + name => $vm->name, + power_state => $vm->{'summary.runtime.powerState'}->val, + }; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdhealthhost.pm b/connectors/vmware/src/centreon/vmware/cmdhealthhost.pm new file mode 100644 index 000000000..3b0771232 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdhealthhost.pm @@ -0,0 +1,113 @@ +# Copyright 2015 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 centreon::vmware::cmdhealthhost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'healthhost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ( + 'name', 'runtime.healthSystemRuntime.hardwareStatusInfo', 'runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo', + 'runtime.connectionState' + ); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + my $cpuStatusInfo = $entity_view->{'runtime.healthSystemRuntime.hardwareStatusInfo'}->{cpuStatusInfo}; + my $memoryStatusInfo = $entity_view->{'runtime.healthSystemRuntime.hardwareStatusInfo'}->{memoryStatusInfo}; + my $storageStatusInfo = $entity_view->{'runtime.healthSystemRuntime.hardwareStatusInfo'}->{storageStatusInfo}; + my $numericSensorInfo = $entity_view->{'runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo'}; + + # CPU + if (defined($cpuStatusInfo)) { + $data->{$entity_value}->{cpu_info} = []; + foreach (@$cpuStatusInfo) { + push @{$data->{$entity_value}->{cpu_info}}, { status => $_->status->key, name => $_->name, summary => $_->status->summary }; + } + } + + # Memory + if (defined($memoryStatusInfo)) { + $data->{$entity_value}->{memory_info} = []; + foreach (@$memoryStatusInfo) { + push @{$data->{$entity_value}->{memory_info}}, { status => $_->status->key, name => $_->name, summary => $_->status->summary }; + } + } + + # Storage + if (defined($self->{storage_status}) && defined($storageStatusInfo)) { + $data->{$entity_value}->{storage_info} = []; + foreach (@$storageStatusInfo) { + push @{$data->{$entity_value}->{storage_info}}, { status => $_->status->key, name => $_->name, summary => $_->status->summary }; + } + } + + # Sensor + if (defined($numericSensorInfo)) { + $data->{$entity_value}->{sensor_info} = []; + foreach (@$numericSensorInfo) { + push @{$data->{$entity_value}->{sensor_info}}, { + status => $_->healthState->key, + type => $_->sensorType, name => $_->name, + summary => $_->healthState->summary, + current_reading => $_->currentReading, + power10 => $_->unitModifier, + unit => $_->baseUnits + }; + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdlicenses.pm b/connectors/vmware/src/centreon/vmware/cmdlicenses.pm new file mode 100644 index 000000000..2b90aa89c --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdlicenses.pm @@ -0,0 +1,67 @@ +# Copyright 2015 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 centreon::vmware::cmdlicenses; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'licenses'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + return 0; +} + +sub run { + my $self = shift; + + my $entries = centreon::vmware::common::get_view($self->{connector}, $self->{connector}->{session}->get_service_content()->licenseManager); + + my $data = {}; + if (defined($entries->licenses)) { + foreach my $license (@{$entries->licenses}) { + $data->{ $license->{name} } = { + total => $license->{total}, + used => $license->{used}, + edition => $license->{editionKey} + }; + foreach my $prop (@{$license->{properties}}) { + if ($prop->{key} eq 'expirationMinutes') { + $data->{ $license->{name} }->{expiration_minutes} = $prop->{value}; + } + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdlimitvm.pm b/connectors/vmware/src/centreon/vmware/cmdlimitvm.pm new file mode 100644 index 000000000..eabe415eb --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdlimitvm.pm @@ -0,0 +1,108 @@ +# Copyright 2015 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 centreon::vmware::cmdlimitvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'limitvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'runtime.connectionState', 'runtime.powerState', 'config.cpuAllocation.limit', 'config.memoryAllocation.limit'); + if (defined($self->{check_disk_limit})) { + push @properties, 'config.hardware.device'; + } + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + 'config.cpuAllocation.limit' => -1, + 'config.memoryAllocation.limit' => -1, + 'config.storageIOAllocation.limit' => [], + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + # CPU Limit + if (defined($entity_view->{'config.cpuAllocation.limit'}) && $entity_view->{'config.cpuAllocation.limit'} != -1) { + $data->{$entity_value}->{'config.cpuAllocation.limit'} = $entity_view->{'config.cpuAllocation.limit'}; + } + + # Memory Limit + if (defined($entity_view->{'config.memoryAllocation.limit'}) && $entity_view->{'config.memoryAllocation.limit'} != -1) { + $data->{$entity_value}->{'config.memoryAllocation.limit'} = $entity_view->{'config.memoryAllocation.limit'}; + } + + # Disk + if (defined($self->{check_disk_limit})) { + foreach my $device (@{$entity_view->{'config.hardware.device'}}) { + if ($device->isa('VirtualDisk')) { + if (defined($device->storageIOAllocation->limit) && $device->storageIOAllocation->limit != -1) { + push @{$data->{$entity_value}->{'config.storageIOAllocation.limit'}}, { name => $device->backing->fileName, limit => $device->storageIOAllocation->limit }; + } + } + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdlistclusters.pm b/connectors/vmware/src/centreon/vmware/cmdlistclusters.pm new file mode 100644 index 000000000..d9ab90e10 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdlistclusters.pm @@ -0,0 +1,64 @@ +# Copyright 2015 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 centreon::vmware::cmdlistclusters; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'listclusters'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{cluster}) && $options{arguments}->{cluster} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: cluster cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'cluster', is_regexp => 'filter'); + my @properties = ('name'); + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'ClusterComputeResource', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $cluster (@$result) { + $data->{$cluster->{mo_ref}->{value}} = { name => $cluster->name }; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdlistdatacenters.pm b/connectors/vmware/src/centreon/vmware/cmdlistdatacenters.pm new file mode 100644 index 000000000..a17c35468 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdlistdatacenters.pm @@ -0,0 +1,64 @@ +# Copyright 2015 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 centreon::vmware::cmdlistdatacenters; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'listdatacenters'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{datacenter}) && $options{arguments}->{datacenter} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: datacenter cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'datacenter', is_regexp => 'filter'); + my @properties = ('name'); + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datacenter', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $datacenter (@$result) { + $data->{$datacenter->{mo_ref}->{value}} = { name => $datacenter->{name} }; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdlistdatastores.pm b/connectors/vmware/src/centreon/vmware/cmdlistdatastores.pm new file mode 100644 index 000000000..05a12c7b3 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdlistdatastores.pm @@ -0,0 +1,69 @@ +# Copyright 2015 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 centreon::vmware::cmdlistdatastores; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'listdatastores'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $multiple = 0; + my $filters = $self->build_filter(label => 'name', search_option => 'datastore_name', is_regexp => 'filter'); + my @properties = ('summary'); + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datastore', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $datastore (@$result) { + $data->{$datastore->{mo_ref}->{value}} = { + name => $datastore->summary->name, + type => $datastore->summary->type, + accessible => $datastore->summary->accessible + }; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdlistnichost.pm b/connectors/vmware/src/centreon/vmware/cmdlistnichost.pm new file mode 100644 index 000000000..8dd883f3b --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdlistnichost.pm @@ -0,0 +1,98 @@ +# Copyright 2015 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 centreon::vmware::cmdlistnichost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'listnichost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (!defined($options{arguments}->{esx_hostname}) || $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname need to be set"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + my %nic_in_vswitch = (); + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('config.network.pnic', 'config.network.vswitch', 'config.network.proxySwitch'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + # Get Name from vswitch + if (defined($$result[0]->{'config.network.vswitch'})) { + foreach (@{$$result[0]->{'config.network.vswitch'}}) { + next if (!defined($_->{pnic})); + foreach my $keynic (@{$_->{pnic}}) { + $nic_in_vswitch{$keynic} = 1; + } + } + } + # Get Name from proxySwitch + if (defined($$result[0]->{'config.network.proxySwitch'})) { + foreach (@{$$result[0]->{'config.network.proxySwitch'}}) { + next if (!defined($_->{pnic})); + foreach my $keynic (@{$_->{pnic}}) { + $nic_in_vswitch{$keynic} = 1; + } + } + } + + my %nics = (); + foreach (@{$$result[0]->{'config.network.pnic'}}) { + if (defined($nic_in_vswitch{$_->key})) { + $nics{$_->device}{vswitch} = 1; + } + if (defined($_->linkSpeed)) { + $nics{$_->device}{up} = 1; + } else { + $nics{$_->device}{down} = 1; + } + } + + my $data = {}; + foreach my $nic_name (sort keys %nics) { + my $status = defined($nics{$nic_name}{up}) ? 'up' : 'down'; + my $vswitch = defined($nics{$nic_name}{vswitch}) ? 1 : 0; + + $data->{$nic_name} = { name => $nic_name, status => $status, vswitch => $vswitch }; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdmaintenancehost.pm b/connectors/vmware/src/centreon/vmware/cmdmaintenancehost.pm new file mode 100644 index 000000000..6afae9951 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdmaintenancehost.pm @@ -0,0 +1,69 @@ +# Copyright 2015 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 centreon::vmware::cmdmaintenancehost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'maintenancehost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + + my @properties = ('name', 'runtime.inMaintenanceMode', 'runtime.connectionState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + $data->{$entity_value}->{inMaintenanceMode} = $entity_view->{'runtime.inMaintenanceMode'}; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdmemhost.pm b/connectors/vmware/src/centreon/vmware/cmdmemhost.pm new file mode 100644 index 000000000..c7c72c80b --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdmemhost.pm @@ -0,0 +1,107 @@ +# Copyright 2015 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 centreon::vmware::cmdmemhost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'memhost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'summary.hardware.memorySize', 'runtime.connectionState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $performances = [{'label' => 'mem.consumed.average', 'instances' => ['']}, + {'label' => 'mem.overhead.average', 'instances' => ['']}]; + if (!defined($self->{no_memory_state})) { + push @{$performances}, {'label' => 'mem.state.latest', 'instances' => ['']}; + } + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + $result, $performances, + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + # for mem.state: + # 0 (high) Free memory >= 6% of machine memory minus Service Console memory. + # 1 (soft) 4% + # 2 (hard) 2% + # 3 (low) 1% + my %mapping_state = (0 => 'high', 1 => 'soft', 2 => 'hard', 3 => 'low'); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + my $memory_size = $entity_view->{'summary.hardware.memorySize'}; # in B + + # in KB + my $mem_used = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.consumed.average'}->{'key'} . ":"})) * 1024; + my $mem_overhead = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.overhead.average'}->{'key'} . ":"})) * 1024; + my $mem_state; + if (!defined($self->{no_memory_state})) { + $mem_state = centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.state.latest'}->{'key'} . ":"}); + } + + $data->{$entity_value}->{mem_size} = $memory_size; + $data->{$entity_value}->{'mem.consumed.average'} = $mem_used; + $data->{$entity_value}->{'mem.overhead.average'} = $mem_overhead; + $data->{$entity_value}->{mem_state_str} = defined($mem_state) ? $mapping_state{$mem_state} : undef; + $data->{$entity_value}->{mem_state} = defined($mem_state) ? $mem_state : undef; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdmemvm.pm b/connectors/vmware/src/centreon/vmware/cmdmemvm.pm new file mode 100644 index 000000000..17e8aa7f5 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdmemvm.pm @@ -0,0 +1,112 @@ +# Copyright 2015 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 centreon::vmware::cmdmemvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'memvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'summary.config.memorySizeMB', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + $result, + [{label => 'mem.active.average', instances => ['']}, + {label => 'mem.overhead.average', instances => ['']}, + {label => 'mem.vmmemctl.average', instances => ['']}, + {label => 'mem.consumed.average', instances => ['']}, + {label => 'mem.shared.average', instances => ['']}], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_running(power => $entity_view->{'runtime.powerState'}->val) == 0); + + # in KB + my $mem_consumed = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.consumed.average'}->{'key'} . ":"})) * 1024; + my $mem_active = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.active.average'}->{'key'} . ":"})) * 1024; + my $mem_overhead = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.overhead.average'}->{'key'} . ":"})) * 1024; + my $mem_ballooning = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.vmmemctl.average'}->{'key'} . ":"})) * 1024; + my $mem_shared = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.shared.average'}->{'key'} . ":"})) * 1024; + + $data->{$entity_value}->{'memory_size'} = $entity_view->{'summary.config.memorySizeMB'} * 1024 * 1024; + $data->{$entity_value}->{'mem.consumed.average'} = $mem_consumed; + $data->{$entity_value}->{'mem.active.average'} = $mem_active; + $data->{$entity_value}->{'mem.overhead.average'} = $mem_overhead; + $data->{$entity_value}->{'mem.vmmemctl.average'} = $mem_ballooning; + $data->{$entity_value}->{'mem.shared.average'} = $mem_shared; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdnethost.pm b/connectors/vmware/src/centreon/vmware/cmdnethost.pm new file mode 100644 index 000000000..0312ba7fb --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdnethost.pm @@ -0,0 +1,158 @@ +# Copyright 2015 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 centreon::vmware::cmdnethost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'nethost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq '') { + centreon::vmware::common::set_response(code => 100, short_message => 'Argument error: esx hostname cannot be null'); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $number_nic = 0; + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'config.network.pnic', 'runtime.connectionState', 'config.network.vswitch'); + if (!defined($self->{no_proxyswitch})) { + push @properties, 'config.network.proxySwitch'; + } + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + my $pnic_def_up = {}; + my $query_perfs = []; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val, + pnic => { }, vswitch => { }, proxyswitch => {} }; + next if ($entity_view->{'runtime.connectionState'}->val !~ /^connected$/i); + + $pnic_def_up->{$entity_value} = {}; + my $instances = []; + + # Get Name from vswitch + if (defined($entity_view->{'config.network.vswitch'})) { + foreach (@{$entity_view->{'config.network.vswitch'}}) { + $data->{$entity_value}->{vswitch}->{$_->{name}} = { pnic => [] }; + next if (!defined($_->{pnic})); + push @{$data->{$entity_value}->{vswitch}->{$_->{name}}->{pnic}}, @{$_->{pnic}}; + } + } + # Get Name from proxySwitch + if (defined($entity_view->{'config.network.proxySwitch'})) { + foreach (@{$entity_view->{'config.network.proxySwitch'}}) { + my $name = defined($_->{name}) ? $_->{name} : $_->{key}; + $data->{$entity_value}->{proxyswitch}->{$name} = { pnic => [] }; + next if (!defined($_->{pnic})); + push @{$data->{$entity_value}->{proxyswitch}->{$name}->{pnic}}, @{$_->{pnic}}; + } + } + + foreach (@{$entity_view->{'config.network.pnic'}}) { + $data->{$entity_value}->{pnic}->{$_->device} = { speed => undef, status => 'down', key => $_->{key} }; + + $number_nic++; + if (defined($_->linkSpeed)) { + $data->{$entity_value}->{pnic}->{$_->device}->{speed} = $_->linkSpeed->speedMb; + $data->{$entity_value}->{pnic}->{$_->device}->{status} = 'up'; + + $pnic_def_up->{$entity_value}->{$_->device} = $_->linkSpeed->speedMb; + push @$instances, $_->device; + } + } + + push @$query_perfs, { + entity => $entity_view, + metrics => [ + {label => 'net.received.average', instances => $instances}, + {label => 'net.transmitted.average', instances => $instances}, + {label => 'net.droppedRx.summation', instances => $instances}, + {label => 'net.droppedTx.summation', instances => $instances}, + {label => 'net.packetsRx.summation', instances => $instances}, + {label => 'net.packetsTx.summation', instances => $instances} + ] + }; + } + + # Nothing to retrieve. problem before already. + return if (scalar(@$query_perfs) == 0); + + my $values = centreon::vmware::common::generic_performance_values_historic( + $self->{connector}, + undef, + $query_perfs, + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1 + ); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + foreach (sort keys %{$pnic_def_up->{$entity_value}}) { + # KBps + my $traffic_in = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'net.received.average'}->{key} . ":" . $_})) * 1024 * 8; + my $traffic_out = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'net.transmitted.average'}->{key} . ":" . $_})) * 1024 * 8; + my $packets_in = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'net.packetsRx.summation'}->{key} . ":" . $_})); + my $packets_out = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'net.packetsTx.summation'}->{key} . ":" . $_})); + my $dropped_in = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'net.droppedRx.summation'}->{key} . ":" . $_})); + my $dropped_out = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'net.droppedTx.summation'}->{key} . ":" . $_})); + + $data->{$entity_value}->{pnic}->{$_}->{'net.received.average'} = $traffic_in; + $data->{$entity_value}->{pnic}->{$_}->{'net.transmitted.average'} = $traffic_out; + $data->{$entity_value}->{pnic}->{$_}->{'net.packetsRx.summation'} = $packets_in; + $data->{$entity_value}->{pnic}->{$_}->{'net.packetsTx.summation'} = $packets_out; + $data->{$entity_value}->{pnic}->{$_}->{'net.droppedRx.summation'} = $dropped_in; + $data->{$entity_value}->{pnic}->{$_}->{'net.droppedTx.summation'} = $dropped_out; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdnetvm.pm b/connectors/vmware/src/centreon/vmware/cmdnetvm.pm new file mode 100644 index 000000000..ab7442c6b --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdnetvm.pm @@ -0,0 +1,113 @@ +# Copyright 2015 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 centreon::vmware::cmdnetvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'netvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'runtime.connectionState', 'runtime.powerState', 'config.hardware.device'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $values = centreon::vmware::common::generic_performance_values_historic( + $self->{connector}, + $result, + [ + { label => 'net.received.average', instances => ['*'] }, + { label => 'net.transmitted.average', instances => ['*'] } + ], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1 + ); + + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + interfaces => {} + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_running(power => $entity_view->{'runtime.powerState'}->val) == 0); + + foreach (@{$entity_view->{'config.hardware.device'}}) { + next if (! $_->isa('VirtualEthernetCard')); + + # KBps + my $traffic_in = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{ $self->{connector}->{perfcounter_cache}->{'net.received.average'}->{key} . ":" . $_->{key} })) * 1024 * 8; + my $traffic_out = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{ $self->{connector}->{perfcounter_cache}->{'net.transmitted.average'}->{key} . ":" . $_->{key} })) * 1024 * 8; + + $data->{$entity_value}->{interfaces}->{ $_->{deviceInfo}->{label} }->{'net.received.average'} = $traffic_in; + $data->{$entity_value}->{interfaces}->{ $_->{deviceInfo}->{label} }->{'net.transmitted.average'} = $traffic_out; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdservicehost.pm b/connectors/vmware/src/centreon/vmware/cmdservicehost.pm new file mode 100644 index 000000000..0c50e7d2e --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdservicehost.pm @@ -0,0 +1,97 @@ +# Copyright 2015 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 centreon::vmware::cmdservicehost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'servicehost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'runtime.connectionState', 'runtime.inMaintenanceMode', 'configManager.serviceSystem'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my %host_names = (); + my @host_array = (); + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { name => $entity_view->{name}, + state => $entity_view->{'runtime.connectionState'}->val, + inMaintenanceMode => $entity_view->{'runtime.inMaintenanceMode'}, + services => [], + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_maintenance(maintenance => $entity_view->{'runtime.inMaintenanceMode'}) == 0); + + if (defined($entity_view->{'configManager.serviceSystem'})) { + push @host_array, $entity_view->{'configManager.serviceSystem'}; + $host_names{$entity_view->{'configManager.serviceSystem'}->{value}} = $entity_value; + } + } + + if (scalar(@host_array) == 0) { + centreon::vmware::common::set_response(data => $data); + return ; + } + + @properties = ('serviceInfo'); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@host_array, \@properties); + return if (!defined($result2)); + + foreach my $entity (@$result2) { + my $host_id = $host_names{$entity->{mo_ref}->{value}}; + + foreach my $service (@{$entity->{serviceInfo}->{service}}) { + push @{$data->{$host_id}->{services}}, { key => $service->{key}, label => $service->{label}, policy => $service->{policy}, running => $service->{running} }; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdsnapshotvm.pm b/connectors/vmware/src/centreon/vmware/cmdsnapshotvm.pm new file mode 100644 index 000000000..14666f1ac --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdsnapshotvm.pm @@ -0,0 +1,97 @@ +# Copyright 2015 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 centreon::vmware::cmdsnapshotvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'snapshotvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('snapshot.rootSnapshotList', 'name', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{check_consolidation}) == 1) { + push @properties, 'runtime.consolidationNeeded'; + } + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my %vm_consolidate = (); + my %vm_errors = (warning => {}, critical => {}); + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + snapshosts => [], + }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + if (defined($self->{check_consolidation}) && defined($entity_view->{'runtime.consolidationNeeded'}) && $entity_view->{'runtime.consolidationNeeded'} =~ /^true|1$/i) { + $data->{$entity_value}->{consolidation_needed} = 1; + } + + next if (!defined($entity_view->{'snapshot.rootSnapshotList'})); + + foreach my $snapshot (@{$entity_view->{'snapshot.rootSnapshotList'}}) { + # 2012-09-21T14:16:17.540469Z + push @{$data->{$entity_value}->{snapshosts}}, { name => $snapshot->name, description => $snapshot->description, create_time => $snapshot->createTime }; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdstatuscluster.pm b/connectors/vmware/src/centreon/vmware/cmdstatuscluster.pm new file mode 100644 index 000000000..843785130 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdstatuscluster.pm @@ -0,0 +1,89 @@ +# Copyright 2015 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 centreon::vmware::cmdstatuscluster; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'statuscluster'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{cluster_name}) && $options{arguments}->{cluster_name} eq '') { + centreon::vmware::common::set_response(code => 100, short_message => 'Argument error: cluster name cannot be null'); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $vsan_cluster_health; + my $filters = $self->build_filter(label => 'name', search_option => 'cluster_name', is_regexp => 'filter'); + my @properties = ('name', 'summary.overallStatus', 'configuration'); + if ($self->is_vsan_enabled()) { + $vsan_cluster_health = centreon::vmware::common::vsan_create_mo_view( + vsan_vim => $self->{connector}->{vsan_vim}, + type => 'VsanVcClusterHealthSystem', + value => 'vsan-cluster-health-system', + ); + push @properties, 'configurationEx'; + } + my $views = centreon::vmware::common::search_entities(command => $self, view_type => 'ClusterComputeResource', properties => \@properties, filter => $filters); + return if (!defined($views)); + + my $data = {}; + foreach my $view (@$views) { + my $entity_value = $view->{mo_ref}->{value}; + $data->{$entity_value} = { + name => $view->{name}, + overall_status => $view->{'summary.overallStatus'}->val, + ha_enabled => (defined($view->{configuration}->{dasConfig}->{enabled}) && $view->{configuration}->{dasConfig}->{enabled} =~ /^1|true/i) ? 'true' : 'false', + drs_enabled => (defined($view->{configuration}->{drsConfig}->{enabled}) && $view->{configuration}->{drsConfig}->{enabled} =~ /^1|true/i) ? 'true' : 'false' + }; + + if (defined($view->{configurationEx}->{vsanConfigInfo}) && $view->{configurationEx}->{vsanConfigInfo}->enabled == 1) { + my $summary = $vsan_cluster_health->VsanQueryVcClusterHealthSummary( + cluster => $view, + includeObjUuids => 'false', + fetchFromCache => 'false', + fields => ['clusterStatus'] + ); + $data->{$entity_value}->{vsan_cluster_status} = $summary->clusterStatus->status; + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdstatushost.pm b/connectors/vmware/src/centreon/vmware/cmdstatushost.pm new file mode 100644 index 000000000..c2094f67f --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdstatushost.pm @@ -0,0 +1,68 @@ +# Copyright 2015 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 centreon::vmware::cmdstatushost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'statushost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'summary.overallStatus', 'runtime.connectionState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + $data->{$entity_value}->{overall_status} = $entity_view->{'summary.overallStatus'}->val; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdstatusvm.pm b/connectors/vmware/src/centreon/vmware/cmdstatusvm.pm new file mode 100644 index 000000000..0e9ecf245 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdstatusvm.pm @@ -0,0 +1,82 @@ +# Copyright 2015 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 centreon::vmware::cmdstatusvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'statusvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'summary.overallStatus', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + $data->{$entity_value}->{overall_status} = $entity_view->{'summary.overallStatus'}->val; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdstoragehost.pm b/connectors/vmware/src/centreon/vmware/cmdstoragehost.pm new file mode 100644 index 000000000..137441001 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdstoragehost.pm @@ -0,0 +1,134 @@ +# Copyright 2015 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 centreon::vmware::cmdstoragehost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'storagehost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'runtime.connectionState', 'runtime.inMaintenanceMode', 'configManager.storageSystem'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my %host_names = (); + my @host_array = (); + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + state => $entity_view->{'runtime.connectionState'}->val, + inMaintenanceMode => $entity_view->{'runtime.inMaintenanceMode'}, + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_maintenance(maintenance => $entity_view->{'runtime.inMaintenanceMode'}) == 0); + + if (defined($entity_view->{'configManager.storageSystem'})) { + push @host_array, $entity_view->{'configManager.storageSystem'}; + $host_names{ $entity_view->{'configManager.storageSystem'}->{value} } = $entity_value; + } + } + + if (scalar(@host_array) == 0) { + centreon::vmware::common::set_response(data => $data); + return ; + } + + @properties = ('storageDeviceInfo'); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@host_array, \@properties); + return if (!defined($result2)); + + foreach my $entity (@$result2) { + my $host_id = $host_names{ $entity->{mo_ref}->{value} }; + + if (defined($entity->storageDeviceInfo->hostBusAdapter)) { + $data->{$host_id}->{adapters} = []; + foreach my $dev (@{$entity->storageDeviceInfo->hostBusAdapter}) { + push @{$data->{$host_id}->{adapters}}, { + name => $dev->device, + status => lc($dev->status) + }; + } + } + + if (defined($entity->storageDeviceInfo->scsiLun)) { + $data->{$host_id}->{luns} = []; + foreach my $scsi (@{$entity->storageDeviceInfo->scsiLun}) { + my $name = $scsi->deviceName; + if (defined($scsi->{displayName})) { + $name = $scsi->displayName; + } elsif (defined($scsi->{canonicalName})) { + $name = $scsi->canonicalName; + } + + push @{$data->{$host_id}->{luns}}, { + name => $name, + operational_states => $scsi->operationalState + }; + } + } + + if (defined($entity->storageDeviceInfo->{multipathInfo})) { + $data->{$host_id}->{paths} = []; + foreach my $lun (@{$entity->storageDeviceInfo->multipathInfo->lun}) { + foreach my $path (@{$lun->path}) { + my $state = $path->pathState; + $state = $path->state if (defined($path->{state})); + push @{$data->{$host_id}->{paths}}, { + name => $path->name, + state => lc($state) + }; + } + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdswaphost.pm b/connectors/vmware/src/centreon/vmware/cmdswaphost.pm new file mode 100644 index 000000000..b2fd7dbc4 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdswaphost.pm @@ -0,0 +1,87 @@ +# Copyright 2015 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 centreon::vmware::cmdswaphost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'swaphost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'runtime.connectionState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + $result, + [{'label' => 'mem.swapinRate.average', 'instances' => ['']}, + {'label' => 'mem.swapoutRate.average', 'instances' => ['']}], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + # KBps + my $swap_in = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.swapinRate.average'}->{'key'} . ":"})) * 1024; + my $swap_out = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.swapoutRate.average'}->{'key'} . ":"})) * 1024; + + $data->{$entity_value}->{'mem.swapinRate.average'} = $swap_in; + $data->{$entity_value}->{'mem.swapoutRate.average'} = $swap_out; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdswapvm.pm b/connectors/vmware/src/centreon/vmware/cmdswapvm.pm new file mode 100644 index 000000000..210204018 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdswapvm.pm @@ -0,0 +1,103 @@ +# Copyright 2015 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 centreon::vmware::cmdswapvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'swapvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + $result, + [{label => 'mem.swapinRate.average', instances => ['']}, + {label => 'mem.swapoutRate.average', instances => ['']}], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + next if (centreon::vmware::common::is_running(power => $entity_view->{'runtime.powerState'}->val) == 0); + + # KBps + my $swap_in = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.swapinRate.average'}->{'key'} . ":"})) * 1024; + my $swap_out = centreon::vmware::common::simplify_number(centreon::vmware::common::convert_number($values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'mem.swapoutRate.average'}->{'key'} . ":"})) * 1024; + + $data->{$entity_value}->{'mem.swapinRate.average'} = $swap_in; + $data->{$entity_value}->{'mem.swapoutRate.average'} = $swap_out; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdthinprovisioningvm.pm b/connectors/vmware/src/centreon/vmware/cmdthinprovisioningvm.pm new file mode 100644 index 000000000..38c8a942a --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdthinprovisioningvm.pm @@ -0,0 +1,89 @@ +# Copyright 2015 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 centreon::vmware::cmdthinprovisioningvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'thinprovisioningvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'config.hardware.device', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + disks => [], + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + foreach (@{$entity_view->{'config.hardware.device'}}) { + if ($_->isa('VirtualDisk')) { + next if (!defined($_->{backing}->{thinProvisioned})); + push @{$data->{$entity_value}->{disks}}, { thin_provisioned => $_->{backing}->{thinProvisioned}, name => $_->{backing}->{fileName} }; + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdtimehost.pm b/connectors/vmware/src/centreon/vmware/cmdtimehost.pm new file mode 100644 index 000000000..c9559e978 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdtimehost.pm @@ -0,0 +1,86 @@ +# Copyright 2015 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 centreon::vmware::cmdtimehost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'timehost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'configManager.dateTimeSystem', 'runtime.connectionState'); + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + my @host_array = (); + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + if (defined($entity_view->{'configManager.dateTimeSystem'})) { + push @host_array, $entity_view->{'configManager.dateTimeSystem'}; + } + } + + @properties = (); + my $result2 = centreon::vmware::common::get_views($self->{connector}, \@host_array, \@properties); + return if (!defined($result2)); + + foreach my $entity_view (@$result) { + my $host_dts_value = $entity_view->{'configManager.dateTimeSystem'}->{value}; + foreach my $host_dts_view (@$result2) { + if ($host_dts_view->{mo_ref}->{value} eq $host_dts_value) { + $data->{$entity_view->{mo_ref}->{value}}->{current_time} = $host_dts_view->QueryDateTime(); + last; + } + } + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdtoolsvm.pm b/connectors/vmware/src/centreon/vmware/cmdtoolsvm.pm new file mode 100644 index 000000000..467928171 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdtoolsvm.pm @@ -0,0 +1,95 @@ +# Copyright 2015 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 centreon::vmware::cmdtoolsvm; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'toolsvm'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{vm_hostname}) && $options{arguments}->{vm_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: vm hostname cannot be null"); + return 1; + } + + return 0; +} + +sub display_verbose { + my ($self, %options) = @_; + + $self->{manager}->{output}->output_add(long_msg => $options{label}); + foreach my $vm (sort keys %{$options{vms}}) { + my $prefix = $vm; + if ($options{vms}->{$vm} ne '') { + $prefix .= ' [' . centreon::vmware::common::strip_cr(value => $options{vms}->{$vm}) . ']'; + } + $self->{manager}->{output}->output_add(long_msg => ' ' . $prefix); + } +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'vm_hostname', is_regexp => 'filter'); + $self->add_filter(filters => $filters, label => 'config.annotation', search_option => 'filter_description'); + $self->add_filter(filters => $filters, label => 'config.guestFullName', search_option => 'filter_os'); + $self->add_filter(filters => $filters, label => 'config.uuid', search_option => 'filter_uuid'); + + my @properties = ('name', 'summary.guest.toolsStatus', 'runtime.connectionState', 'runtime.powerState'); + if (defined($self->{display_description})) { + push @properties, 'config.annotation'; + } + + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'VirtualMachine', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + + $data->{$entity_value} = { + name => $entity_view->{name}, + connection_state => $entity_view->{'runtime.connectionState'}->val, + power_state => $entity_view->{'runtime.powerState'}->val, + 'config.annotation' => defined($entity_view->{'config.annotation'}) ? $entity_view->{'config.annotation'} : undef, + }; + + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + $data->{$entity_value}->{tools_status} = defined($entity_view->{'summary.guest.toolsStatus'}) ? $entity_view->{'summary.guest.toolsStatus'}->val : undef; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmduptimehost.pm b/connectors/vmware/src/centreon/vmware/cmduptimehost.pm new file mode 100644 index 000000000..e19697fd2 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmduptimehost.pm @@ -0,0 +1,67 @@ +# Copyright 2015 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 centreon::vmware::cmduptimehost; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'uptimehost'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + my $filters = $self->build_filter(label => 'name', search_option => 'esx_hostname', is_regexp => 'filter'); + my @properties = ('name', 'runtime.bootTime', 'runtime.connectionState'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'HostSystem', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => $entity_view->{name}, state => $entity_view->{'runtime.connectionState'}->val }; + next if (centreon::vmware::common::is_connected(state => $entity_view->{'runtime.connectionState'}->val) == 0); + + $data->{$entity_value}->{boot_time} = $entity_view->{'runtime.bootTime'}; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdvmoperationcluster.pm b/connectors/vmware/src/centreon/vmware/cmdvmoperationcluster.pm new file mode 100644 index 000000000..2e51a0c55 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdvmoperationcluster.pm @@ -0,0 +1,82 @@ +# Copyright 2015 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 centreon::vmware::cmdvmoperationcluster; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'vmoperationcluster'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{cluster}) && $options{arguments}->{cluster} eq "") { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: cluster cannot be null"); + return 1; + } + return 0; +} + +sub run { + my $self = shift; + + if (!($self->{connector}->{perfcounter_speriod} > 0)) { + centreon::vmware::common::set_response(code => -1, short_message => "Can't retrieve perf counters"); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'cluster', is_regexp => 'filter'); + my @properties = ('name'); + my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'ClusterComputeResource', properties => \@properties, filter => $filters); + return if (!defined($result)); + + my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector}, + $result, + [{'label' => 'vmop.numVMotion.latest', 'instances' => ['']}, + {'label' => 'vmop.numSVMotion.latest', 'instances' => ['']}, + {'label' => 'vmop.numClone.latest', 'instances' => ['']}], + $self->{connector}->{perfcounter_speriod}, + sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift}, + skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1); + return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1); + + my $data = {}; + foreach my $entity_view (@$result) { + my $entity_value = $entity_view->{mo_ref}->{value}; + $data->{$entity_value} = { name => centreon::vmware::common::substitute_name(value => $entity_view->{name}) }; + $data->{$entity_value}->{'vmop.numVMotion.latest'} = $values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'vmop.numVMotion.latest'}->{key} . ":"}; + $data->{$entity_value}->{'vmop.numSVMotion.latest'} = $values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'vmop.numSVMotion.latest'}->{key} . ":"}; + $data->{$entity_value}->{'vmop.numClone.latest'} = $values->{$entity_value}->{$self->{connector}->{perfcounter_cache}->{'vmop.numClone.latest'}->{key} . ":"}; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/cmdvsanclusterusage.pm b/connectors/vmware/src/centreon/vmware/cmdvsanclusterusage.pm new file mode 100644 index 000000000..ff298ab44 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/cmdvsanclusterusage.pm @@ -0,0 +1,106 @@ +# Copyright 2015 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 centreon::vmware::cmdvsanclusterusage; + +use base qw(centreon::vmware::cmdbase); + +use strict; +use warnings; +use centreon::vmware::common; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(%options); + bless $self, $class; + + $self->{commandName} = 'vsanclusterusage'; + + return $self; +} + +sub checkArgs { + my ($self, %options) = @_; + + if (defined($options{arguments}->{cluster_name}) && $options{arguments}->{cluster_name} eq '') { + centreon::vmware::common::set_response(code => 100, short_message => "Argument error: cluster name cannot be null"); + return 1; + } + + return 0; +} + +sub run { + my $self = shift; + + if (!$self->is_vsan_enabled()) { + centreon::vmware::common::set_response(code => 100, short_message => 'Vsan is not enabled in vmware connector'); + return ; + } + + my $filters = $self->build_filter(label => 'name', search_option => 'cluster_name', is_regexp => 'filter'); + my @properties = ('name', 'configurationEx'); + my $views = centreon::vmware::common::search_entities(command => $self, view_type => 'ComputeResource', properties => \@properties, filter => $filters); + return if (!defined($views)); + + my $vsan_performance_mgr = centreon::vmware::common::vsan_create_mo_view( + vsan_vim => $self->{connector}->{vsan_vim}, + type => 'VsanPerformanceManager', + value => 'vsan-performance-manager', + ); + + my $interval_sec = $self->{connector}->{perfcounter_speriod}; + if (defined($self->{sampling_period}) && $self->{sampling_period} ne '') { + $interval_sec = $self->{sampling_period}; + } + + my $data = {}; + foreach my $view (@$views) { + next if (!defined($view->{configurationEx}->{vsanConfigInfo}) || $view->{configurationEx}->{vsanConfigInfo}->enabled != 1); + + my $entity_value = $view->{mo_ref}->{value}; + my $uuid = $view->{configurationEx}->{vsanConfigInfo}->{defaultConfig}->{uuid}; + my $result = centreon::vmware::common::vsan_get_performances( + vsan_performance_mgr => $vsan_performance_mgr, + cluster => $view, + entityRefId => 'cluster-domcompmgr:*', + labels => [ + 'iopsRead', + 'iopsWrite', + 'congestion', # number + 'latencyAvgRead', # time_ms + 'latencyAvgWrite', # time_ms + 'oio', # outstanding IO (number), + 'throughputRead', # rate_bytes + 'throughputWrite', # rate_bytes + ], + interval => $interval_sec, + time_shift => $self->{time_shift} + ); + $data->{$entity_value} = { + name => $view->{name}, + cluster_domcompmgr => { + %{$result->{'cluster-domcompmgr:' . $uuid}} + }, + }; + } + + centreon::vmware::common::set_response(data => $data); +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/common.pm b/connectors/vmware/src/centreon/vmware/common.pm new file mode 100644 index 000000000..5c5080ad3 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/common.pm @@ -0,0 +1,797 @@ +# Copyright 2015 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 centreon::vmware::common; + +use warnings; +use strict; +use Data::Dumper; +use VMware::VIRuntime; +use VMware::VILib; +use ZMQ::LibZMQ4; +use ZMQ::Constants qw(:all); +use JSON::XS;; + +my $manager_display = {}; +my $manager_response = {}; +my $flag = ZMQ_NOBLOCK | ZMQ_SNDMORE; + +sub set_response { + my (%options) = @_; + + $manager_response->{code} = $options{code} if (defined($options{code})); + $manager_response->{short_message} = $options{short_message} if (defined($options{short_message})); + $manager_response->{extra_message} = $options{extra_message} if (defined($options{extra_message})); + $manager_response->{identity} = $options{identity} if (defined($options{identity})); + $manager_response->{data} = $options{data} if (defined($options{data})); +} + +sub init_response { + my (%options) = @_; + + $manager_response->{code} = 0; + $manager_response->{vmware_connector_version} = '3.2.5'; + $manager_response->{short_message} = 'OK'; + $manager_response->{extra_message} = ''; + $manager_response->{identity} = $options{identity} if (defined($options{identity})); + $manager_response->{data} = {}; +} + +sub free_response { + $manager_response = {}; +} + +sub response { + my (%options) = @_; + + my $response_str = ''; + if (defined($options{force_response})) { + $response_str = $options{force_response}; + } else { + eval { + $response_str = JSON::XS->new->utf8->encode($manager_response); + }; + if ($@) { + $response_str = '{ "code": -1, "short_message": "Cannot encode result" }'; + } + } + + if (defined($options{reinit})) { + my $context = zmq_init(); + $options{endpoint} = zmq_socket($context, ZMQ_DEALER); + zmq_connect($options{endpoint}, $options{reinit}); + # we wait 10 seconds after. If not there is a problem... so we can quit + # dialog from vsphere response to router + zmq_setsockopt($options{endpoint}, ZMQ_LINGER, 10000); + } + if (defined($options{identity})) { + my $msg = zmq_msg_init_data($options{identity}); + zmq_msg_send($msg, $options{endpoint}, $flag); + zmq_msg_close($msg); + } + my $msg = zmq_msg_init_data($options{token} . " " . $response_str); + zmq_msg_send($msg, $options{endpoint}, ZMQ_NOBLOCK); + zmq_msg_close($msg); +} + +sub vmware_error { + my ($obj_vmware, $lerror) = @_; + + set_response(extra_message => $lerror); + $obj_vmware->{logger}->writeLogError("'" . $obj_vmware->{whoaim} . "' $lerror"); + if ($lerror =~ /NoPermissionFault/i) { + set_response(code => -1, short_message => 'VMWare error: not enought permissions'); + } else { + set_response(code => -1, short_message => 'VMWare error (verbose mode for more details)'); + } + return undef; +} + +sub connect_vsphere { + my (%options) = @_; + + $options{logger}->writeLogInfo("'$options{whoaim}' Vsphere connection in progress"); + eval { + $SIG{ALRM} = sub { die('TIMEOUT'); }; + alarm($options{connect_timeout}); + $options{connector}->{session} = Vim->new(service_url => $options{url}); + $options{connector}->{session}->login( + user_name => $options{username}, + password => $options{password} + ); + + $options{connector}->{service_url} = $options{url}; + #$options{connector}->{session}->save_session(session_file => '/tmp/plop.save'); + #$options{connector}->{session}->unset_logout_on_disconnect(); + + get_vsan_vim(%options) if ($options{vsan_enabled} == 1); + + alarm(0); + }; + if ($@) { + $options{logger}->writeLogError("'$options{whoaim}' No response from VirtualCenter server") if($@ =~ /TIMEOUT/); + $options{logger}->writeLogError("'$options{whoaim}' You need to upgrade HTTP::Message!") if($@ =~ /HTTP::Message/); + $options{logger}->writeLogError("'$options{whoaim}' Login to VirtualCenter server failed: $@"); + return 1; + } + + return 0; +} + +sub heartbeat { + my (%options) = @_; + my $stime; + + eval { + $stime = $options{connector}->{session}->get_service_instance()->CurrentTime(); + $options{connector}->{keeper_session_time} = time(); + }; + if ($@) { + $options{connector}->{logger}->writeLogError("$@"); + # Try a second time + eval { + $stime = $options{connector}->{session}->get_service_instance()->CurrentTime(); + $options{connector}->{keeper_session_time} = time(); + }; + if ($@) { + $options{connector}->{logger}->writeLogError("$@"); + $options{connector}->{logger}->writeLogError("'" . $options{connector}->{whoaim} . "' Ask a new connection"); + # Ask a new connection + $options{connector}->{last_time_check} = time(); + } + } + + $options{connector}->{logger}->writeLogInfo("'" . $options{connector}->{whoaim} . "' Get current time = " . Data::Dumper::Dumper($stime)); +} + +sub simplify_number { + my ($number, $cnt) = @_; + $cnt = 2 if (!defined($cnt)); + return sprintf("%.${cnt}f", "$number"); +} + +sub convert_number { + my ($number) = shift(@_); + # Avoid error counter empty. But should manage it in code the 'undef'. + $number = 0 if (!defined($number)); + $number =~ s/\,/\./; + return $number; +} + +sub get_views { + my $obj_vmware = shift; + my $results; + + eval { + $results = $obj_vmware->{session}->get_views(mo_ref_array => $_[0], properties => $_[1]); + }; + if ($@) { + vmware_error($obj_vmware, $@); + return undef; + } + return $results; +} + +sub get_view { + my $obj_vmware = shift; + my $results; + + eval { + $results = $obj_vmware->{session}->get_view(mo_ref => $_[0], properties => $_[1]); + }; + if ($@) { + vmware_error($obj_vmware, $@); + return undef; + } + return $results; +} + +sub search_in_datastore { + my (%options) = @_; + my $result; + + my $files = FileQueryFlags->new( + fileSize => 1, + fileType => 1, + modification => 1, + fileOwner => 1 + ); + my $hostdb_search_spec = HostDatastoreBrowserSearchSpec->new( + details => $files, + searchCaseInsensitive => $options{searchCaseInsensitive}, + matchPattern => $options{matchPattern}, + query => $options{query} + ); + eval { + $result = $options{browse_ds}->SearchDatastoreSubFolders( + datastorePath => $options{ds_name}, + searchSpec => $hostdb_search_spec + ); + }; + if ($@) { + return (undef, $@) if (defined($options{return}) && $options{return} == 1); + vmware_error($options{connector}, $@); + return undef; + } + return $result; +} + +sub get_perf_metric_ids { + my (%options) = @_; + my $filtered_list = []; + + foreach (@{$options{metrics}}) { + if (defined($options{connector}->{perfcounter_cache}->{$_->{label}})) { + if ($options{interval} != 20 && $options{connector}->{perfcounter_cache}->{$_->{label}}{level} > $options{connector}->{sampling_periods}->{$options{interval}}->{level}) { + set_response( + code => -1, + short_message => sprintf( + "Cannot get counter '%s' for the sampling period '%s' (counter level: %s, sampling level: %s)", + $_->{label}, $options{interval}, + $options{connector}->{perfcounter_cache}->{$_->{label}}{level}, + $options{connector}->{sampling_periods}->{$options{interval}}->{level} + ) + ); + return undef; + } + foreach my $instance (@{$_->{instances}}) { + my $metric = PerfMetricId->new( + counterId => $options{connector}->{perfcounter_cache}->{$_->{label}}{key}, + instance => $instance + ); + push @$filtered_list, $metric; + } + } else { + $options{connector}->{logger}->writeLogError("Metric '" . $_->{label} . "' unavailable."); + set_response(code => -1, short_message => "Counter doesn't exist. VMware version can be too old."); + return undef; + } + } + return $filtered_list; +} + +sub performance_builder_specific { + my (%options) = @_; + + my $time_shift = defined($options{time_shift}) ? $options{time_shift} : 0; + my @perf_query_spec; + foreach my $entry (@{$options{metrics}}) { + my $perf_metric_ids = get_perf_metric_ids( + connector => $options{connector}, + metrics => $entry->{metrics}, + interval => $options{interval} + ); + return undef if (!defined($perf_metric_ids)); + + my $tstamp = time(); + my (@t) = gmtime($tstamp - $options{interval} - $time_shift); + my $startTime = sprintf( + "%04d-%02d-%02dT%02d:%02d:%02dZ", + (1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0] + ); + (@t) = gmtime($tstamp); + my $endTime = sprintf( + "%04d-%02d-%02dT%02d:%02d:%02dZ", + (1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0] + ); + if ($options{interval} == 20) { + push @perf_query_spec, PerfQuerySpec->new( + entity => $entry->{entity}, + metricId => $perf_metric_ids, + format => 'normal', + intervalId => 20, + startTime => $startTime, + endTime => $endTime + ); + #maxSample => 1); + } else { + push @perf_query_spec, PerfQuerySpec->new( + entity => $entry->{entity}, + metricId => $perf_metric_ids, + format => 'normal', + intervalId => $options{interval}, + startTime => $startTime, + endTime => $endTime + ); + #maxSample => 1); + } + } + + return $options{connector}->{perfmanager_view}->QueryPerf(querySpec => \@perf_query_spec); +} + +sub performance_builder_global { + my (%options) = @_; + + my $time_shift = defined($options{time_shift}) ? $options{time_shift} : 0; + my @perf_query_spec; + my $perf_metric_ids = get_perf_metric_ids( + connector => $options{connector}, + metrics => $options{metrics}, + interval => $options{interval} + ); + return undef if (!defined($perf_metric_ids)); + + my $tstamp = time(); + my (@t) = gmtime($tstamp - $options{interval} - $time_shift); + my $startTime = sprintf( + "%04d-%02d-%02dT%02d:%02d:%02dZ", + (1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0] + ); + (@t) = gmtime($tstamp); + my $endTime = sprintf( + "%04d-%02d-%02dT%02d:%02d:%02dZ", + (1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0] + ); + + foreach (@{$options{views}}) { + if ($options{interval} == 20) { + push @perf_query_spec, PerfQuerySpec->new( + entity => $_, + metricId => $perf_metric_ids, + format => 'normal', + intervalId => 20, + startTime => $startTime, + endTime => $endTime + ); + #maxSample => 1); + } else { + push @perf_query_spec, PerfQuerySpec->new( + entity => $_, + metricId => $perf_metric_ids, + format => 'normal', + intervalId => $options{interval}, + startTime => $startTime, + endTime => $endTime + ); + #maxSample => 1); + } + } + + return $options{connector}->{perfmanager_view}->QueryPerf(querySpec => \@perf_query_spec); +} + +sub generic_performance_values_historic { + my ($obj_vmware, $views, $perfs, $interval, %options) = @_; + my $counter = 0; + my %results; + + # overload the default sampling choosen + if (defined($options{sampling_period}) && $options{sampling_period} ne '') { + $interval = $options{sampling_period}; + } + # check sampling period exist (period 20 is not listed) + if ($interval != 20 && !defined($obj_vmware->{sampling_periods}->{$interval})) { + set_response(code => -1, short_message => sprintf("Sampling period '%s' not managed.", $interval)); + return undef; + } + if ($interval != 20 && $obj_vmware->{sampling_periods}->{$interval}->{enabled} != 1) { + set_response(code => -1, short_message => sprintf("Sampling period '%s' collection data no enabled.", $interval)); + return undef; + } + eval { + my $perfdata; + + if (defined($views)) { + $perfdata = performance_builder_global( + connector => $obj_vmware, + views => $views, + metrics => $perfs, + interval => $interval, + time_shift => $options{time_shift} + ); + } else { + $perfdata = performance_builder_specific( + connector => $obj_vmware, + metrics => $perfs, + interval => $interval, + time_shift => $options{time_shift} + ); + } + return undef if (!defined($perfdata)); + + if (!$$perfdata[0] || !defined($$perfdata[0]->value)) { + set_response(code => -1, short_message => 'Cannot get value for counters (Maybe, object(s) cannot be reached: disconnected, not running, time not synced (see time-host mode),...)'); + return undef; + } + foreach my $val (@$perfdata) { + foreach (@{$val->{value}}) { + if (defined($options{skip_undef_counter}) && $options{skip_undef_counter} == 1 && !defined($_->value)) { + $results{$_->id->counterId . ":" . (defined($_->id->instance) ? $_->id->instance : "")} = undef; + next; + } elsif (!defined($_->value)) { + set_response(code => -1, short_message => 'Cannot get value for counters. Maybe there is time sync problem (check the esxd server and the target also)'); + return undef; + } + + my $aggregated_counter_value = 0; + foreach my $counter_value (@{$_->value}) { + $aggregated_counter_value += $counter_value; + } + if (scalar(@{$_->value}) > 1) { + $aggregated_counter_value /= scalar(@{$_->value}); + } + + if (defined($options{multiples}) && $options{multiples} == 1) { + if (defined($options{multiples_result_by_entity}) && $options{multiples_result_by_entity} == 1) { + $results{$val->{entity}->{value}} = {} if (!defined($results{$val->{entity}->{value}})); + $results{$val->{entity}->{value}}->{$_->id->counterId . ":" . (defined($_->id->instance) ? $_->id->instance : "")} = $aggregated_counter_value; + } else { + $results{$val->{entity}->{value} . ":" . $_->id->counterId . ":" . (defined($_->id->instance) ? $_->id->instance : "")} = $aggregated_counter_value; + } + } else { + $results{$_->id->counterId . ":" . (defined($_->id->instance) ? $_->id->instance : "")} = $aggregated_counter_value; + } + } + } + }; + if ($@) { + if ($@ =~ /querySpec.interval.*InvalidArgumentFault/msi) { + set_response( + code => -1, + short_message => sprintf( + "Interval '%s' is surely not supported for the managed entity (caller: %s)", + $interval, + join('--', caller) + ) + ); + } else { + $obj_vmware->{logger}->writeLogError("'" . $obj_vmware->{whoaim} . "' $@"); + } + return undef; + } + return \%results; +} + +sub cache_perf_counters { + my $obj_vmware = shift; + + eval { + $obj_vmware->{perfmanager_view} = $obj_vmware->{session}->get_view(mo_ref => $obj_vmware->{session}->get_service_content()->perfManager, properties => ['perfCounter', 'historicalInterval']); + foreach (@{$obj_vmware->{perfmanager_view}->perfCounter}) { + my $label = $_->groupInfo->key . "." . $_->nameInfo->key . "." . $_->rollupType->val; + $obj_vmware->{perfcounter_cache}->{$label} = { key => $_->key, unitkey => $_->unitInfo->key, level => $_->level }; + $obj_vmware->{perfcounter_cache_reverse}->{$_->key} = $label; + } + + my $historical_intervals = $obj_vmware->{perfmanager_view}->historicalInterval; + $obj_vmware->{sampling_periods} = {}; + + foreach (@$historical_intervals) { + if ($obj_vmware->{perfcounter_speriod} == -1 || $obj_vmware->{perfcounter_speriod} > $_->samplingPeriod) { + $obj_vmware->{perfcounter_speriod} = $_->samplingPeriod; + } + $obj_vmware->{sampling_periods}->{$_->samplingPeriod} = $_; + } + + # Put refresh = 20 (for ESX check) + if ($obj_vmware->{perfcounter_speriod} == -1) { + $obj_vmware->{perfcounter_speriod} = 20; + } + }; + + if ($@) { + $obj_vmware->{logger}->writeLogError("'" . $obj_vmware->{whoaim} . "' $@"); + return 1; + } + + return 0; +} + +sub search_entities { + my (%options) = @_; + my $properties = ['name']; + my $begin_views = []; + + foreach my $scope (['scope_datacenter', 'Datacenter'], ['scope_cluster', 'ClusterComputeResource'], ['scope_host', 'HostSystem']) { + if (defined($options{command}->{$scope->[0]}) && $options{command}->{$scope->[0]} ne '') { + my $filters = { name => qr/$options{command}->{$scope->[0]}/ }; + if (scalar(@$begin_views) > 0) { + my $temp_views = []; + while ((my $view = shift @$begin_views)) { + my ($status, $views) = find_entity_views( + connector => $options{command}->{connector}, + view_type => $scope->[1], + properties => $properties, + filter => $filters, + begin_entity => $view, + output_message => 0 + ); + next if ($status == 0); + return undef if ($status == -1); + push @$temp_views, @$views; + } + + if (scalar(@$temp_views) == 0) { + set_response(code => 1, short_message => "Cannot find '$scope->[1]' object"); + return undef; + } + push @$begin_views, @$temp_views; + } else { + my ($status, $views) = find_entity_views(connector => $options{command}->{connector}, view_type => $scope->[1], properties => $properties, filter => $filters); + # We quit. No scope find + return undef if ($status <= 0); + push @$begin_views, @$views; + } + } + } + + if (scalar(@$begin_views) > 0) { + my $results = []; + foreach my $view (@$begin_views) { + my ($status, $views) = find_entity_views( + connector => $options{command}->{connector}, + view_type => $options{view_type}, + properties => $options{properties}, + filter => $options{filter}, + begin_entity => $view, + output_message => 0 + ); + next if ($status == 0); + return undef if ($status == -1); + push @$results, @$views; + } + if (scalar(@$results) == 0) { + set_response(code => 1, short_message => "Cannot find '$options{view_type}' object"); + return undef; + } + return $results; + } else { + my ($status, $views) = find_entity_views( + connector => $options{command}->{connector}, + view_type => $options{view_type}, + properties => $options{properties}, + filter => $options{filter}, + empty_continue => $options{command}->{empty_continue} + ); + return $views; + } +} + +sub find_entity_views { + my (%options) = @_; + my $entity_views; + + eval { + if (defined($options{begin_entity})) { + $entity_views = $options{connector}->{session}->find_entity_views(view_type => $options{view_type}, properties => $options{properties}, filter => $options{filter}, begin_entity => $options{begin_entity}); + } else { + $entity_views = $options{connector}->{session}->find_entity_views(view_type => $options{view_type}, properties => $options{properties}, filter => $options{filter}); + } + }; + if ($@) { + $options{connector}->{logger}->writeLogError("'" . $options{connector}->{whoaim} . "' $@"); + eval { + if (defined($options{begin_entity})) { + $entity_views = $options{connector}->{session}->find_entity_views(view_type => $options{view_type}, properties => $options{properties}, filter => $options{filter}, begin_entity => $options{begin_entity}); + } else { + $entity_views = $options{connector}->{session}->find_entity_views(view_type => $options{view_type}, properties => $options{properties}, filter => $options{filter}); + } + }; + if ($@) { + vmware_error($options{connector}, $@); + return (-1, undef); + } + } + if (!defined($entity_views) || scalar(@$entity_views) == 0) { + my $status = 0; + if (defined($options{empty_continue})) { + return (1, []); + } + if (!defined($options{output_message}) || $options{output_message} != 0) { + set_response(code => 1, short_message => "Cannot find '$options{view_type}' object"); + } + return (0, undef); + } + #eval { + # $$entity_views[0]->update_view_data(properties => $properties); + #}; + #if ($@) { + # writeLogFile("$@"); + # return undef; + #} + return (1, $entity_views); +} + +sub performance_errors { + my ($obj_vmware, $values) = @_; + + # Error counter not available or other from function + return 1 if (!defined($values) || scalar(keys(%$values)) <= 0); + return 0; +} + +sub get_interval_min { + my (%options) = @_; + + my $interval = $options{speriod}; + my $time_shift = defined($options{time_shift}) ? $options{time_shift} : 0; + if (defined($options{sampling_period}) && $options{sampling_period} ne '') { + $interval = $options{sampling_period}; + } + + return int(($interval + $time_shift) / 60); +} + +sub is_accessible { + my (%options) = @_; + + if ($options{accessible} !~ /^true|1$/) { + return 0; + } + return 1; +} + +sub is_connected { + my (%options) = @_; + + if ($options{state} !~ /^connected$/i) { + return 0; + } + return 1; +} + +sub is_running { + my (%options) = @_; + + if ($options{power} !~ /^poweredOn$/i) { + return 0; + } + return 1; +} + +sub is_maintenance { + my (%options) = @_; + + if ($options{maintenance} =~ /^true|1$/) { + return 0; + } + return 1; +} + +sub substitute_name { + my (%options) = @_; + + $options{value} =~ s/%2f/\//g; + return $options{value}; +} + +sub strip_cr { + my (%options) = @_; + + $options{value} =~ s/^\s+.*\s+$//mg; + $options{value} =~ s/\r//mg; + $options{value} =~ s/\n/ -- /mg; + return $options{value}; +} + +sub stats_info { + my (%options) = @_; + + my $data = {}; + foreach my $container (keys %{$options{counters}}) { + $data->{$container} = { requests => $options{counters}->{$container} }; + } + set_response(data => $data); +} + +# +# Vsan +# + +sub load_vsanmgmt_binding_files { + my (%options) = @_; + + my @stub = (); + local $/; + for (@{$options{files}}) { + open(STUB, $options{path} . '/' . $_) or die $!; + push @stub, split /\n####+?\n/, <STUB>; + close STUB or die $!; + } + for (@stub) { + my ($package) = /\bpackage\s+(\w+)/; + $VIMRuntime::stub_class{$package} = $_ if (defined($package)); + } + eval $VIMRuntime::stub_class{'VimService'}; +} + +sub get_vsan_vim { + my (%options) = @_; + + require URI::URL; + my $session_id = $options{connector}->{session}->get_session_id(); + my $url = URI::URL->new($options{connector}->{session}->get_service_url()); + my $api_type = $options{connector}->{session}->get_service_content()->about->apiType; + + my $service_url_path = "sdk/vimService"; + my $path = "vsanHealth"; + if ($api_type eq "HostAgent") { + $service_url_path = "sdk"; + $path = "vsan"; + } + + $options{connector}->{vsan_vim} = Vim->new( + service_url => + 'https://' . $url->host . '/' . $service_url_path, + server => $url->host, + protocol => "https", + path => $path, + port => '443' + ); + + $options{connector}->{vsan_vim}->{vim_service} = VimService->new($options{connector}->{vsan_vim}->{service_url}); + $options{connector}->{vsan_vim}->{vim_service}->load_session_id($session_id); + $options{connector}->{vsan_vim}->unset_logout_on_disconnect; +} + +sub vsan_create_mo_view { + my (%options) = @_; + + my $moref = ManagedObjectReference->new( + type => $options{type}, + value => $options{value}, + ); + my $view_type = $moref->type; + my $mo_view = $view_type->new($moref, $options{vsan_vim}); + return $mo_view; +} + +sub vsan_get_performances { + my (%options) = @_; + + my $time_shift = defined($options{time_shift}) ? $options{time_shift} : 0; + my $tstamp = time(); + my (@t) = gmtime($tstamp - $options{interval} - $time_shift); + my $startTime = sprintf( + "%04d-%02d-%02dT%02d:%02d:%02dZ", + (1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0] + ); + (@t) = gmtime($tstamp); + my $endTime = sprintf( + "%04d-%02d-%02dT%02d:%02d:%02dZ", + (1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0] + ); + my $querySpec = VsanPerfQuerySpec->new( + entityRefId => $options{entityRefId}, # for example: 'virtual-machine:*' + labels => $options{labels}, # for example: ['iopsRead, iopsWrite'] + startTime => $startTime, + endTime => $endTime, + ); + my $values = $options{vsan_performance_mgr}->VsanPerfQueryPerf( + querySpecs => [$querySpec], + cluster => $options{cluster}, + ); + + my $result = {}; + foreach (@$values) { + $result->{$_->{entityRefId}} = {}; + foreach my $perf (@{$_->{value}}) { + my ($counter, $i) = (0, 0); + foreach my $val (split /,/, $perf->{values}) { + $counter += $val; + $i++; + } + $result->{$_->{entityRefId}}->{$perf->{metricId}->{label}} = $counter / $i; + } + } + + return $result; +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/connector.pm b/connectors/vmware/src/centreon/vmware/connector.pm new file mode 100644 index 000000000..abfab28a6 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/connector.pm @@ -0,0 +1,346 @@ +# Copyright 2015 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 centreon::vmware::connector; + +use strict; +use VMware::VIRuntime; +use VMware::VILib; +use JSON::XS; +use ZMQ::LibZMQ4; +use ZMQ::Constants qw(:all); +use File::Basename; +use POSIX ":sys_wait_h"; +use centreon::vmware::common; + +BEGIN { + # In new version version of LWP (version 6), the backend is now 'IO::Socket::SSL' (instead Crypt::SSLeay) + # it's a hack if you unset that + #$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL"; + + # The option is not omit to verify the certificate chain. + $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; + + eval { + # required for new IO::Socket::SSL versions + require IO::Socket::SSL; + IO::Socket::SSL->import(); + IO::Socket::SSL::set_ctx_defaults(SSL_verify_mode => 0); + }; +} + +my %handlers = (TERM => {}, HUP => {}, CHLD => {}); +my ($connector, $backend); + +sub new { + my ($class, %options) = @_; + $connector = {}; + bless $connector, $class; + $connector->set_signal_handlers; + + $connector->{child_proc} = {}; + $connector->{return_child} = {}; + $connector->{vsphere_connected} = 0; + $connector->{last_time_vsphere} = undef; + $connector->{keeper_session_time} = undef; + $connector->{last_time_check} = undef; + $connector->{perfmanager_view} = undef; + $connector->{perfcounter_cache} = {}; + $connector->{perfcounter_cache_reverse} = {}; + $connector->{perfcounter_refreshrate} = 20; + $connector->{perfcounter_speriod} = -1; + $connector->{stop} = 0; + $connector->{session} = undef; + + $connector->{modules_registry} = $options{modules_registry}; + $connector->{logger} = $options{logger}; + $connector->{whoaim} = $options{name}; + $connector->{vsan_enabled} = $options{vsan_enabled}; + $connector->{config_ipc_file} = $options{config}->{ipc_file}; + $connector->{config_child_timeout} = $options{config}->{timeout}; + $connector->{config_stop_child_timeout} = $options{config}->{timeout_kill}; + $connector->{config_vsphere_session_heartbeat} = $options{config}->{refresh_keeper_session}; + $connector->{config_vsphere_connect_timeout} = $options{config}->{timeout_vsphere}; + $connector->{config_vsphere_url} = $options{config}->{vsphere_server}->{$options{name}}->{url}; + $connector->{config_vsphere_user} = $options{config}->{vsphere_server}->{$options{name}}->{username}; + $connector->{config_vsphere_pass} = $options{config}->{vsphere_server}->{$options{name}}->{password}; + + return $connector; +} + +sub set_signal_handlers { + my $self = shift; + + $SIG{TERM} = \&class_handle_TERM; + $handlers{TERM}->{$self} = sub { $self->handle_TERM() }; + $SIG{HUP} = \&class_handle_HUP; + $handlers{HUP}->{$self} = sub { $self->handle_HUP() }; + $SIG{CHLD} = \&class_handle_CHLD; + $handlers{CHLD}->{$self} = sub { $self->handle_CHLD() }; +} + +sub class_handle_TERM { + foreach (keys %{$handlers{TERM}}) { + &{$handlers{TERM}->{$_}}(); + } +} + +sub class_handle_HUP { + foreach (keys %{$handlers{HUP}}) { + &{$handlers{HUP}->{$_}}(); + } +} + +sub class_handle_CHLD { + foreach (keys %{$handlers{CHLD}}) { + &{$handlers{CHLD}->{$_}}(); + } +} + +sub handle_TERM { + my $self = shift; + $self->{logger}->writeLogInfo("connector '" . $self->{whoaim} . "' Receiving order to stop..."); + $self->{stop} = 1; +} + +sub handle_HUP { + my $self = shift; + $self->{logger}->writeLogInfo("connector $$ Receiving order to reload..."); + # TODO +} + +sub handle_CHLD { + my $self = shift; + my $child_pid; + + while (($child_pid = waitpid(-1, &WNOHANG)) > 0) { + $self->{return_child}->{$child_pid} = {status => 1, rtime => time()}; + } + $SIG{CHLD} = \&class_handle_CHLD; +} + +sub response_router { + my ($self, %options) = @_; + + centreon::vmware::common::init_response(identity => $options{identity}); + centreon::vmware::common::set_response(code => $options{code}, short_message => $options{msg}); + centreon::vmware::common::response(token => 'RESPSERVER2', endpoint => $backend); + centreon::vmware::common::free_response(); +} + +sub verify_child { + my $self = shift; + my $progress = 0; + + # Verify process + foreach (keys %{$self->{child_proc}}) { + # Check ctime + if (defined($self->{return_child}->{$self->{child_proc}->{$_}->{pid}})) { + delete $self->{return_child}->{$self->{child_proc}->{$_}->{pid}}; + delete $self->{child_proc}->{$_}; + } elsif (time() - $self->{child_proc}->{$_}->{ctime} > $self->{config_child_timeout}) { + $self->response_router( + code => -1, + msg => 'Timeout process', + identity => $_ + ); + kill('INT', $self->{child_proc}->{$_}->{pid}); + delete $self->{child_proc}->{$_}; + } else { + $progress++; + } + } + + # Clean old hash CHILD (security) + foreach (keys %{$self->{return_child}}) { + if (time() - $self->{return_child}->{$_}->{rtime} > 600) { + $self->{logger}->writeLogInfo("Clean Old return_child list = " . $_); + delete $self->{return_child}->{$_}; + } + } + + return $progress; +} + +sub reqclient { + my ($self, %options) = @_; + + my $result; + eval { + $result = JSON::XS->new->utf8->decode($options{data}); + }; + if ($@) { + $self->{logger}->writeLogError("Cannot decode JSON: $@ (options{data}"); + return ; + } + + if ($self->{vsphere_connected}) { + $self->{logger}->writeLogInfo("vpshere '" . $self->{whoaim} . "' handler asking: $options{data}"); + + $self->{child_proc}->{$result->{identity}} = { ctime => time() }; + $self->{child_proc}->{$result->{identity}}->{pid} = fork; + if (!$self->{child_proc}->{$result->{identity}}->{pid}) { + $self->{modules_registry}->{$result->{command}}->set_connector(connector => $self); + $self->{modules_registry}->{$result->{command}}->initArgs(arguments => $result); + $self->{modules_registry}->{$result->{command}}->run(); + + centreon::vmware::common::response(token => 'RESPSERVER2', endpoint => $backend, reinit => 'ipc://' . $self->{config_ipc_file}); + zmq_close($backend); + exit(0); + } + } else { + $self->response_router( + code => -1, + msg => 'Container connection problem', + identity => $result->{identity} + ); + } +} + +sub vsphere_event { + while (1) { + # Process all parts of the message + my $msg = zmq_msg_init(); + my $rv = zmq_msg_recv($msg, $backend, undef); + if ($rv == -1) { + $connector->{logger}->writeLogError("zmq_recvmsg error: $!"); + last; + } + my $data = zmq_msg_data($msg); + zmq_msg_close($msg); + + if ($data =~ /^REQCLIENT\s+(.*)$/msi) { + $connector->reqclient(data => $1); + } + + my $more = zmq_getsockopt($backend, ZMQ_RCVMORE); + last unless $more; + } +} + +sub run { + my ($connector) = shift; + my $timeout_process = 0; + + $connector->{logger}->writeLogInfo("'" . $connector->{whoaim} . "' init begin"); + my $context = zmq_init(); + + $backend = zmq_socket($context, ZMQ_DEALER); + zmq_setsockopt($backend, ZMQ_IDENTITY, "server-" . $connector->{whoaim}); + zmq_setsockopt($backend, ZMQ_LINGER, 0); # we discard + zmq_connect($backend, 'ipc://' . $connector->{config_ipc_file}); + centreon::vmware::common::response(token => 'READY', endpoint => $backend, force_response => ''); + + # Initialize poll set + my @poll = ( + { + socket => $backend, + events => ZMQ_POLLIN, + callback => \&vsphere_event, + }, + ); + + $connector->{logger}->writeLogInfo("'" . $connector->{whoaim} . "' init done"); + while (1) { + my $progress = $connector->verify_child(); + + ##### + # Manage ending + ##### + if ($connector->{stop} && $timeout_process > $connector->{config_stop_child_timeout}) { + $connector->{logger}->writeLogError("'" . $connector->{whoaim} . "' Kill child not gently."); + foreach (keys %{$connector->{child_proc}}) { + kill('INT', $connector->{child_proc}->{$_}->{pid}); + } + $progress = 0; + } + if ($connector->{stop} && !$progress) { + if ($connector->{vsphere_connected}) { + eval { + $connector->{session}->logout(); + }; + } + + zmq_close($backend); + exit(0); + } + + ### + # Manage vpshere connection + ### + if ($connector->{vsphere_connected} == 1 && + defined($connector->{last_time_vsphere}) && defined($connector->{last_time_check}) && + $connector->{last_time_vsphere} < $connector->{last_time_check}) { + $connector->{logger}->writeLogError("'" . $connector->{whoaim} . "' Disconnect"); + $connector->{vsphere_connected} = 0; + eval { + $connector->{session}->logout(); + }; + delete $connector->{session}; + } + + if ($connector->{vsphere_connected} == 0) { + if (!centreon::vmware::common::connect_vsphere( + logger => $connector->{logger}, + whoaim => $connector->{whoaim}, + connect_timeout => $connector->{config_vsphere_connect_timeout}, + connector => $connector, + url => $connector->{config_vsphere_url}, + username => $connector->{config_vsphere_user}, + password => $connector->{config_vsphere_pass}, + vsan_enabled => $connector->{vsan_enabled} + ) + ) { + $connector->{logger}->writeLogInfo("'" . $connector->{whoaim} . "' Vsphere connection ok"); + $connector->{logger}->writeLogInfo("'" . $connector->{whoaim} . "' Create perf counters cache in progress"); + if (!centreon::vmware::common::cache_perf_counters($connector)) { + $connector->{last_time_vsphere} = time(); + $connector->{keeper_session_time} = time(); + $connector->{vsphere_connected} = 1; + $connector->{logger}->writeLogInfo("'" . $connector->{whoaim} . "' Create perf counters cache done"); + } + } + } + + ### + # Manage session time + ### + if ($connector->{vsphere_connected} == 1 && + defined($connector->{keeper_session_time}) && + (time() - $connector->{keeper_session_time}) > ($connector->{config_vsphere_session_heartbeat} * 60)) { + centreon::vmware::common::heartbeat(connector => $connector); + } + + my $data_element; + my @rh_set; + if ($connector->{vsphere_connected} == 0) { + sleep(5); + } + if ($connector->{stop} != 0) { + sleep(1); + $timeout_process++; + next; + } + + zmq_poll(\@poll, 5000); + } +} + +1; + +__END__ diff --git a/connectors/vmware/src/centreon/vmware/http/backend/curl.pm b/connectors/vmware/src/centreon/vmware/http/backend/curl.pm new file mode 100644 index 000000000..6d746f913 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/http/backend/curl.pm @@ -0,0 +1,471 @@ +# +# Copyright 2019 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 centreon::vmware::http::backend::curl; + +use strict; +use warnings; +use URI; +use Net::Curl::Easy; +use centreon::vmware::http::backend::curlconstants; + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + $self->{logger} = $options{logger}; + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + + $self->{constant_cb} = \¢reon::vmware::http::backend::curlconstants::get_constant_value; + + if (!defined($options{request}->{curl_opt})) { + $options{request}->{curl_opt} = []; + } +} + +my $http_code_explained = { + 100 => 'Continue', + 101 => 'Switching Protocols', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => '(Unused)', + 307 => 'Temporary Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + 450 => 'Timeout reached', # custom code + 451 => 'Failed Connection Host', # custom code + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported' +}; + +sub cb_debug { + my ($easy, $type, $data, $uservar) = @_; + + chomp $data; + $data =~ s/\r//mg; + + my $msg = ''; + if ($type == $uservar->{constant_cb}->(name => 'CURLINFO_TEXT')) { + $msg = sprintf("== Info: %s", $data); + } + if ($type == $uservar->{constant_cb}->(name => 'CURLINFO_HEADER_OUT')) { + $msg = sprintf("=> Send header: %s", $data); + } + if ($type == $uservar->{constant_cb}->(name => 'CURLINFO_DATA_OUT')) { + $msg = sprintf("=> Send data: %s", $data); + } + if ($type == $uservar->{constant_cb}->(name => 'CURLINFO_SSL_DATA_OUT')) { + #$msg = sprintf("=> Send SSL data: %s", $data); + return 0; + } + if ($type == $uservar->{constant_cb}->(name => 'CURLINFO_HEADER_IN')) { + $msg = sprintf("=> Recv header: %s", $data); + } + if ($type == $uservar->{constant_cb}->(name => 'CURLINFO_DATA_IN')) { + $msg = sprintf("=> Recv data: %s", $data); + } + if ($type == $uservar->{constant_cb}->(name => 'CURLINFO_SSL_DATA_IN')) { + #$msg = sprintf("=> Recv SSL data: %s", $data); + return 0; + } + + $uservar->{logger}->writeLogDebug($msg); + return 0; +} + +sub curl_setopt { + my ($self, %options) = @_; + + eval { + $self->{curl_easy}->setopt($options{option}, $options{parameter}); + }; + if ($@) { + $self->{logger}->writeLogError("curl setopt error: '" . $@ . "'."); + } +} + +sub set_method { + my ($self, %options) = @_; + + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_CUSTOMREQUEST'), parameter => undef); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_POSTFIELDS'), parameter => undef); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_HTTPGET'), parameter => 1); + + if ($options{request}->{method} eq 'GET') { + return ; + } + + if ($options{content_type_forced} == 1) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_POSTFIELDS'), parameter => $options{request}->{query_form_post}) + if (defined($options{request}->{query_form_post})); + } elsif (defined($options{request}->{post_params})) { + my $uri_post = URI->new(); + $uri_post->query_form($options{request}->{post_params}); + push @{$options{headers}}, 'Content-Type: application/x-www-form-urlencoded'; + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_POSTFIELDS'), parameter => $uri_post->query); + } + + if ($options{request}->{method} eq 'POST') { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_POST'), parameter => 1); + } + if ($options{request}->{method} eq 'PUT') { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_CUSTOMREQUEST'), parameter => $options{request}->{method}); + } + if ($options{request}->{method} eq 'DELETE') { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_CUSTOMREQUEST'), parameter => $options{request}->{method}); + } +} + +sub set_auth { + my ($self, %options) = @_; + + if (defined($options{request}->{credentials})) { + if (defined($options{request}->{basic})) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_HTTPAUTH'), parameter => $self->{constant_cb}->(name => 'CURLAUTH_BASIC')); + } elsif (defined($options{request}->{ntlmv2})) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_HTTPAUTH'), parameter => $self->{constant_cb}->(name => 'CURLAUTH_NTLM')); + } else { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_HTTPAUTH'), parameter => $self->{constant_cb}->(name => 'CURLAUTH_ANY')); + } + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_USERPWD'), parameter => $options{request}->{username} . ':' . $options{request}->{password}); + } + + if (defined($options{request}->{cert_file}) && $options{request}->{cert_file} ne '') { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_SSLCERT'), parameter => $options{request}->{cert_file}); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_SSLKEY'), parameter => $options{request}->{key_file}); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_KEYPASSWD'), parameter => $options{request}->{cert_pwd}); + } + + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_SSLCERTTYPE'), parameter => "PEM"); + if (defined($options{request}->{cert_pkcs12})) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_SSLCERTTYPE'), parameter => "P12"); + } +} + +sub set_proxy { + my ($self, %options) = @_; + + if (defined($options{request}->{proxyurl}) && $options{request}->{proxyurl} ne '') { + if ($options{request}->{proxyurl} =~ /^(?:http|https):\/\/(.*?):(.*?)@/) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_PROXYUSERNAME'), parameter => $1); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_PROXYPASSWORD'), parameter => $2); + $options{request}->{proxyurl} =~ s/\/\/$1:$2@//; + } + + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_PROXY'), parameter => $options{request}->{proxyurl}); + } + + if (defined($options{request}->{proxypac}) && $options{request}->{proxypac} ne '') { + $self->{logger}->writeLogError('Unsupported proxypac option'); + } +} + +sub trim { + my ($self, $value) = @_; + + # Sometimes there is a null character + $value =~ s/\x00$//; + $value =~ s/^[ \t\n]+//; + $value =~ s/[ \t\n]+$//; + return $value; +} + +sub set_extra_curl_opt { + my ($self, %options) = @_; + + my $entries = {}; + foreach (@{$options{request}->{curl_opt}}) { + my ($key, $value) = split /=>/; + $key = $self->trim($key); + + if (!defined($entries->{$key})) { + $entries->{$key} = { val => [], force_array => 0 }; + } + + $value = $self->trim($value); + if ($value =~ /^\[(.*)\]$/) { + $entries->{$key}->{force_array} = 1; + $value = $self->trim($1); + } + if ($value =~ /^CURLOPT|CURL/) { + $value = $self->{constant_cb}->(name => $value); + } + + push @{$entries->{$key}->{val}}, $value; + } + + foreach (keys %$entries) { + my $key = $_; + if (/^CURLOPT|CURL/) { + $key = $self->{constant_cb}->(name => $_); + } + + if ($entries->{$_}->{force_array} == 1 || scalar(@{$entries->{$_}->{val}}) > 1) { + $self->curl_setopt(option => $key, parameter => $entries->{$_}->{val}); + } else { + $self->curl_setopt(option => $key, parameter => pop @{$entries->{$_}->{val}}); + } + } +} + + +sub cb_get_header { + my ($easy, $header, $uservar) = @_; + + $header =~ s/[\r\n]//g; + if ($header =~ /^[\r\n]*$/) { + $uservar->{nheaders}++; + } else { + $uservar->{response_headers}->[$uservar->{nheaders}] = {} + if (!defined($uservar->{response_headers}->[$uservar->{nheaders}])); + if ($header =~ /^(\S(?:.*?))\s*:\s*(.*)/) { + my $header_name = lc($1); + $uservar->{response_headers}->[$uservar->{nheaders}]->{$header_name} = [] + if (!defined($uservar->{response_headers}->[$uservar->{nheaders}]->{$header_name})); + push @{$uservar->{response_headers}->[$uservar->{nheaders}]->{$header_name}}, $2; + } else { + $uservar->{response_headers}->[$uservar->{nheaders}]->{response_line} = $header; + } + } + + return length($_[1]); +} + +sub request { + my ($self, %options) = @_; + + if (!defined($self->{curl_easy})) { + $self->{curl_easy} = Net::Curl::Easy->new(); + } + + if ($self->{logger}->is_debug()) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_DEBUGFUNCTION'), parameter => \&cb_debug); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_DEBUGDATA'), parameter => $self); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_VERBOSE'), parameter => 1); + } + + if (defined($options{request}->{timeout})) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_TIMEOUT'), parameter => $options{request}->{timeout}); + } + if (defined($options{request}->{cookies_file})) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_COOKIEFILE'), parameter => $options{request}->{cookies_file}); + } + + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_FOLLOWLOCATION'), parameter => 1); + if (defined($options{request}->{no_follow})) { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_FOLLOWLOCATION'), parameter => 0); + } + + my $url; + if (defined($options{request}->{full_url})) { + $url = $options{request}->{full_url}; + } elsif (defined($options{request}->{port}) && $options{request}->{port} =~ /^[0-9]+$/) { + $url = $options{request}->{proto}. "://" . $options{request}->{hostname} . ':' . $options{request}->{port} . $options{request}->{url_path}; + } else { + $url = $options{request}->{proto}. "://" . $options{request}->{hostname} . $options{request}->{url_path}; + } + + if (defined($options{request}->{http_peer_addr}) && $options{request}->{http_peer_addr} ne '') { + $url =~ /^(?:http|https):\/\/(.*?)(\/|\:|$)/; + $self->{curl_easy}->setopt( + $self->{constant_cb}->(name => 'CURLOPT_RESOLVE'), + [$1 . ':' . $options{request}->{port_force} . ':' . $options{request}->{http_peer_addr}] + ); + } + + my $uri = URI->new($url); + if (defined($options{request}->{get_params})) { + $uri->query_form($options{request}->{get_params}); + } + + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_URL'), parameter => $uri); + + my $headers = []; + my $content_type_forced = 0; + foreach my $key (keys %{$options{request}->{headers}}) { + push @$headers, $key . ':' . $options{request}->{headers}->{$key}; + if ($key =~ /content-type/i) { + $content_type_forced = 1; + } + } + + $self->set_method(%options, content_type_forced => $content_type_forced, headers => $headers); + + if (scalar(@$headers) > 0) { + $self->{curl_easy}->setopt($self->{constant_cb}->(name => 'CURLOPT_HTTPHEADER'), $headers); + } + + if (defined($options{request}->{cacert_file}) && $options{request}->{cacert_file} ne '') { + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_CAINFO'), parameter => $options{request}->{cacert_file}); + } + + $self->set_auth(%options); + $self->set_proxy(%options); + $self->set_extra_curl_opt(%options); + + $self->{response_body} = ''; + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_FILE'), parameter => \$self->{response_body}); + $self->{nheaders} = 0; + $self->{response_headers} = [{}]; + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_HEADERDATA'), parameter => $self); + $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_HEADERFUNCTION'), parameter => \&cb_get_header); + + eval { + $SIG{__DIE__} = sub {}; + + $self->{curl_easy}->perform(); + }; + if ($@) { + my $err = $@; + if (ref($@) eq "Net::Curl::Easy::Code") { + my $num = $@; + if ($num == $self->{constant_cb}->(name => 'CURLE_OPERATION_TIMEDOUT')) { + $self->{response_code} = 450; + } elsif ($num == $self->{constant_cb}->(name => 'CURLE_COULDNT_CONNECT')) { + $self->{response_code} = 451; + } + } + + if (!defined($self->{response_code})) { + $self->{logger}->writeLogError('curl perform error : ' . $err); + } + + return 1; + } + + $self->{response_code} = $self->{curl_easy}->getinfo($self->{constant_cb}->(name => 'CURLINFO_RESPONSE_CODE')); + + return (0, $self->{response_body}); +} + +sub get_headers { + my ($self, %options) = @_; + + my $headers = ''; + foreach (keys %{$self->{response_headers}->[$options{nheader}]}) { + next if (/response_line/); + foreach my $value (@{$self->{response_headers}->[$options{nheader}]->{$_}}) { + $headers .= "$_: " . $value . "\n"; + } + } + + return $headers; +} + +sub get_first_header { + my ($self, %options) = @_; + + if (!defined($options{name})) { + return $self->get_headers(nheader => 0); + } + + return undef + if (!defined($self->{response_headers}->[0]->{ lc($options{name}) })); + return wantarray ? @{$self->{response_headers}->[0]->{ lc($options{name}) }} : $self->{response_headers}->[0]->{ lc($options{name}) }->[0]; +} + +sub get_header { + my ($self, %options) = @_; + + if (!defined($options{name})) { + return $self->get_headers(nheader => -1); + } + + return undef + if (!defined($self->{response_headers}->[-1]->{ lc($options{name}) })); + return wantarray ? @{$self->{response_headers}->[-1]->{ lc($options{name}) }} : $self->{response_headers}->[-1]->{ lc($options{name}) }->[0]; +} + +sub get_code { + my ($self, %options) = @_; + + return $self->{response_code}; +} + +sub get_message { + my ($self, %options) = @_; + + return $http_code_explained->{$self->{response_code}}; +} + +1; + +__END__ + +=head1 NAME + +HTTP Curl backend layer. + +=head1 SYNOPSIS + +HTTP Curl backend layer. + +=head1 BACKEND CURL OPTIONS + +=over 8 + +=item B<--curl-opt> + +Set CURL Options (--curl-opt="CURLOPT_SSL_VERIFYPEER => 0" --curl-opt="CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_1" ). + +=back + +=head1 DESCRIPTION + +B<http>. + +=cut diff --git a/connectors/vmware/src/centreon/vmware/http/backend/curlconstants.pm b/connectors/vmware/src/centreon/vmware/http/backend/curlconstants.pm new file mode 100644 index 000000000..8e409c009 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/http/backend/curlconstants.pm @@ -0,0 +1,33 @@ +# +# Copyright 2019 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 centreon::vmware::http::backend::curlconstants; + +use strict; +use warnings; +use Net::Curl::Easy qw(:constants); + +sub get_constant_value { + my (%options) = @_; + + return eval $options{name}; +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/http/backend/lwp.pm b/connectors/vmware/src/centreon/vmware/http/backend/lwp.pm new file mode 100644 index 000000000..9f718d624 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/http/backend/lwp.pm @@ -0,0 +1,251 @@ +# +# Copyright 2019 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 centreon::vmware::http::backend::lwp; + +use strict; +use warnings; +use centreon::vmware::http::backend::useragent; +use URI; +use IO::Socket::SSL; + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + $self->{logger} = $options{logger}; + $self->{ua} = undef; + $self->{debug_handlers} = 0; + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + + $self->{ssl_context} = ''; + if (!defined($options{request}->{ssl_opt})) { + $options{request}->{ssl_opt} = []; + } + if (defined($options{request}->{ssl}) && $options{request}->{ssl} ne '') { + push @{$options{request}->{ssl_opt}}, 'SSL_version => ' . $options{request}->{ssl}; + } + if (defined($options{request}->{cert_file}) && !defined($options{request}->{cert_pkcs12})) { + push @{$options{request}->{ssl_opt}}, 'SSL_use_cert => 1'; + push @{$options{request}->{ssl_opt}}, 'SSL_cert_file => "' . $options{request}->{cert_file} . '"'; + push @{$options{request}->{ssl_opt}}, 'SSL_key_file => "' . $options{request}->{key_file} . '"' + if (defined($options{request}->{key_file})); + push @{$options{request}->{ssl_opt}}, 'SSL_ca_file => "' . $options{request}->{cacert_file} . '"' + if (defined($options{request}->{cacert_file})); + } + my $append = ''; + foreach (@{$options{request}->{ssl_opt}}) { + if ($_ ne '') { + $self->{ssl_context} .= $append . $_; + $append = ', '; + } + } +} + +sub set_proxy { + my ($self, %options) = @_; + + if (defined($options{request}->{proxyurl}) && $options{request}->{proxyurl} ne '') { + $self->{ua}->proxy(['http', 'https'], $options{request}->{proxyurl}); + } +} + +sub request { + my ($self, %options) = @_; + + my $request_options = $options{request}; + if (!defined($self->{ua})) { + $self->{ua} = centreon::plugins::backend::http::useragent->new( + keep_alive => 1, protocols_allowed => ['http', 'https'], timeout => $request_options->{timeout}, + credentials => $request_options->{credentials}, username => $request_options->{username}, password => $request_options->{password}); + } + + if ($self->{logger}->is_debug() && $self->{debug_handlers} == 0) { + $self->{debug_handlers} = 1; + $self->{ua}->add_handler("request_send", sub { + my ($response, $ua, $handler) = @_; + + $self->{logger}->writeLogDebug("======> request send"); + $self->{logger}->writeLogDebug($response->as_string); + return ; + }); + $self->{ua}->add_handler("response_done", sub { + my ($response, $ua, $handler) = @_; + + $self->{logger}->writeLogDebug("======> response done"); + $self->{logger}->writeLogDebug($response->as_string); + return ; + }); + } + + if (defined($request_options->{no_follow})) { + $self->{ua}->requests_redirectable(undef); + } else { + $self->{ua}->requests_redirectable([ 'GET', 'HEAD', 'POST' ]); + } + if (defined($request_options->{http_peer_addr})) { + push @LWP::Protocol::http::EXTRA_SOCK_OPTS, PeerAddr => $request_options->{http_peer_addr}; + } + + my ($req, $url); + if (defined($request_options->{full_url})) { + $url = $request_options->{full_url}; + } elsif (defined($request_options->{port}) && $request_options->{port} =~ /^[0-9]+$/) { + $url = $request_options->{proto}. "://" . $request_options->{hostname} . ':' . $request_options->{port} . $request_options->{url_path}; + } else { + $url = $request_options->{proto}. "://" . $request_options->{hostname} . $request_options->{url_path}; + } + + my $uri = URI->new($url); + if (defined($request_options->{get_params})) { + $uri->query_form($request_options->{get_params}); + } + $req = HTTP::Request->new($request_options->{method}, $uri); + + my $content_type_forced; + foreach my $key (keys %{$request_options->{headers}}) { + if ($key !~ /content-type/i) { + $req->header($key => $request_options->{headers}->{$key}); + } else { + $content_type_forced = $request_options->{headers}->{$key}; + } + } + + if ($request_options->{method} eq 'POST') { + if (defined($content_type_forced)) { + $req->content_type($content_type_forced); + $req->content($request_options->{query_form_post}); + } else { + my $uri_post = URI->new(); + if (defined($request_options->{post_params})) { + $uri_post->query_form($request_options->{post_params}); + } + $req->content_type('application/x-www-form-urlencoded'); + $req->content($uri_post->query); + } + } + + if (defined($request_options->{credentials}) && defined($request_options->{basic})) { + $req->authorization_basic($request_options->{username}, $request_options->{password}); + } + + $self->set_proxy(request => $request_options, url => $url); + + if (defined($request_options->{cert_pkcs12}) && $request_options->{cert_file} ne '' && $request_options->{cert_pwd} ne '') { + eval "use Net::SSL"; die $@ if $@; + $ENV{HTTPS_PKCS12_FILE} = $request_options->{cert_file}; + $ENV{HTTPS_PKCS12_PASSWORD} = $request_options->{cert_pwd}; + } + + if (defined($self->{ssl_context}) && $self->{ssl_context} ne '') { + my $context = new IO::Socket::SSL::SSL_Context(eval $self->{ssl_context}); + IO::Socket::SSL::set_default_context($context); + } + + $self->{response} = $self->{ua}->request($req); + + $self->{headers} = $self->{response}->headers(); + return (0, $self->{response}->content); +} + +sub get_headers { + my ($self, %options) = @_; + + my $headers = ''; + foreach ($options{response}->header_field_names()) { + $headers .= "$_: " . $options{response}->header($_) . "\n"; + } + + return $headers; +} + +sub get_first_header { + my ($self, %options) = @_; + + my @redirects = $self->{response}->redirects(); + if (!defined($options{name})) { + return $self->get_headers(response => defined($redirects[0]) ? $redirects[0] : $self->{response}); + } + + return + defined($redirects[0]) ? + $redirects[0]->headers()->header($options{name}) : + $self->{headers}->header($options{name}) + ; +} + +sub get_header { + my ($self, %options) = @_; + + if (!defined($options{name})) { + return $self->get_headers(response => $self->{response}); + } + return $self->{headers}->header($options{name}); +} + +sub get_code { + my ($self, %options) = @_; + + return $self->{response}->code(); +} + +sub get_message { + my ($self, %options) = @_; + + return $self->{response}->message(); +} + +1; + +__END__ + +=head1 NAME + +HTTP LWP backend layer. + +=head1 SYNOPSIS + +HTTP LWP backend layer. + +=head1 BACKEND LWP OPTIONS + +=over 8 + +=item B<--ssl-opt> + +Set SSL Options (--ssl-opt="SSL_version => TLSv1" --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE"). + +=item B<--ssl> + +Set SSL version (--ssl=TLSv1). + +=back + +=head1 DESCRIPTION + +B<http>. + +=cut diff --git a/connectors/vmware/src/centreon/vmware/http/backend/useragent.pm b/connectors/vmware/src/centreon/vmware/http/backend/useragent.pm new file mode 100644 index 000000000..228638c2c --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/http/backend/useragent.pm @@ -0,0 +1,50 @@ +# +# Copyright 2019 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 centreon::vmware::http::backend::useragent; + +use strict; +use warnings; +use base 'LWP::UserAgent'; + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + $self = LWP::UserAgent::new(@_); + $self->agent('centreon::vmware::http::backend::useragent'); + + $self->{credentials} = $options{credentials} if defined($options{credentials}); + $self->{username} = $options{username} if defined($options{username}); + $self->{password} = $options{password} if defined($options{password}); + + return $self; +} + +sub get_basic_credentials { + my($self, $realm, $uri, $proxy) = @_; + return if $proxy; + return $self->{username}, $self->{password} if $self->{credentials} and wantarray; + return $self->{username}.":".$self->{password} if $self->{credentials}; + return undef; +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/http/http.pm b/connectors/vmware/src/centreon/vmware/http/http.pm new file mode 100644 index 000000000..f7ab98ae9 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/http/http.pm @@ -0,0 +1,257 @@ +# +# Copyright 2019 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 centreon::vmware::http::http; + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = {}; + bless $self, $class; + + $self->{logger} = $options{logger}; + $self->{options} = { + proto => 'http', + url_path => '/', + timeout => 5, + method => 'GET', + }; + + $self->{add_headers} = {}; + return $self; +} + +sub set_options { + my ($self, %options) = @_; + + $self->{options} = { %{$self->{options}} }; + foreach (keys %options) { + $self->{options}->{$_} = $options{$_} if (defined($options{$_})); + } +} + +sub add_header { + my ($self, %options) = @_; + + $self->{add_headers}->{$options{key}} = $options{value}; +} + +sub mymodule_load { + my ($self, %options) = @_; + my $file; + ($file = ($options{module} =~ /\.pm$/ ? $options{module} : $options{module} . '.pm')) =~ s{::}{/}g; + + eval { + local $SIG{__DIE__} = 'IGNORE'; + require $file; + $file =~ s{/}{::}g; + $file =~ s/\.pm$//; + }; + if ($@) { + $self->{logger}->writeLogError('[core] ' . $options{error_msg} . ' - ' . $@); + return 1; + } + return wantarray ? (0, $file) : 0; +} + +sub check_options { + my ($self, %options) = @_; + + $options{request}->{http_backend} = 'curl' + if (!defined($options{request}->{http_backend}) || $options{request}->{http_backend} eq ''); + $self->{http_backend} = $options{request}->{http_backend}; + if ($self->{http_backend} !~ /^\s*lwp|curl\s*$/i) { + $self->{logger}->writeLogError("Unsupported http backend specified '" . $self->{http_backend} . "'."); + return 1; + } + + if (!defined($self->{backend_lwp}) && !defined($self->{backend_curl})) { + if ($options{request}->{http_backend} eq 'lwp' && $self->mymodule_load( + logger => $options{logger}, module => 'centreon::vmware::http::backend::lwp', + error_msg => "Cannot load module 'centreon::vmware::http::backend::lwp'." + ) == 0) { + $self->{backend_lwp} = centreon::vmware::http::backend::lwp->new(%options, logger => $self->{logger}); + } + + if ($options{request}->{http_backend} eq 'curl' && $self->mymodule_load( + logger => $options{logger}, module => 'centreon::vmware::http::backend::curl', + error_msg => "Cannot load module 'centreon::vmware::http::backend::curl'." + ) == 0) { + $self->{backend_curl} = centreon::vmware::http::backend::curl->new(%options, logger => $self->{logger}); + } + } + + if (($options{request}->{proto} ne 'http') && ($options{request}->{proto} ne 'https')) { + $self->{logger}->writeLogError("Unsupported protocol specified '" . $self->{option_results}->{proto} . "'."); + return 1; + } + if (!defined($options{request}->{hostname})) { + $self->{logger}->writeLogError("Please set the hostname option"); + return 1; + } + if ((defined($options{request}->{credentials})) && (!defined($options{request}->{username}) || !defined($options{request}->{password}))) { + $self->{logger}->writeLogError("You need to set --username= and --password= options when --credentials is used"); + return 1; + } + if ((defined($options{request}->{cert_pkcs12})) && (!defined($options{request}->{cert_file}) && !defined($options{request}->{cert_pwd}))) { + $self->{logger}->writeLogError("You need to set --cert-file= and --cert-pwd= options when --pkcs12 is used"); + return 1; + } + + $options{request}->{port_force} = $self->get_port(); + + $options{request}->{headers} = {}; + if (defined($options{request}->{header})) { + foreach (@{$options{request}->{header}}) { + if (/^(.*?):(.*)/) { + $options{request}->{headers}->{$1} = $2; + } + } + } + foreach (keys %{$self->{add_headers}}) { + $options{request}->{headers}->{$_} = $self->{add_headers}->{$_}; + } + + foreach my $method (('get', 'post')) { + if (defined($options{request}->{$method . '_param'})) { + $options{request}->{$method . '_params'} = {}; + foreach (@{$options{request}->{$method . '_param'}}) { + if (/^([^=]+)={0,1}(.*)$/) { + my $key = $1; + my $value = defined($2) ? $2 : 1; + if (defined($options{request}->{$method . '_params'}->{$key})) { + if (ref($options{request}->{$method . '_params'}->{$key}) ne 'ARRAY') { + $options{request}->{$method . '_params'}->{$key} = [ $options{request}->{$method . '_params'}->{$key} ]; + } + push @{$options{request}->{$method . '_params'}->{$key}}, $value; + } else { + $options{request}->{$method . '_params'}->{$key} = $value; + } + } + } + } + } + + $self->{ 'backend_' . $self->{http_backend} }->check_options(%options); + return 0; +} + +sub get_port { + my ($self, %options) = @_; + + my $port = ''; + if (defined($self->{options}->{port}) && $self->{options}->{port} ne '') { + $port = $self->{options}->{port}; + } else { + $port = 80 if ($self->{options}->{proto} eq 'http'); + $port = 443 if ($self->{options}->{proto} eq 'https'); + } + + return $port; +} + +sub get_port_request { + my ($self, %options) = @_; + + my $port = ''; + if (defined($self->{options}->{port}) && $self->{options}->{port} ne '') { + $port = $self->{options}->{port}; + } + return $port; +} + +sub request { + my ($self, %options) = @_; + + my $request_options = { %{$self->{options}} }; + foreach (keys %options) { + $request_options->{$_} = $options{$_} if (defined($options{$_})); + } + return 1 if ($self->check_options(request => $request_options)); + + return $self->{'backend_' . $self->{http_backend}}->request(request => $request_options); +} + +sub get_first_header { + my ($self, %options) = @_; + + return $self->{'backend_' . $self->{http_backend}}->get_first_header(%options); +} + +sub get_header { + my ($self, %options) = @_; + + return $self->{'backend_' . $self->{http_backend}}->get_header(%options); +} + +sub get_code { + my ($self, %options) = @_; + + return $self->{'backend_' . $self->{http_backend}}->get_code(); +} + +sub get_message { + my ($self, %options) = @_; + + return $self->{'backend_' . $self->{http_backend}}->get_message(); +} + +1; + +__END__ + +=head1 NAME + +HTTP abstraction layer. + +=head1 SYNOPSIS + +HTTP abstraction layer for lwp and curl backends + +=head1 HTTP GLOBAL OPTIONS + +=over 8 + +=item B<--http-peer-addr> + +Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) + +=item B<--proxyurl> + +Proxy URL + +=item B<--proxypac> + +Proxy pac file (can be an url or local file) + +=item B<--http-backend> + +Set the backend used (Default: 'lwp') +For curl: --http-backend=curl + +=back + +=head1 DESCRIPTION + +B<http>. + +=cut diff --git a/connectors/vmware/src/centreon/vmware/logger.pm b/connectors/vmware/src/centreon/vmware/logger.pm new file mode 100644 index 000000000..ab59dad93 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/logger.pm @@ -0,0 +1,218 @@ +# Copyright 2015 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 centreon::vmware::logger; + +=head1 NOM + +centreon::vmware::logger - Simple logging module + +=head1 SYNOPSIS + + #!/usr/bin/perl -w + + use strict; + use warnings; + + use centreon::polling; + + my $logger = new centreon::vmware::logger(); + + $logger->writeLogInfo("information"); + +=head1 DESCRIPTION + +This module offers a simple interface to write log messages to various output: + +* standard output +* file +* syslog + +=cut + +use strict; +use warnings; +use Sys::Syslog qw(:standard :macros); +use IO::Handle; + +my %severities = (1 => LOG_INFO, + 2 => LOG_ERR, + 4 => LOG_DEBUG); + +sub new { + my $class = shift; + + my $self = bless + { + file => 0, + filehandler => undef, + # 0 = nothing, 1 = critical, 3 = info, 7 = debug + severity => 3, + old_severity => 3, + # 0 = stdout, 1 = file, 2 = syslog + log_mode => 0, + # Output pid of current process + withpid => 0, + # syslog + log_facility => undef, + log_option => LOG_PID, + }, $class; + return $self; +} + +sub file_mode($$) { + my ($self, $file) = @_; + + if (defined($self->{filehandler})) { + $self->{filehandler}->close(); + } + if (open($self->{filehandler}, ">>", $file)){ + $self->{log_mode} = 1; + $self->{filehandler}->autoflush(1); + $self->{file_name} = $file; + return 1; + } + $self->{filehandler} = undef; + print STDERR "Cannot open file $file: $!\n"; + return 0; +} + +sub is_file_mode { + my $self = shift; + + if ($self->{log_mode} == 1) { + return 1; + } + return 0; +} + +sub is_debug { + my $self = shift; + + if (($self->{severity} & 4) == 0) { + return 0; + } + return 1; +} + +sub syslog_mode($$$) { + my ($self, $logopt, $facility) = @_; + + $self->{log_mode} = 2; + openlog($0, $logopt, $facility); + return 1; +} + +# For daemons +sub redirect_output { + my $self = shift; + + if ($self->is_file_mode()) { + open my $lfh, '>>', $self->{file_name}; + open STDOUT, '>&', $lfh; + open STDERR, '>&', $lfh; + } +} + +sub set_default_severity { + my $self = shift; + + $self->{severity} = $self->{old_severity}; +} + +# Getter/Setter Log severity +sub severity { + my $self = shift; + if (@_) { + my $save_severity = $self->{severity}; + if ($_[0] =~ /^[012347]$/) { + $self->{severity} = $_[0]; + } elsif ($_[0] eq "none") { + $self->{severity} = 0; + } elsif ($_[0] eq "error") { + $self->{severity} = 1; + } elsif ($_[0] eq "info") { + $self->{severity} = 3; + } elsif ($_[0] eq "debug") { + $self->{severity} = 7; + } else { + $self->writeLogError("Wrong severity value set."); + return -1; + } + $self->{old_severity} = $save_severity; + } + return $self->{severity}; +} + +sub withpid { + my $self = shift; + if (@_) { + $self->{withpid} = $_[0]; + } + return $self->{withpid}; +} + +sub get_date { + my $self = shift; + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); + return sprintf("%04d-%02d-%02d %02d:%02d:%02d", + $year+1900, $mon+1, $mday, $hour, $min, $sec); +} + +sub writeLog($$$%) { + my ($self, $severity, $msg, %options) = @_; + my $withdate = (defined $options{withdate}) ? $options{withdate} : 1; + $msg = ($self->{withpid} == 1) ? "$$ - $msg " : $msg; + my $newmsg = ($withdate) + ? $self->get_date . " - $msg" : $msg; + + if (($self->{severity} & $severity) == 0) { + return; + } + if ($self->{log_mode} == 0) { + print "$newmsg\n"; + } elsif ($self->{log_mode} == 1) { + if (defined $self->{filehandler}) { + print { $self->{filehandler} } "$newmsg\n"; + } + } elsif ($self->{log_mode} == 2) { + syslog($severities{$severity}, $msg); + } +} + +sub writeLogDebug { + shift->writeLog(4, @_); +} + +sub writeLogInfo { + shift->writeLog(2, @_); +} + +sub writeLogError { + shift->writeLog(1, @_); +} + +sub DESTROY { + my $self = shift; + + if (defined $self->{filehandler}) { + $self->{filehandler}->close(); + } +} + +1; diff --git a/connectors/vmware/src/centreon/vmware/script.pm b/connectors/vmware/src/centreon/vmware/script.pm new file mode 100644 index 000000000..b1b9aa8c6 --- /dev/null +++ b/connectors/vmware/src/centreon/vmware/script.pm @@ -0,0 +1,94 @@ +# Copyright 2015 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 centreon::vmware::script; + +use strict; +use warnings; +use FindBin; +use Getopt::Long; +use Pod::Usage; +use centreon::vmware::logger; + +$SIG{__DIE__} = sub { + return unless defined $^S and $^S == 0; # Ignore errors in eval + my $error = shift; + print "Error: $error"; + exit 1; +}; + +sub new { + my ($class, $name, %options) = @_; + my %defaults = + ( + log_file => undef, + severity => "info", + noroot => 0, + ); + my $self = {%defaults, %options}; + + bless $self, $class; + $self->{name} = $name; + $self->{logger} = centreon::vmware::logger->new(); + $self->{options} = { + "logfile=s" => \$self->{log_file}, + "severity=s" => \$self->{severity}, + "help|?" => \$self->{help} + }; + return $self; +} + +sub init { + my $self = shift; + + if (defined $self->{log_file}) { + $self->{logger}->file_mode($self->{log_file}); + } + $self->{logger}->severity($self->{severity}); + + if ($self->{noroot} == 1) { + # Stop exec if root + if ($< == 0) { + $self->{logger}->writeLogError("Can't execute script as root."); + die("Quit"); + } + } +} + +sub add_options { + my ($self, %options) = @_; + + $self->{options} = {%{$self->{options}}, %options}; +} + +sub parse_options { + my $self = shift; + + Getopt::Long::Configure('bundling'); + die "Command line error" if !GetOptions(%{$self->{options}}); + pod2usage(-exitval => 1, -input => $FindBin::Bin . "/" . $FindBin::Script) if $self->{help}; +} + +sub run { + my $self = shift; + + $self->parse_options(); + $self->init(); +} + +1; diff --git a/connectors/vmware/src/centreon_vmware.pl b/connectors/vmware/src/centreon_vmware.pl new file mode 100644 index 000000000..050fd2fd1 --- /dev/null +++ b/connectors/vmware/src/centreon_vmware.pl @@ -0,0 +1,56 @@ +#!/usr/bin/perl +# Copyright 2015 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. + +use warnings; +use FindBin; +use lib "$FindBin::Bin"; +use centreon::script::centreon_vmware; + +centreon::script::centreon_vmware->new()->run(); + +__END__ + +=head1 NAME + +centreon_vmware.pl - a daemon to handle VMWare checks. + +=head1 SYNOPSIS + +centreon_vmware.pl [options] + +=head1 OPTIONS + +=over 8 + +=item B<--config-extra> + +Specify the path to the centreon_vmware configuration file (default: /etc/centreon/centreon_vmware.pm). + +=item B<--help> + +Print a brief help message and exits. + +=back + +=head1 DESCRIPTION + +B<centreon_vmware.pl> will connect to ESX and/or VirtualCenter. +Use the plugin 'apps::vmware::connector::plugin' from: https://github.com/centreon/centreon-plugins + +=cut diff --git a/dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml b/dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml new file mode 100644 index 000000000..ec0a6178a --- /dev/null +++ b/dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml @@ -0,0 +1,67 @@ +name: "perl-VMware-vSphere" +arch: "amd64" +platform: "linux" +version_schema: "none" +version: "7.0.0" +release: "17698549${DIST}" +section: "default" +priority: "optional" +maintainer: "Centreon <contact@centreon.com>" +description: | + The vSphere SDK for Perl is a client-side Perl framework that provides an easy-to-use scripting interface to the vSphere API. + Administrators and developers who are familiar with Perl can use the vSphere SDK for Perl to automate a wide variety of administrative, provisioning, and monitoring tasks in the vSphere environment. + The vSphere SDK for Perl includes ready-to-use utility applications, which you can immediately put to use in your virtual datacenter. + The vSphere SDK for Perl installation includes the WS-Management Perl Library, which allows you to write scripts that retrieve CIM data from the ESX host using CIMOM, a service that provides standard CIM management functions over a WBEM (Web-Based Enterprise Management). + You can use the SDK to manage ESX 3.0.x, ESX/ESXi 3.5, ESX/ESXi 4.0, ESX/ESXi 4.1, ESXi 5.0, vCenter Server 2.5, vCenter Server 4.0, vCenter Server 4.1, and vCenter Server 5.0. + Commit: @COMMIT_HASH@ +vendor: "vmware" +homepage: "https://vmware.com" +license: "GPLv2+" + +contents: + - src: "../../../vmware-vsphere-cli-distrib/VMware" + dst: "@PERL_SITELIB@/VMware" + packager: rpm + - src: "../../../vmware-vsphere-cli-distrib/VMware" + dst: "/usr/share/perl5/VMware" + packager: deb + + - src: "../../../vmware-vsphere-cli-distrib/WSMan" + dst: "@PERL_SITELIB@/WSMan" + packager: rpm + - src: "../../../vmware-vsphere-cli-distrib/WSMan" + dst: "/usr/share/perl5/WSMan" + packager: deb + +overrides: + rpm: + provides: + - perl(VMware::VIRuntime) + depends: + - perl-XML-LibXML >= 1.58 + - perl-libwww-perl >= 5.8.05 + - perl-SOAP-Lite >= 0.67 + - perl-UUID >= 0.03 + - perl-Class-MethodMaker >= 2.08 + deb: + depends: + - libstat-lsmode-perl + - libclass-methodmaker-perl + - libuuid-perl + - libconvert-binhex-perl + - libemail-date-format-perl + - libio-sessiondata-perl + - libmime-lite-perl + - libmime-types-perl + - libmime-tools-perl + - libmailtools-perl + - libnet-smtp-ssl-perl + - libsoap-lite-perl + - libtext-template-perl + - libxml-libxml-perl + +rpm: + compression: zstd + signature: + key_file: ${RPM_SIGNING_KEY_FILE} + key_id: ${RPM_SIGNING_KEY_ID} diff --git a/doc/en/user/guide.rst b/doc/en/user/guide.rst index eddea6df9..00d01f3d4 100644 --- a/doc/en/user/guide.rst +++ b/doc/en/user/guide.rst @@ -489,7 +489,7 @@ You can set the memcached server with the option ``--memcached``: What does ``--dyn-mode`` option do ? ------------------------------------ -With the option, you can used a mode with a plugin. It commonly used for database checks. +With the option, you can use a mode with a plugin. It is commonly used for database checks. For example, I have an application which stores some monitoring information on a database. The developer can use another plugin to create the check (no need to do the SQL connections,... It saves time): :: diff --git a/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json b/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json index 0e63cdedf..ea676ec3b 100644 --- a/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json +++ b/packaging/centreon-plugin-Applications-Cisco-Ssms-Restapi/deb.json @@ -1,5 +1,5 @@ { "dependencies": [ ], - "custom_pkg_data": "Provides: centreon-plugin-Network-Cisco-Ssms-Restapi\\nReplaces: centreon-plugin-Network-Cisco-Ssms-Restapi\\nConflicts: centreon-plugin-Network-Cisco-Ssms-Restapi" + "custom_pkg_data": "Provides: centreon-plugin-network-cisco-ssms-restapi\\nReplaces: centreon-plugin-network-cisco-ssms-restapi\\nConflicts: centreon-plugin-network-cisco-ssms-restapi" } diff --git a/packaging/centreon-plugin-Applications-Protocol-X509/pkg.json b/packaging/centreon-plugin-Applications-Protocol-X509/pkg.json index 1fdcba204..3cf469628 100644 --- a/packaging/centreon-plugin-Applications-Protocol-X509/pkg.json +++ b/packaging/centreon-plugin-Applications-Protocol-X509/pkg.json @@ -4,6 +4,8 @@ "plugin_name": "centreon_protocol_x509.pl", "files": [ "centreon/plugins/script_custom.pm", + "centreon/plugins/backend/ssh/", + "centreon/plugins/ssh.pm", "apps/protocols/x509/" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/deb.json new file mode 100644 index 000000000..bc17ef2ad --- /dev/null +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/deb.json @@ -0,0 +1,5 @@ +{ + "dependencies": [ + "libdatetime-perl" + ] +} diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/pkg.json b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/pkg.json new file mode 100644 index 000000000..da2493eb9 --- /dev/null +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/pkg.json @@ -0,0 +1,10 @@ +{ + "pkg_name": "centreon-plugin-Cloud-Aws-Cloudtrail-Api", + "pkg_summary": "Centreon Plugin to monitor Amazon AWS using Cloudtrail API", + "plugin_name": "centreon_aws_cloudtrail_api.pl", + "files": [ + "centreon/plugins/script_custom.pm", + "cloud/aws/custom/", + "cloud/aws/cloudtrail/" + ] +} diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/rpm.json new file mode 100644 index 000000000..bc30a2c0d --- /dev/null +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/rpm.json @@ -0,0 +1,5 @@ +{ + "dependencies": [ + "perl(DateTime)" + ] +} diff --git a/packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/deb.json b/packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/deb.json similarity index 55% rename from packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/deb.json rename to packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/deb.json index 9757fe112..663aaaceb 100644 --- a/packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/deb.json +++ b/packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/deb.json @@ -1,4 +1,5 @@ { "dependencies": [ + "libsnmp-perl" ] -} +} \ No newline at end of file diff --git a/packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/pkg.json b/packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/pkg.json new file mode 100644 index 000000000..246574411 --- /dev/null +++ b/packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/pkg.json @@ -0,0 +1,14 @@ +{ + "pkg_name": "centreon-plugin-Network-Cambium-Cnpilot-Snmp", + "pkg_summary": "Centreon Plugin", + "plugin_name": "centreon_cambium_cnpilot.pl", + "files": [ + "centreon/plugins/script_snmp.pm", + "centreon/plugins/snmp.pm", + "snmp_standard/mode/listinterfaces.pm", + "snmp_standard/mode/interfaces.pm", + "snmp_standard/mode/uptime.pm", + "snmp_standard/mode/resources/", + "network/cambium/cnpilot/snmp/" + ] +} \ No newline at end of file diff --git a/packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/rpm.json b/packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/rpm.json similarity index 57% rename from packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/rpm.json rename to packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/rpm.json index 9757fe112..418a331fc 100644 --- a/packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/rpm.json +++ b/packaging/centreon-plugin-Network-Cambium-Cnpilot-Snmp/rpm.json @@ -1,4 +1,5 @@ { "dependencies": [ + "perl(SNMP)" ] -} +} \ No newline at end of file diff --git a/packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/pkg.json b/packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/pkg.json deleted file mode 100644 index 499dfb523..000000000 --- a/packaging/centreon-plugin-Network-Cisco-Ssms-Restapi/pkg.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "pkg_name": "centreon-plugin-Network-Cisco-Ssms-Restapi", - "pkg_summary": "Centreon Plugin to monitor Cisco Smart Software Manager Satellite using RestAPI", - "plugin_name": "centreon_cisco_ssms_restapi.pl", - "files": [ - "centreon/plugins/script_custom.pm", - "apps/cisco/ssms/restapi/" - ] -} diff --git a/src/apps/antivirus/clamav/local/mode/updatestatus.pm b/src/apps/antivirus/clamav/local/mode/updatestatus.pm index 56e250204..fff4ca340 100644 --- a/src/apps/antivirus/clamav/local/mode/updatestatus.pm +++ b/src/apps/antivirus/clamav/local/mode/updatestatus.pm @@ -248,32 +248,32 @@ Antivirus daily.cvd file (Default: '/var/lib/clamav/daily.cvd'). =item B<--warning-engine-status> Set warning threshold for status (Default: '') -Can used special variables like: %{last_engine_version}, %{current_engine_version} +You can use the following variables: %{last_engine_version}, %{current_engine_version} =item B<--critical-engine-status> Set critical threshold for status (Default: '%{last_engine_version} ne %{current_engine_version}'). -Can used special variables like: %{last_engine_version}, %{current_engine_version} +You can use the following variables: %{last_engine_version}, %{current_engine_version} =item B<--warning-maindb-status> Set warning threshold for status (Default: '') -Can used special variables like: %{last_maindb_version}, %{current_maindb_version}, %{current_maindb_timediff} +You can use the following variables: %{last_maindb_version}, %{current_maindb_version}, %{current_maindb_timediff} =item B<--critical-maindb-status> Set critical threshold for status (Default: '%{last_maindb_version} ne %{current_maindb_version}'). -Can used special variables like: %{last_maindb_version}, %{current_maindb_version}, %{current_maindb_timediff} +You can use the following variables: %{last_maindb_version}, %{current_maindb_version}, %{current_maindb_timediff} =item B<--warning-dailydb-status> Set warning threshold for status (Default: '') -Can used special variables like: %{last_dailydb_version}, %{current_dailydb_version}, %{current_dailydb_timediff} +You can use the following variables: %{last_dailydb_version}, %{current_dailydb_version}, %{current_dailydb_timediff} =item B<--critical-dailydb-status> Set critical threshold for status (Default: '%{last_dailydb_version} ne %{current_dailydb_version} || %{current_dailydb_timediff} > 432000'). -Can used special variables like: %{last_dailydb_version}, %{current_dailydb_version}, %{current_dailydb_timediff} +You can use the following variables: %{last_dailydb_version}, %{current_dailydb_version}, %{current_dailydb_timediff} =back diff --git a/src/apps/automation/ansible/tower/mode/hosts.pm b/src/apps/automation/ansible/tower/mode/hosts.pm index d5d9bd65e..265ac0e6b 100644 --- a/src/apps/automation/ansible/tower/mode/hosts.pm +++ b/src/apps/automation/ansible/tower/mode/hosts.pm @@ -146,17 +146,17 @@ Display failed hosts list in verbose output. =item B<--unknown-job-status> Set unknown threshold for status (Default: '%{last_job_status} =~ /default/'). -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--warning-job-status> Set warning threshold for status. -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--critical-job-status> Set critical threshold for status (Default: '%{last_job_status} =~ /failed/'). -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/automation/ansible/tower/mode/jobtemplates.pm b/src/apps/automation/ansible/tower/mode/jobtemplates.pm index e8cdd85c9..0d82a5103 100644 --- a/src/apps/automation/ansible/tower/mode/jobtemplates.pm +++ b/src/apps/automation/ansible/tower/mode/jobtemplates.pm @@ -216,17 +216,17 @@ Number of seconds between retries (Default : 10). =item B<--unknown-job-status> Set unknown threshold for status (Default: '%{last_job_status} =~ /default/'). -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--warning-job-status> Set warning threshold for status. -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--critical-job-status> Set critical threshold for status (Default: '%{last_job_status} =~ /failed/'). -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/automation/ansible/tower/mode/schedules.pm b/src/apps/automation/ansible/tower/mode/schedules.pm index 39ad4ea86..c57c678f9 100644 --- a/src/apps/automation/ansible/tower/mode/schedules.pm +++ b/src/apps/automation/ansible/tower/mode/schedules.pm @@ -167,17 +167,17 @@ Filter schedule name (Can use regexp). =item B<--unknown-job-status> Set unknown threshold for status (Default: '%{last_job_status} =~ /default/'). -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--warning-job-status> Set warning threshold for status. -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--critical-job-status> Set critical threshold for status (Default: '%{last_job_status} =~ /failed/'). -Can used special variables like: %{last_job_status}, %{display} +You can use the following variables: %{last_job_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/arcserve/udp/mssql/mode/jobstatus.pm b/src/apps/backup/arcserve/udp/mssql/mode/jobstatus.pm index 547d8402f..629bdbe25 100644 --- a/src/apps/backup/arcserve/udp/mssql/mode/jobstatus.pm +++ b/src/apps/backup/arcserve/udp/mssql/mode/jobstatus.pm @@ -231,17 +231,17 @@ Timezone of mssql server (If not set, we use current server execution timezone). =item B<--ok-status> Set ok threshold for status (Default: '%{status} == 1') -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} == 1') -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{status} != 1'). -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--warning-total> diff --git a/src/apps/backup/backupexec/local/mode/alerts.pm b/src/apps/backup/backupexec/local/mode/alerts.pm index 714fb9ee6..329efdb48 100644 --- a/src/apps/backup/backupexec/local/mode/alerts.pm +++ b/src/apps/backup/backupexec/local/mode/alerts.pm @@ -278,12 +278,12 @@ Only get alerts by severity (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /warning/i') -Can used special variables like: %{name}, %{severity}, %{source}, %{category}, %{timeraised}, %{message} +You can use the following variables: %{name}, %{severity}, %{source}, %{category}, %{timeraised}, %{message} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /error/i'). -Can used special variables like: %{name}, %{severity}, %{source}, %{category}, %{timeraised}, %{message} +You can use the following variables: %{name}, %{severity}, %{source}, %{category}, %{timeraised}, %{message} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/backupexec/local/mode/disks.pm b/src/apps/backup/backupexec/local/mode/disks.pm index 947e4b70f..c32524720 100644 --- a/src/apps/backup/backupexec/local/mode/disks.pm +++ b/src/apps/backup/backupexec/local/mode/disks.pm @@ -305,12 +305,12 @@ Filter disks by type (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name}, %{type}. +You can use the following variables: %{status}, %{name}, %{type}. =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{name}, %{type}. +You can use the following variables: %{status}, %{name}, %{type}. =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/backupexec/local/mode/jobs.pm b/src/apps/backup/backupexec/local/mode/jobs.pm index 5d5b2d8ae..3a1c8804b 100644 --- a/src/apps/backup/backupexec/local/mode/jobs.pm +++ b/src/apps/backup/backupexec/local/mode/jobs.pm @@ -308,22 +308,22 @@ Filter job with end time greater than current time less value in seconds (Defaul =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}. +You can use the following variables: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}. =item B<--critical-status> Set critical threshold for status (Default: 'not %{status} =~ /succeeded/i'). -Can used special variables like: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}. +You can use the following variables: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}. =item B<--warning-long> Set warning threshold for long jobs. -Can used special variables like: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}, %{elapsed}. +You can use the following variables: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}, %{elapsed}. =item B<--critical-long> Set critical threshold for long jobs. -Can used special variables like: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}, %{elapsed}. +You can use the following variables: %{name}, %{status}, %{subStatus}, %{type}, %{isActive}, %{elapsed}. =item B<--warning-detected> diff --git a/src/apps/backup/commvault/commserve/restapi/mode/alerts.pm b/src/apps/backup/commvault/commserve/restapi/mode/alerts.pm index 64c39c6eb..6b4ac6166 100644 --- a/src/apps/backup/commvault/commserve/restapi/mode/alerts.pm +++ b/src/apps/backup/commvault/commserve/restapi/mode/alerts.pm @@ -212,12 +212,12 @@ Filter alerts by type (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /warning/') -Can used special variables like: %{severity}, %{status}, %{type}, %{name}, %{since} +You can use the following variables: %{severity}, %{status}, %{type}, %{name}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical/'). -Can used special variables like: %{severity}, %{status}, %{type}, %{name}, %{since} +You can use the following variables: %{severity}, %{status}, %{type}, %{name}, %{since} =item B<--memory> diff --git a/src/apps/backup/commvault/commserve/restapi/mode/jobs.pm b/src/apps/backup/commvault/commserve/restapi/mode/jobs.pm index 2b1b7cfde..f343dc15b 100644 --- a/src/apps/backup/commvault/commserve/restapi/mode/jobs.pm +++ b/src/apps/backup/commvault/commserve/restapi/mode/jobs.pm @@ -266,22 +266,22 @@ Set timeframe in seconds (E.g '3600' to check last 60 minutes). =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /abnormal/i') -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /errors|failed/i'). -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--warning-long> Set warning threshold for long jobs. -Can used special variables like: %{display}, %{status}, %{elapsed}, %{type} +You can use the following variables: %{display}, %{status}, %{elapsed}, %{type} =item B<--critical-long> Set critical threshold for long jobs. -Can used special variables like: %{display}, %{status}, %{elapsed}, %{type} +You can use the following variables: %{display}, %{status}, %{elapsed}, %{type} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/commvault/commserve/restapi/mode/mediaagents.pm b/src/apps/backup/commvault/commserve/restapi/mode/mediaagents.pm index f3c373186..2ef21ad6c 100644 --- a/src/apps/backup/commvault/commserve/restapi/mode/mediaagents.pm +++ b/src/apps/backup/commvault/commserve/restapi/mode/mediaagents.pm @@ -178,17 +178,17 @@ Filter media agents by name (Can be a regexp). =item B<--unknown-device-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{is_maintenance}, %{offline_reason}, %{name} +You can use the following variables: %{status}, %{is_maintenance}, %{offline_reason}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{is_maintenance} eq "no" and %{status} eq "offline"'). -Can used special variables like: %{status}, %{is_maintenance}, %{offline_reason}, %{name} +You can use the following variables: %{status}, %{is_maintenance}, %{offline_reason}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/commvault/commserve/restapi/mode/storagepools.pm b/src/apps/backup/commvault/commserve/restapi/mode/storagepools.pm index 383d054b6..0705458aa 100644 --- a/src/apps/backup/commvault/commserve/restapi/mode/storagepools.pm +++ b/src/apps/backup/commvault/commserve/restapi/mode/storagepools.pm @@ -167,17 +167,17 @@ Filter storage pools by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /online/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm b/src/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm index 21c47fe11..f7d072bfb 100644 --- a/src/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm +++ b/src/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm @@ -252,17 +252,17 @@ Set timezone (If not set, we use current server execution timezone). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--warning-total> diff --git a/src/apps/backup/netbackup/local/mode/dedupstatus.pm b/src/apps/backup/netbackup/local/mode/dedupstatus.pm index f6c590180..1dab88953 100644 --- a/src/apps/backup/netbackup/local/mode/dedupstatus.pm +++ b/src/apps/backup/netbackup/local/mode/dedupstatus.pm @@ -207,12 +207,12 @@ Set critical threshold in percent. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /up/i'). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =back diff --git a/src/apps/backup/netbackup/local/mode/drivestatus.pm b/src/apps/backup/netbackup/local/mode/drivestatus.pm index 840e54484..097c47b95 100644 --- a/src/apps/backup/netbackup/local/mode/drivestatus.pm +++ b/src/apps/backup/netbackup/local/mode/drivestatus.pm @@ -133,12 +133,12 @@ Filter drive name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /up/i'). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =back diff --git a/src/apps/backup/netbackup/local/mode/jobstatus.pm b/src/apps/backup/netbackup/local/mode/jobstatus.pm index 8302f704c..40575db83 100644 --- a/src/apps/backup/netbackup/local/mode/jobstatus.pm +++ b/src/apps/backup/netbackup/local/mode/jobstatus.pm @@ -336,38 +336,38 @@ Filter job with end time greater than current time less value in seconds (Defaul =item B<--ok-status> Set ok threshold for status (Default: '%{status} == 0') -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} == 1') -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{status} > 1'). -Can used special variables like: %{display}, %{status}, %{type} +You can use the following variables: %{display}, %{status}, %{type} =item B<--warning-long> Set warning threshold for long jobs (Default: none) -Can used special variables like: %{display}, %{status}, %{elapsed}, %{type} +You can use the following variables: %{display}, %{status}, %{elapsed}, %{type} =item B<--critical-long> Set critical threshold for long jobs (Default: none). -Can used special variables like: %{display}, %{status}, %{elapsed}, %{type} +You can use the following variables: %{display}, %{status}, %{elapsed}, %{type} =item B<--warning-frozen> Set warning threshold for frozen jobs (Default: none) -Can used special variables like: +You can use the following variables: %{display}, %{status}, %{elapsed}, %{type}, %{kb}, %{parentid}, %{schedule}, %{jobid} =item B<--critical-frozen> Set critical threshold for frozen jobs (Default: '%{state} =~ /active|queue/ && %{kb} == 0'). -Can used special variables like: +You can use the following variables: %{display}, %{status}, %{elapsed}, %{type}, %{kb}, %{parentid}, %{schedule}, %{jobid} =item B<--warning-total> diff --git a/src/apps/backup/quadstor/local/mode/vtldiskusage.pm b/src/apps/backup/quadstor/local/mode/vtldiskusage.pm index f3519b174..955f14c0c 100644 --- a/src/apps/backup/quadstor/local/mode/vtldiskusage.pm +++ b/src/apps/backup/quadstor/local/mode/vtldiskusage.pm @@ -226,12 +226,12 @@ Thresholds are on free tape left. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /active/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/apps/backup/quadstor/local/mode/vtljobstatus.pm b/src/apps/backup/quadstor/local/mode/vtljobstatus.pm index 8be950d8b..ec34cca57 100644 --- a/src/apps/backup/quadstor/local/mode/vtljobstatus.pm +++ b/src/apps/backup/quadstor/local/mode/vtljobstatus.pm @@ -177,32 +177,32 @@ Command used: '/quadstorvtl/bin/impexp -l' =item B<--warning-status> Set warning threshold for status (Default: none) -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error/i'). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--warning-long> Set warning threshold for long jobs (Default: none) -Can used special variables like: %{display}, %{status}, %{elapsed} +You can use the following variables: %{display}, %{status}, %{elapsed} =item B<--critical-long> Set critical threshold for long jobs (Default: none). -Can used special variables like: %{display}, %{status}, %{elapsed} +You can use the following variables: %{display}, %{status}, %{elapsed} =item B<--warning-frozen> Set warning threshold for frozen jobs (Default: none) -Can used special variables like: %{display}, %{status}, %{elapsed}, %{kb} +You can use the following variables: %{display}, %{status}, %{elapsed}, %{kb} =item B<--critical-frozen> Set critical threshold for frozen jobs (Default: none). -Can used special variables like: %{display}, %{status}, %{elapsed}, %{kb} +You can use the following variables: %{display}, %{status}, %{elapsed}, %{kb} =back diff --git a/src/apps/backup/quadstor/local/mode/vtltapeusage.pm b/src/apps/backup/quadstor/local/mode/vtltapeusage.pm index 41fa4cf5d..f5aeae453 100644 --- a/src/apps/backup/quadstor/local/mode/vtltapeusage.pm +++ b/src/apps/backup/quadstor/local/mode/vtltapeusage.pm @@ -252,12 +252,12 @@ Thresholds are on free tape left. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /active/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/rapidrecovery/snmp/mode/agent.pm b/src/apps/backup/rapidrecovery/snmp/mode/agent.pm index bdf5f88fd..90525aaa2 100644 --- a/src/apps/backup/rapidrecovery/snmp/mode/agent.pm +++ b/src/apps/backup/rapidrecovery/snmp/mode/agent.pm @@ -158,17 +158,17 @@ Check agents. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unreachable/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /failed|authenticationError/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/rapidrecovery/snmp/mode/repository.pm b/src/apps/backup/rapidrecovery/snmp/mode/repository.pm index f006046ee..dffb5be76 100644 --- a/src/apps/backup/rapidrecovery/snmp/mode/repository.pm +++ b/src/apps/backup/rapidrecovery/snmp/mode/repository.pm @@ -188,17 +188,17 @@ Check repositories. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/rubrik/restapi/mode/cluster.pm b/src/apps/backup/rubrik/restapi/mode/cluster.pm index e55dbcfe6..915b0f6a7 100644 --- a/src/apps/backup/rubrik/restapi/mode/cluster.pm +++ b/src/apps/backup/rubrik/restapi/mode/cluster.pm @@ -174,17 +174,17 @@ Which cluster to check (Default: 'me'). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/rubrik/restapi/mode/disks.pm b/src/apps/backup/rubrik/restapi/mode/disks.pm index c19112e25..ebbaf6eb8 100644 --- a/src/apps/backup/rubrik/restapi/mode/disks.pm +++ b/src/apps/backup/rubrik/restapi/mode/disks.pm @@ -178,17 +178,17 @@ Filter disks by disk id (can be a regexp). =item B<--unknown-disks-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{id} +You can use the following variables: %{status}, %{id} =item B<--warning-disk-status> Set warning threshold for status. -Can used special variables like: %{status}, %{id} +You can use the following variables: %{status}, %{id} =item B<--critical-disk-status> Set critical threshold for status (Default: '%{status} !~ /active/i'). -Can used special variables like: %{status}, %{id} +You can use the following variables: %{status}, %{id} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/rubrik/restapi/mode/nodes.pm b/src/apps/backup/rubrik/restapi/mode/nodes.pm index cbbb446f0..0f82513de 100644 --- a/src/apps/backup/rubrik/restapi/mode/nodes.pm +++ b/src/apps/backup/rubrik/restapi/mode/nodes.pm @@ -178,17 +178,17 @@ Filter nodes by node id (can be a regexp). =item B<--unknown-node-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{ip_address}, %{id} +You can use the following variables: %{status}, %{ip_address}, %{id} =item B<--warning-node-status> Set warning threshold for status. -Can used special variables like: %{status}, %{ip_address}, %{id} +You can use the following variables: %{status}, %{ip_address}, %{id} =item B<--critical-node-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{ip_address}, %{id} +You can use the following variables: %{status}, %{ip_address}, %{id} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/tsm/local/mode/actlog.pm b/src/apps/backup/tsm/local/mode/actlog.pm index 2cd24936c..21ee83654 100644 --- a/src/apps/backup/tsm/local/mode/actlog.pm +++ b/src/apps/backup/tsm/local/mode/actlog.pm @@ -159,12 +159,12 @@ Get activity log more recent than X hour(s) (default: '1'). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /warning/') -Can used special variables like: %{message}, %{severity}, %{since} +You can use the following variables: %{message}, %{severity}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /error|severe/'). -Can used special variables like: %{message}, %{severity}, %{since} +You can use the following variables: %{message}, %{severity}, %{since} =item B<--timezone> diff --git a/src/apps/backup/tsm/local/mode/sessions.pm b/src/apps/backup/tsm/local/mode/sessions.pm index 89bdc49d5..0e13aa9b8 100644 --- a/src/apps/backup/tsm/local/mode/sessions.pm +++ b/src/apps/backup/tsm/local/mode/sessions.pm @@ -182,12 +182,12 @@ Filter by session type. =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{client_name}, %{state}, %{session_type}, %{since} +You can use the following variables: %{client_name}, %{state}, %{session_type}, %{since} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{client_name}, %{state}, %{session_type}, %{since} +You can use the following variables: %{client_name}, %{state}, %{session_type}, %{since} =item B<--warning-*> diff --git a/src/apps/backup/veeam/local/mode/jobstatus.pm b/src/apps/backup/veeam/local/mode/jobstatus.pm index d106d3ad5..f84953bea 100644 --- a/src/apps/backup/veeam/local/mode/jobstatus.pm +++ b/src/apps/backup/veeam/local/mode/jobstatus.pm @@ -319,27 +319,27 @@ Filter job with end time greater than current time less value in seconds (Defaul =item B<--ok-status> Set ok threshold for status. -Can used special variables like: %{display}, %{status}, %{type}, %{is_running}, %{scheduled}. +You can use the following variables: %{display}, %{status}, %{type}, %{is_running}, %{scheduled}. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{status}, %{type}, %{is_running}, %{scheduled}. +You can use the following variables: %{display}, %{status}, %{type}, %{is_running}, %{scheduled}. =item B<--critical-status> Set critical threshold for status (Default: '%{is_running} == 0 and not %{status} =~ /Success/i'). -Can used special variables like: %{display}, %{status}, %{type}, %{is_running}, %{scheduled}. +You can use the following variables: %{display}, %{status}, %{type}, %{is_running}, %{scheduled}. =item B<--warning-long> Set warning threshold for long jobs. -Can used special variables like: %{display}, %{status}, %{type}, %{elapsed}. +You can use the following variables: %{display}, %{status}, %{type}, %{elapsed}. =item B<--critical-long> Set critical threshold for long jobs. -Can used special variables like: %{display}, %{status}, %{type}, %{elapsed}. +You can use the following variables: %{display}, %{status}, %{type}, %{elapsed}. =item B<--warning-total> diff --git a/src/apps/backup/veeam/local/mode/licenses.pm b/src/apps/backup/veeam/local/mode/licenses.pm index 02b273799..1f4acdaa3 100644 --- a/src/apps/backup/veeam/local/mode/licenses.pm +++ b/src/apps/backup/veeam/local/mode/licenses.pm @@ -338,12 +338,12 @@ Filter licenses by status (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{to}, %{status}, %{type}. +You can use the following variables: %{to}, %{status}, %{type}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /expired|invalid/i'). -Can used special variables like: %{to}, %{status}, %{type}. +You can use the following variables: %{to}, %{status}, %{type}. =item B<--unit> diff --git a/src/apps/backup/veeam/local/mode/repositories.pm b/src/apps/backup/veeam/local/mode/repositories.pm index 5e98b57f2..de9ac9a73 100644 --- a/src/apps/backup/veeam/local/mode/repositories.pm +++ b/src/apps/backup/veeam/local/mode/repositories.pm @@ -302,12 +302,12 @@ Filter repositories by type (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name}, %{type}. +You can use the following variables: %{status}, %{name}, %{type}. =item B<--critical-status> Set critical threshold for status (Default: 'not %{status} =~ /ordinal|maintenance/i'). -Can used special variables like: %{status}, %{name}, %{type}. +You can use the following variables: %{status}, %{name}, %{type}. =item B<--warning-*> B<--critical-*> diff --git a/src/apps/backup/veeam/local/mode/tapejobs.pm b/src/apps/backup/veeam/local/mode/tapejobs.pm index e443f844d..b75663413 100644 --- a/src/apps/backup/veeam/local/mode/tapejobs.pm +++ b/src/apps/backup/veeam/local/mode/tapejobs.pm @@ -255,17 +255,17 @@ Filter job type (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '') -Can used special variables like: %{display}, %{enabled}, %{type}, %{last_result}, %{last_state}. +You can use the following variables: %{display}, %{enabled}, %{type}, %{last_result}, %{last_state}. =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{display}, %{enabled}, %{type}, %{last_result}, %{last_state}. +You can use the following variables: %{display}, %{enabled}, %{type}, %{last_result}, %{last_state}. =item B<--critical-status> Set critical threshold for status (Default: '%{enabled} == 1 and not %{last_result} =~ /Success|None/i'). -Can used special variables like: %{display}, %{enabled}, %{type}, %{last_result}, %{last_state}. +You can use the following variables: %{display}, %{enabled}, %{type}, %{last_result}, %{last_state}. =item B<--warning-total> diff --git a/src/apps/backup/veeam/local/mode/vsbjobs.pm b/src/apps/backup/veeam/local/mode/vsbjobs.pm index 48949d4e6..8c699725b 100644 --- a/src/apps/backup/veeam/local/mode/vsbjobs.pm +++ b/src/apps/backup/veeam/local/mode/vsbjobs.pm @@ -291,17 +291,17 @@ Filter job type (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{name}, %{type}, %{status}, %{duration}. +You can use the following variables: %{name}, %{type}, %{status}, %{duration}. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{type}, %{status}, %{duration}. +You can use the following variables: %{name}, %{type}, %{status}, %{duration}. =item B<--critical-status> Set critical threshold for status (Default: 'not %{status} =~ /success/i'). -Can used special variables like: %{name}, %{type}, %{status}, %{duration}. +You can use the following variables: %{name}, %{type}, %{status}, %{duration}. =item B<--warning-*> B<--critical-*> diff --git a/src/apps/centreon/local/mode/brokerstats.pm b/src/apps/centreon/local/mode/brokerstats.pm index 091daf519..17d65ebb4 100644 --- a/src/apps/centreon/local/mode/brokerstats.pm +++ b/src/apps/centreon/local/mode/brokerstats.pm @@ -245,12 +245,12 @@ Can be: 'speed-events', 'queued-events', 'unacknowledged-events'. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{queue_file_enabled}, %{state}, %{status}, %{type}, %{display} +You can use the following variables: %{queue_file_enabled}, %{state}, %{status}, %{type}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{type} eq "output" and %{queue_file_enabled} =~ /yes/i'). -Can used special variables like: %{queue_file_enabled}, %{state}, %{status}, %{type}, %{display} +You can use the following variables: %{queue_file_enabled}, %{state}, %{status}, %{type}, %{display} =back diff --git a/src/apps/ceph/restapi/mode/health.pm b/src/apps/ceph/restapi/mode/health.pm index 0fc0e5dd6..8ceefde9c 100644 --- a/src/apps/ceph/restapi/mode/health.pm +++ b/src/apps/ceph/restapi/mode/health.pm @@ -101,12 +101,12 @@ Check overall cluster status. =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /warn/i') -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error/i'). -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =back diff --git a/src/apps/cisco/cms/restapi/mode/alarms.pm b/src/apps/cisco/cms/restapi/mode/alarms.pm index e2f7e6655..9e6cc8ead 100644 --- a/src/apps/cisco/cms/restapi/mode/alarms.pm +++ b/src/apps/cisco/cms/restapi/mode/alarms.pm @@ -145,12 +145,12 @@ Filter by type (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{type}, %{active_time} +You can use the following variables: %{type}, %{active_time} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{type}, %{active_time} +You can use the following variables: %{type}, %{active_time} =item B<--memory> diff --git a/src/apps/cisco/ssms/restapi/mode/licenses.pm b/src/apps/cisco/ssms/restapi/mode/licenses.pm index c4a8dd43e..751f7d592 100644 --- a/src/apps/cisco/ssms/restapi/mode/licenses.pm +++ b/src/apps/cisco/ssms/restapi/mode/licenses.pm @@ -199,17 +199,17 @@ Filter license name (can be a regexp). =item B<--unknown-license-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-license-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-license-status> Set critical threshold for status (Default: '%{status} !~ /in compliance/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/controlm/restapi/mode/jobs.pm b/src/apps/controlm/restapi/mode/jobs.pm index 20ca5072d..0953d7b7d 100644 --- a/src/apps/controlm/restapi/mode/jobs.pm +++ b/src/apps/controlm/restapi/mode/jobs.pm @@ -304,22 +304,22 @@ Can use format: 'Europe/London' or '+0100'. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{status}, %{application}, %{folder}, %{type} +You can use the following variables: %{name}, %{status}, %{application}, %{folder}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /ended not ok/i'). -Can used special variables like: %{name}, %{status}, %{application}, %{folder}, %{type} +You can use the following variables: %{name}, %{status}, %{application}, %{folder}, %{type} =item B<--warning-long> Set warning threshold for long jobs. -Can used special variables like: %{name}, %{status}, %{elapsed}, %{application}, %{folder}, %{type} +You can use the following variables: %{name}, %{status}, %{elapsed}, %{application}, %{folder}, %{type} =item B<--critical-long> Set critical threshold for long jobs. -Can used special variables like: %{name}, %{status}, %{elapsed}, %{application}, %{folder}, %{type} +You can use the following variables: %{name}, %{status}, %{elapsed}, %{application}, %{folder}, %{type} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/emc/ppma/restapi/mode/hosts.pm b/src/apps/emc/ppma/restapi/mode/hosts.pm index d66f25257..c4eb225e1 100644 --- a/src/apps/emc/ppma/restapi/mode/hosts.pm +++ b/src/apps/emc/ppma/restapi/mode/hosts.pm @@ -199,17 +199,17 @@ Filter hosts by host name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /powerPathManaged/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/ericsson/enm/api/mode/nodes.pm b/src/apps/ericsson/enm/api/mode/nodes.pm index 90e0a0266..46ce7a6a1 100644 --- a/src/apps/ericsson/enm/api/mode/nodes.pm +++ b/src/apps/ericsson/enm/api/mode/nodes.pm @@ -261,47 +261,47 @@ Filter tdd cells by id (can be a regexp). =item B<--unknown-node-sync-status> Set unknown threshold for synchronization status. -Can used special variables like: %{node_id}, %{sync_status} +You can use the following variables: %{node_id}, %{sync_status} =item B<--warning-node-sync-status> Set warning threshold for synchronization status. -Can used special variables like: %{node_id}, %{sync_status} +You can use the following variables: %{node_id}, %{sync_status} =item B<--critical-node-sync-status> Set critical threshold for synchronization status (Default: '%{sync_status} =~ /unsynchronized/i'). -Can used special variables like: %{node_id}, %{sync_status} +You can use the following variables: %{node_id}, %{sync_status} =item B<--unknown-fru-status> Set unknown threshold for field replaceable unit status. -Can used special variables like: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} +You can use the following variables: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} =item B<--warning-fru-status> Set warning threshold for field replaceable unit status. -Can used special variables like: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} +You can use the following variables: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} =item B<--critical-fru-status> Set critical threshold for field replaceable unit status. -Can used special variables like: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} +You can use the following variables: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} =item B<--unknown-cell-tdd-status> Set unknown threshold for cell tdd status. -Can used special variables like: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} +You can use the following variables: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} =item B<--warning-cell-tdd-status> Set warning threshold for cell tdd status. -Can used special variables like: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} +You can use the following variables: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} =item B<--critical-cell-tdd-status> Set critical threshold for cell tdd status. -Can used special variables like: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} +You can use the following variables: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/grafana/api/mode/health.pm b/src/apps/grafana/api/mode/health.pm index e6f82173a..4013481ba 100644 --- a/src/apps/grafana/api/mode/health.pm +++ b/src/apps/grafana/api/mode/health.pm @@ -88,12 +88,12 @@ Check health. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{version} +You can use the following variables: %{state}, %{version} =item B<--critical-status> Set critical threshold for status (Default: '%{state} ne "ok"'). -Can used special variables like: %{state}, %{version} +You can use the following variables: %{state}, %{version} =back diff --git a/src/apps/haproxy/snmp/mode/backendusage.pm b/src/apps/haproxy/snmp/mode/backendusage.pm index 40c53c0c2..7e87a50c5 100644 --- a/src/apps/haproxy/snmp/mode/backendusage.pm +++ b/src/apps/haproxy/snmp/mode/backendusage.pm @@ -235,12 +235,12 @@ Filter backend name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /UP/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/haproxy/snmp/mode/frontendusage.pm b/src/apps/haproxy/snmp/mode/frontendusage.pm index 8fb9119d5..430607b23 100644 --- a/src/apps/haproxy/snmp/mode/frontendusage.pm +++ b/src/apps/haproxy/snmp/mode/frontendusage.pm @@ -226,12 +226,12 @@ Filter backend name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /OPEN/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/hddtemp/mode/temperatures.pm b/src/apps/hddtemp/mode/temperatures.pm index 8e8bbcb94..46bc5dd64 100644 --- a/src/apps/hddtemp/mode/temperatures.pm +++ b/src/apps/hddtemp/mode/temperatures.pm @@ -147,17 +147,17 @@ Filter drive name (Can use regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/ibm/tsamp/local/mode/resourcegroups.pm b/src/apps/ibm/tsamp/local/mode/resourcegroups.pm index 47eba739b..3aaa561f3 100644 --- a/src/apps/ibm/tsamp/local/mode/resourcegroups.pm +++ b/src/apps/ibm/tsamp/local/mode/resourcegroups.pm @@ -171,17 +171,17 @@ Exclude resource groups by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{opState} =~ /unknown/i'). -Can used special variables like: %{opState}, %{nominalState}, %{name} +You can use the following variables: %{opState}, %{nominalState}, %{name} =item B<--warning-status> Set warning threshold for status (Default: '%{opState} =~ /pending/i'). -Can used special variables like: %{opState}, %{nominalState}, %{name} +You can use the following variables: %{opState}, %{nominalState}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{opState} =~ /failed offline|stuck online/i || %{opState} ne %{nominalState}'). -Can used special variables like: %{opState}, %{nominalState}, %{name} +You can use the following variables: %{opState}, %{nominalState}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/inin/ig/snmp/mode/spanusage.pm b/src/apps/inin/ig/snmp/mode/spanusage.pm index b8bba26fa..fff598de8 100644 --- a/src/apps/inin/ig/snmp/mode/spanusage.pm +++ b/src/apps/inin/ig/snmp/mode/spanusage.pm @@ -158,12 +158,12 @@ Filter span name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /closed|ready/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/apps/inin/mediaserver/snmp/mode/cmdsrvusage.pm b/src/apps/inin/mediaserver/snmp/mode/cmdsrvusage.pm index 03113d23b..9f6696f7e 100644 --- a/src/apps/inin/mediaserver/snmp/mode/cmdsrvusage.pm +++ b/src/apps/inin/mediaserver/snmp/mode/cmdsrvusage.pm @@ -242,12 +242,12 @@ Filter client name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{accept_sessions}, %{status}, %{display} +You can use the following variables: %{accept_sessions}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^ready/i'). -Can used special variables like: %{accept_sessions}, %{status}, %{display} +You can use the following variables: %{accept_sessions}, %{status}, %{display} =item B<--warning-*> diff --git a/src/apps/java/awa/jmx/mode/agent.pm b/src/apps/java/awa/jmx/mode/agent.pm index 5c4f8dde8..e236c430b 100644 --- a/src/apps/java/awa/jmx/mode/agent.pm +++ b/src/apps/java/awa/jmx/mode/agent.pm @@ -168,12 +168,12 @@ Filter agent name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{since}, %{display}, %{ipaddress}, %{active} +You can use the following variables: %{since}, %{display}, %{ipaddress}, %{active} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{since}, %{display}, %{ipaddress}, %{active} +You can use the following variables: %{since}, %{display}, %{ipaddress}, %{active} =item B<--timezone> diff --git a/src/apps/java/awa/jmx/mode/queue.pm b/src/apps/java/awa/jmx/mode/queue.pm index 44ff9cfd0..bb1d1b343 100644 --- a/src/apps/java/awa/jmx/mode/queue.pm +++ b/src/apps/java/awa/jmx/mode/queue.pm @@ -139,12 +139,12 @@ Filter queue name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /GREEN/i'). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =back diff --git a/src/apps/java/awa/jmx/mode/server.pm b/src/apps/java/awa/jmx/mode/server.pm index f28d63588..a202f72e6 100644 --- a/src/apps/java/awa/jmx/mode/server.pm +++ b/src/apps/java/awa/jmx/mode/server.pm @@ -143,12 +143,12 @@ Filter server name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{display}, %{ipaddress}, %{active} +You can use the following variables: %{display}, %{ipaddress}, %{active} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{display}, %{ipaddress}, %{active} +You can use the following variables: %{display}, %{ipaddress}, %{active} =back diff --git a/src/apps/keepalived/snmp/mode/vrrpstatus.pm b/src/apps/keepalived/snmp/mode/vrrpstatus.pm index d1e258f25..a820eaf58 100644 --- a/src/apps/keepalived/snmp/mode/vrrpstatus.pm +++ b/src/apps/keepalived/snmp/mode/vrrpstatus.pm @@ -144,12 +144,12 @@ Check VRRP instances status. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{instanceWantedState}, %{instanceStateLast}, %{instanceState}, %{instancePrimaryInterface} +You can use the following variables: %{instanceWantedState}, %{instanceStateLast}, %{instanceState}, %{instancePrimaryInterface} =item B<--critical-status> Set critical threshold for status (Default: '%{instanceState} ne %{instanceWantedState} or %{instanceState} ne %{instanceStateLast}'). -Can used special variables like: %{instanceWantedState}, %{instanceStateLast}, %{instanceState}, %{instancePrimaryInterface} +You can use the following variables: %{instanceWantedState}, %{instanceStateLast}, %{instanceState}, %{instancePrimaryInterface} =back diff --git a/src/apps/microsoft/activedirectory/local/mode/dcdiag.pm b/src/apps/microsoft/activedirectory/local/mode/dcdiag.pm index 098142e3f..a5bfd6598 100644 --- a/src/apps/microsoft/activedirectory/local/mode/dcdiag.pm +++ b/src/apps/microsoft/activedirectory/local/mode/dcdiag.pm @@ -107,6 +107,14 @@ sub read_config { <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> </root> END_FILE diff --git a/src/apps/microsoft/activedirectory/wsman/mode/dcdiag.pm b/src/apps/microsoft/activedirectory/wsman/mode/dcdiag.pm index 2beff1a9f..31fd956cb 100644 --- a/src/apps/microsoft/activedirectory/wsman/mode/dcdiag.pm +++ b/src/apps/microsoft/activedirectory/wsman/mode/dcdiag.pm @@ -129,6 +129,14 @@ sub read_config { <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> </root> END_FILE diff --git a/src/apps/microsoft/dhcp/snmp/mode/subnets.pm b/src/apps/microsoft/dhcp/snmp/mode/subnets.pm index 9df1296ab..e99ce1933 100644 --- a/src/apps/microsoft/dhcp/snmp/mode/subnets.pm +++ b/src/apps/microsoft/dhcp/snmp/mode/subnets.pm @@ -202,17 +202,17 @@ Filter subnets by address (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/microsoft/exchange/local/mode/activesyncmailbox.pm b/src/apps/microsoft/exchange/local/mode/activesyncmailbox.pm index 2c5578362..05d1d91c2 100644 --- a/src/apps/microsoft/exchange/local/mode/activesyncmailbox.pm +++ b/src/apps/microsoft/exchange/local/mode/activesyncmailbox.pm @@ -190,12 +190,12 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--critical> Set critical threshold (Default: '%{result} !~ /Success/i'). -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--mailbox> diff --git a/src/apps/microsoft/exchange/local/mode/databases.pm b/src/apps/microsoft/exchange/local/mode/databases.pm index c3904a690..2c0cd0fbd 100644 --- a/src/apps/microsoft/exchange/local/mode/databases.pm +++ b/src/apps/microsoft/exchange/local/mode/databases.pm @@ -447,42 +447,42 @@ Skip mapi/mailflow test (regexp can be used. In Powershell). =item B<--warning-status> Set warning threshold. -Can used special variables like: %{mounted}, %{database}, %{server} +You can use the following variables: %{mounted}, %{database}, %{server} =item B<--critical-status> Set critical threshold (Default: '%{mounted} == 0'). -Can used special variables like: %{mounted}, %{database}, %{server} +You can use the following variables: %{mounted}, %{database}, %{server} =item B<--warning-mapi> Set warning threshold. -Can used special variables like: %{mapi_result}, %{database}, %{server} +You can use the following variables: %{mapi_result}, %{database}, %{server} =item B<--critical-mapi> Set critical threshold (Default: '%{mapi_result} !~ /Success/i'). -Can used special variables like: %{mapi_result}, %{database}, %{server} +You can use the following variables: %{mapi_result}, %{database}, %{server} =item B<--warning-mailflow> Set warning threshold. -Can used special variables like: %{mailflow_result}, %{database}, %{server} +You can use the following variables: %{mailflow_result}, %{database}, %{server} =item B<--critical-mailflow> Set critical threshold (Default: '%{mailflow_result} !~ /Success/i'). -Can used special variables like: %{mailflow_result}, %{database}, %{server} +You can use the following variables: %{mailflow_result}, %{database}, %{server} =item B<--warning-copystatus> Set warning threshold. -Can used special variables like: %{mailflow_result}, %{database}, %{server} +You can use the following variables: %{mailflow_result}, %{database}, %{server} =item B<--critical-copystatus> Set critical threshold (Default: '%{contentindexstate} !~ /Healthy/i'). -Can used special variables like: %{copystatus_indexstate}, %{database}, %{server} +You can use the following variables: %{copystatus_indexstate}, %{database}, %{server} =back diff --git a/src/apps/microsoft/exchange/local/mode/imapmailbox.pm b/src/apps/microsoft/exchange/local/mode/imapmailbox.pm index 2c0e4f594..636430652 100644 --- a/src/apps/microsoft/exchange/local/mode/imapmailbox.pm +++ b/src/apps/microsoft/exchange/local/mode/imapmailbox.pm @@ -188,12 +188,12 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--critical> Set critical threshold (Default: '%{result} !~ /Success/i'). -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--mailbox> diff --git a/src/apps/microsoft/exchange/local/mode/mapimailbox.pm b/src/apps/microsoft/exchange/local/mode/mapimailbox.pm index 1561128ad..8b70588dc 100644 --- a/src/apps/microsoft/exchange/local/mode/mapimailbox.pm +++ b/src/apps/microsoft/exchange/local/mode/mapimailbox.pm @@ -182,12 +182,12 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--critical> Set critical threshold (Default: '%{result} !~ /Success/i'). -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--mailbox> diff --git a/src/apps/microsoft/exchange/local/mode/outlookwebservices.pm b/src/apps/microsoft/exchange/local/mode/outlookwebservices.pm index 98388549b..3431a1c44 100644 --- a/src/apps/microsoft/exchange/local/mode/outlookwebservices.pm +++ b/src/apps/microsoft/exchange/local/mode/outlookwebservices.pm @@ -184,12 +184,12 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{type}, %{id}, %{message} +You can use the following variables: %{type}, %{id}, %{message} =item B<--critical> Set critical threshold (Default: '%{type} !~ /Success|Information/i'). -Can used special variables like: %{type}, %{id}, %{message} +You can use the following variables: %{type}, %{id}, %{message} =item B<--mailbox> diff --git a/src/apps/microsoft/exchange/local/mode/owamailbox.pm b/src/apps/microsoft/exchange/local/mode/owamailbox.pm index 12a8d43b7..b30d1aeb5 100644 --- a/src/apps/microsoft/exchange/local/mode/owamailbox.pm +++ b/src/apps/microsoft/exchange/local/mode/owamailbox.pm @@ -196,12 +196,12 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--critical> Set critical threshold (Default: '%{result} !~ /Success/i'). -Can used special variables like: %{result}, %{scenario} +You can use the following variables: %{result}, %{scenario} =item B<--url> diff --git a/src/apps/microsoft/exchange/local/mode/queues.pm b/src/apps/microsoft/exchange/local/mode/queues.pm index 80bc86e90..4aa70955e 100644 --- a/src/apps/microsoft/exchange/local/mode/queues.pm +++ b/src/apps/microsoft/exchange/local/mode/queues.pm @@ -248,12 +248,12 @@ Print powershell output. =item B<--warning-status> Set warning threshold. -Can used special variables like: %{status}, %{identity}, %{is_valid}, %{delivery_type}, %{message_count} +You can use the following variables: %{status}, %{identity}, %{is_valid}, %{delivery_type}, %{message_count} =item B<--critical-status> Set critical threshold (Default: '%{status} !~ /Ready|Active/i'). -Can used special variables like: %{status}, %{identity}, %{is_valid}, %{delivery_type}, %{message_count} +You can use the following variables: %{status}, %{identity}, %{is_valid}, %{delivery_type}, %{message_count} =back diff --git a/src/apps/microsoft/exchange/local/mode/replicationhealth.pm b/src/apps/microsoft/exchange/local/mode/replicationhealth.pm index 7d068de8b..7897e7f5f 100644 --- a/src/apps/microsoft/exchange/local/mode/replicationhealth.pm +++ b/src/apps/microsoft/exchange/local/mode/replicationhealth.pm @@ -175,12 +175,12 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{result}, %{server}, %{isvalid}, %{check} +You can use the following variables: %{result}, %{server}, %{isvalid}, %{check} =item B<--critical> Set critical threshold (Default: '%{result} !~ /Passed/i'). -Can used special variables like: %{result}, %{server}, %{isvalid}, %{check} +You can use the following variables: %{result}, %{server}, %{isvalid}, %{check} =back diff --git a/src/apps/microsoft/exchange/local/mode/services.pm b/src/apps/microsoft/exchange/local/mode/services.pm index 024a696e4..25be94563 100644 --- a/src/apps/microsoft/exchange/local/mode/services.pm +++ b/src/apps/microsoft/exchange/local/mode/services.pm @@ -175,12 +175,12 @@ Print powershell output. =item B<--warning> Set warning threshold. -Can used special variables like: %{servicesrunning}, %{servicesnotrunning}, %{role}, %{requiredservicesrunning} +You can use the following variables: %{servicesrunning}, %{servicesnotrunning}, %{role}, %{requiredservicesrunning} =item B<--critical> Set critical threshold (Default: '%{requiredservicesrunning} =~ /True/i and %{servicesnotrunning} ne ""'). -Can used special variables like: %{servicesrunning}, %{servicesnotrunning}, %{role}, %{requiredservicesrunning} +You can use the following variables: %{servicesrunning}, %{servicesnotrunning}, %{role}, %{requiredservicesrunning} =back diff --git a/src/apps/microsoft/hyperv/2012/local/mode/nodeintegrationservice.pm b/src/apps/microsoft/hyperv/2012/local/mode/nodeintegrationservice.pm index c58feb95b..34f70a6ed 100644 --- a/src/apps/microsoft/hyperv/2012/local/mode/nodeintegrationservice.pm +++ b/src/apps/microsoft/hyperv/2012/local/mode/nodeintegrationservice.pm @@ -307,24 +307,24 @@ Filter virtual machine status (can be a regexp) (Default: 'running'). =item B<--warning-global-status> Set warning threshold for status (Default: '%{integration_service_state} =~ /Update required/i'). -Can used special variables like: %{vm}, %{integration_service_state}, +You can use the following variables: %{vm}, %{integration_service_state}, %{integration_service_version}, %{state} =item B<--critical-global-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{vm}, %{integration_service_state}, +You can use the following variables: %{vm}, %{integration_service_state}, %{integration_service_version}, %{state} =item B<--warning-service-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{vm}, %{service}, %{primary_status}, %{secondary_status}, %{enabled} +You can use the following variables: %{vm}, %{service}, %{primary_status}, %{secondary_status}, %{enabled} =item B<--critical-service-status> Set critical threshold for status (Default: '%{primary_status} !~ /Ok/i'). -Can used special variables like: %{vm}, %{service}, %{primary_status}, %{secondary_status}, %{enabled} +You can use the following variables: %{vm}, %{service}, %{primary_status}, %{secondary_status}, %{enabled} =back diff --git a/src/apps/microsoft/hyperv/2012/local/mode/nodereplication.pm b/src/apps/microsoft/hyperv/2012/local/mode/nodereplication.pm index ddb0f118b..7054ad854 100644 --- a/src/apps/microsoft/hyperv/2012/local/mode/nodereplication.pm +++ b/src/apps/microsoft/hyperv/2012/local/mode/nodereplication.pm @@ -213,12 +213,12 @@ Filter virtual machines (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{health} =~ /Warning/i'). -Can used special variables like: %{vm}, %{state}, %{health} +You can use the following variables: %{vm}, %{state}, %{health} =item B<--critical-status> Set critical threshold for status (Default: '%{health} =~ /Critical/i'). -Can used special variables like: %{vm}, %{state}, %{health} +You can use the following variables: %{vm}, %{state}, %{health} =back diff --git a/src/apps/microsoft/hyperv/2012/local/mode/nodevmstatus.pm b/src/apps/microsoft/hyperv/2012/local/mode/nodevmstatus.pm index 88e5c9b8e..5bdd800af 100644 --- a/src/apps/microsoft/hyperv/2012/local/mode/nodevmstatus.pm +++ b/src/apps/microsoft/hyperv/2012/local/mode/nodevmstatus.pm @@ -226,12 +226,12 @@ Filter by VM notes (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{vm}, %{state}, %{status}, %{is_clustered} +You can use the following variables: %{vm}, %{state}, %{status}, %{is_clustered} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Operating normally/i'). -Can used special variables like: %{vm}, %{state}, %{status}, %{is_clustered} +You can use the following variables: %{vm}, %{state}, %{status}, %{is_clustered} =back diff --git a/src/apps/microsoft/hyperv/2012/local/mode/scvmmintegrationservice.pm b/src/apps/microsoft/hyperv/2012/local/mode/scvmmintegrationservice.pm index 85fd4b5e4..d54b9719c 100644 --- a/src/apps/microsoft/hyperv/2012/local/mode/scvmmintegrationservice.pm +++ b/src/apps/microsoft/hyperv/2012/local/mode/scvmmintegrationservice.pm @@ -355,12 +355,12 @@ Filter hostgroup (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{vm}, %{vmaddition}, %{status} +You can use the following variables: %{vm}, %{vmaddition}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{vmaddition} =~ /not detected/i'). -Can used special variables like: %{vm}, %{vmaddition}, %{status} +You can use the following variables: %{vm}, %{vmaddition}, %{status} =back diff --git a/src/apps/microsoft/hyperv/2012/local/mode/scvmmvmstatus.pm b/src/apps/microsoft/hyperv/2012/local/mode/scvmmvmstatus.pm index 00879b90e..b9bcaf0c3 100644 --- a/src/apps/microsoft/hyperv/2012/local/mode/scvmmvmstatus.pm +++ b/src/apps/microsoft/hyperv/2012/local/mode/scvmmvmstatus.pm @@ -266,12 +266,12 @@ Filter by description (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{vm}, %{status}, %{hostgroup} +You can use the following variables: %{vm}, %{status}, %{hostgroup} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Running|Stopped/i'). -Can used special variables like: %{vm}, %{status}, %{hostgroup} +You can use the following variables: %{vm}, %{status}, %{hostgroup} =back diff --git a/src/apps/microsoft/iis/local/mode/applicationpoolstate.pm b/src/apps/microsoft/iis/local/mode/applicationpoolstate.pm index d136422c7..f15c334e8 100644 --- a/src/apps/microsoft/iis/local/mode/applicationpoolstate.pm +++ b/src/apps/microsoft/iis/local/mode/applicationpoolstate.pm @@ -143,17 +143,17 @@ Filter application pool name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{name}, %{state}, %{auto_start}. +You can use the following variables: %{name}, %{state}, %{auto_start}. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{state}, %{auto_start}. +You can use the following variables: %{name}, %{state}, %{auto_start}. =item B<--critical-status> Set critical threshold for status (Default: '%{auto_start} eq "on" and not %{state} =~ /started|starting/'). -Can used special variables like: %{name}, %{state}, %{auto_start}. +You can use the following variables: %{name}, %{state}, %{auto_start}. =back diff --git a/src/apps/microsoft/iis/restapi/mode/applicationpools.pm b/src/apps/microsoft/iis/restapi/mode/applicationpools.pm index 772edf7d1..2dafcec80 100644 --- a/src/apps/microsoft/iis/restapi/mode/applicationpools.pm +++ b/src/apps/microsoft/iis/restapi/mode/applicationpools.pm @@ -133,17 +133,17 @@ Filter application pool name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{auto_start}, %{display} +You can use the following variables: %{status}, %{auto_start}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{auto_start}, %{display} +You can use the following variables: %{status}, %{auto_start}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{auto_start} eq "true" and %{status} !~ /starting|started/'). -Can used special variables like: %{status}, %{auto_start}, %{display} +You can use the following variables: %{status}, %{auto_start}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/microsoft/iis/restapi/mode/websites.pm b/src/apps/microsoft/iis/restapi/mode/websites.pm index 5597855c3..f1fc3b756 100644 --- a/src/apps/microsoft/iis/restapi/mode/websites.pm +++ b/src/apps/microsoft/iis/restapi/mode/websites.pm @@ -169,17 +169,17 @@ Filter website name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /starting|started/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/microsoft/iis/wsman/mode/applicationpools.pm b/src/apps/microsoft/iis/wsman/mode/applicationpools.pm index 58e0e6b7d..22747f285 100644 --- a/src/apps/microsoft/iis/wsman/mode/applicationpools.pm +++ b/src/apps/microsoft/iis/wsman/mode/applicationpools.pm @@ -139,17 +139,17 @@ Filter application pool name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{name}, %{state}, %{auto_start}. +You can use the following variables: %{name}, %{state}, %{auto_start}. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{state}, %{auto_start}. +You can use the following variables: %{name}, %{state}, %{auto_start}. =item B<--critical-status> Set critical threshold for status (Default: '%{auto_start} eq "on" and not %{state} =~ /started|starting/'). -Can used special variables like: %{name}, %{state}, %{auto_start}. +You can use the following variables: %{name}, %{state}, %{auto_start}. =item B<--warning-*> B<--critical-*> diff --git a/src/apps/microsoft/mscs/local/mode/networkstatus.pm b/src/apps/microsoft/mscs/local/mode/networkstatus.pm index 4a562e497..0ee5d4ee2 100644 --- a/src/apps/microsoft/mscs/local/mode/networkstatus.pm +++ b/src/apps/microsoft/mscs/local/mode/networkstatus.pm @@ -128,17 +128,17 @@ Filter interface name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{state} =~ /unknown/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: none). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /down|partitioned|unavailable/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =back diff --git a/src/apps/microsoft/mscs/local/mode/nodestatus.pm b/src/apps/microsoft/mscs/local/mode/nodestatus.pm index 60d416f96..c2eaae7b3 100644 --- a/src/apps/microsoft/mscs/local/mode/nodestatus.pm +++ b/src/apps/microsoft/mscs/local/mode/nodestatus.pm @@ -127,17 +127,17 @@ Filter node name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{state} =~ /unknown/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{state} =~ /pause|joining/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /down/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =back diff --git a/src/apps/microsoft/mscs/local/mode/resourcegroupstatus.pm b/src/apps/microsoft/mscs/local/mode/resourcegroupstatus.pm index e3aea281e..40d64f724 100644 --- a/src/apps/microsoft/mscs/local/mode/resourcegroupstatus.pm +++ b/src/apps/microsoft/mscs/local/mode/resourcegroupstatus.pm @@ -196,17 +196,17 @@ Filter resource group name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{state} =~ /unknown/'). -Can used special variables like: %{state}, %{display}, %{owner_node} +You can use the following variables: %{state}, %{display}, %{owner_node} =item B<--warning-status> Set warning threshold for status (Default: '%{is_preferred_node} == 0'). -Can used special variables like: %{state}, %{display}, %{owner_node} +You can use the following variables: %{state}, %{display}, %{owner_node} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /failed|offline/'). -Can used special variables like: %{state}, %{display}, %{owner_node} +You can use the following variables: %{state}, %{display}, %{owner_node} =back diff --git a/src/apps/microsoft/mscs/local/mode/resourcestatus.pm b/src/apps/microsoft/mscs/local/mode/resourcestatus.pm index 8870138cd..af823040a 100644 --- a/src/apps/microsoft/mscs/local/mode/resourcestatus.pm +++ b/src/apps/microsoft/mscs/local/mode/resourcestatus.pm @@ -132,17 +132,17 @@ Filter resource name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{state} =~ /unknown/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: none). -Can used special variables like: %{state}, %{display}, %{owner_node} +You can use the following variables: %{state}, %{display}, %{owner_node} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /failed|offline/'). -Can used special variables like: %{state}, %{display}, %{owner_node} +You can use the following variables: %{state}, %{display}, %{owner_node} =back diff --git a/src/apps/microsoft/sccm/local/mode/databasereplicationstatus.pm b/src/apps/microsoft/sccm/local/mode/databasereplicationstatus.pm index b13db88d6..04b47011b 100644 --- a/src/apps/microsoft/sccm/local/mode/databasereplicationstatus.pm +++ b/src/apps/microsoft/sccm/local/mode/databasereplicationstatus.pm @@ -286,22 +286,22 @@ Print powershell output. =item B<--warning-link-status> Set warning threshold for current synchronisation status (Default: '') -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-link-status> Set critical threshold for current synchronisation status (Default: ''). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-site-status> Set warning threshold for current synchronisation status (Default: '') -Can used special variables like: %{status}, %{type}, %{site_to_site_state}, %{last_sync_time}. +You can use the following variables: %{status}, %{type}, %{site_to_site_state}, %{last_sync_time}. =item B<--critical-site-status> Set critical threshold for current synchronisation status (Default: ''). -Can used special variables like: %{status}, %{type}, %{site_to_site_state}, %{last_sync_time}. +You can use the following variables: %{status}, %{type}, %{site_to_site_state}, %{last_sync_time}. =back diff --git a/src/apps/microsoft/sccm/local/mode/sitestatus.pm b/src/apps/microsoft/sccm/local/mode/sitestatus.pm index dd8efdca0..ffd1776e1 100644 --- a/src/apps/microsoft/sccm/local/mode/sitestatus.pm +++ b/src/apps/microsoft/sccm/local/mode/sitestatus.pm @@ -244,12 +244,12 @@ Print powershell output. =item B<--warning-status> Set warning threshold for current synchronisation status (Default: ''). -Can used special variables like: %{status}, %{mode}, %{type}, %{name}. +You can use the following variables: %{status}, %{mode}, %{type}, %{name}. =item B<--critical-status> Set critical threshold for current synchronisation status (Default: ''). -Can used special variables like: %{status}, %{mode}, %{type}, %{name}. +You can use the following variables: %{status}, %{mode}, %{type}, %{name}. =back diff --git a/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm b/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm index 156b85368..0f6bab08f 100644 --- a/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm +++ b/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm @@ -374,22 +374,22 @@ Set if WSUS use ssl. =item B<--warning-synchronisation-status> Set warning threshold for current synchronisation status (Default: '') -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-synchronisation-status> Set critical threshold for current synchronisation status (Default: ''). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-last-synchronisation-status> Set warning threshold for current synchronisation status (Default: '') -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-last-synchronisation-status> Set critical threshold for current synchronisation status (Default: '%{status} !~ /Succeeded/'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-*> B<--critical-*> diff --git a/src/apps/monitoring/iplabel/datametrie/restapi/mode/kpi.pm b/src/apps/monitoring/iplabel/datametrie/restapi/mode/kpi.pm index 7150c4fe4..e8b4e0005 100644 --- a/src/apps/monitoring/iplabel/datametrie/restapi/mode/kpi.pm +++ b/src/apps/monitoring/iplabel/datametrie/restapi/mode/kpi.pm @@ -179,17 +179,17 @@ Filter by monitor name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/monitoring/iplabel/newtest/restapi/mode/scenarios.pm b/src/apps/monitoring/iplabel/newtest/restapi/mode/scenarios.pm index 02ef7c036..e47e76b7f 100644 --- a/src/apps/monitoring/iplabel/newtest/restapi/mode/scenarios.pm +++ b/src/apps/monitoring/iplabel/newtest/restapi/mode/scenarios.pm @@ -291,14 +291,18 @@ Check scenarios. =over 8 -=item B<--filter-node-id> +=item B<--filter-robot-name> -Filter nodes (can be a regexp). +Filter robots (can be a regexp). + +=item B<--filter-scenario-name> + +Filter scenarios (can be a regexp). =item B<--warning-*> B<--critical-*> Thresholds. -Can be: 'ping-received-lasttime' (s). +Can be: 'status-green', 'status-red', 'status-orange', 'status-grey', 'execution-time'. =back diff --git a/src/apps/monitoring/mip/restapi/mode/scenarios.pm b/src/apps/monitoring/mip/restapi/mode/scenarios.pm index 8c4daf5ed..2a765bfed 100644 --- a/src/apps/monitoring/mip/restapi/mode/scenarios.pm +++ b/src/apps/monitoring/mip/restapi/mode/scenarios.pm @@ -322,7 +322,7 @@ Filter scenarios by applicationn name (can be a regexp). =item B<--display-instance> Set the scenario display value (Default: '%{name}'). -Can used special variables like: %{name}, %{app_name}, %{display_name}, %{id} +You can use the following variables: %{name}, %{app_name}, %{display_name}, %{id} =item B<--memory> @@ -331,17 +331,17 @@ Only check new result entries for scenarios. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /critical/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/apps/monitoring/nodeexporter/windows/mode/services.pm b/src/apps/monitoring/nodeexporter/windows/mode/services.pm index ec5c60b8e..1e18deeba 100644 --- a/src/apps/monitoring/nodeexporter/windows/mode/services.pm +++ b/src/apps/monitoring/nodeexporter/windows/mode/services.pm @@ -119,12 +119,12 @@ Default: all services are monitored. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{start_mode} +You can use the following variables: %{status}, %{start_mode} =item B<--critical-status> Set critical threshold for status (Default: '%{start_mode} =~ /auto/ && %{status} !~ /^running$/'). -Can used special variables like: %{status}, %{start_mode} +You can use the following variables: %{status}, %{start_mode} =back diff --git a/src/apps/monitoring/ntopng/restapi/mode/alerts.pm b/src/apps/monitoring/ntopng/restapi/mode/alerts.pm index 44053cb69..9b78f3cc1 100644 --- a/src/apps/monitoring/ntopng/restapi/mode/alerts.pm +++ b/src/apps/monitoring/ntopng/restapi/mode/alerts.pm @@ -215,12 +215,12 @@ Can be: 'last-5mns' (default), 'last-hour' =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor/i') -Can used special variables like: %{severity}, %{type}, %{timeraised} +You can use the following variables: %{severity}, %{type}, %{timeraised} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /major|critical/i'). -Can used special variables like: %{severity}, %{type}, %{timeraised} +You can use the following variables: %{severity}, %{type}, %{timeraised} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/monitoring/scom/restapi/mode/alerts.pm b/src/apps/monitoring/scom/restapi/mode/alerts.pm index 20ed9f801..a2220dbe0 100644 --- a/src/apps/monitoring/scom/restapi/mode/alerts.pm +++ b/src/apps/monitoring/scom/restapi/mode/alerts.pm @@ -169,12 +169,12 @@ Filter by host name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /warning/i') -Can used special variables like: %{severity}, %{host}, %{name}, %{timeraised} +You can use the following variables: %{severity}, %{host}, %{name}, %{timeraised} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical/i'). -Can used special variables like: %{severity}, %{host}, %{name}, %{timeraised} +You can use the following variables: %{severity}, %{host}, %{name}, %{timeraised} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/monitoring/splunk/custom/api.pm b/src/apps/monitoring/splunk/custom/api.pm index eee5369be..4badfc23a 100644 --- a/src/apps/monitoring/splunk/custom/api.pm +++ b/src/apps/monitoring/splunk/custom/api.pm @@ -54,7 +54,9 @@ sub new { 'timeout:s' => { name => 'timeout' }, 'unknown-http-status:s' => { name => 'unknown_http_status' }, 'warning-http-status:s' => { name => 'warning_http_status' }, - 'critical-http-status:s' => { name => 'critical_http_status' } + 'critical-http-status:s' => { name => 'critical_http_status' }, + 'splunk-retries:s' => { name => 'splunk_retries' }, + 'splunk-wait:s' => { name => 'splunk_wait' } }); } $options{options}->add_help(package => __PACKAGE__, sections => 'XMLAPI OPTIONS', once => 1); @@ -86,6 +88,8 @@ sub check_options { $self->{unknown_http_status} = (defined($self->{option_results}->{unknown_http_status})) ? $self->{option_results}->{unknown_http_status} : '%{http_code} < 200 or %{http_code} >= 300'; $self->{warning_http_status} = (defined($self->{option_results}->{warning_http_status})) ? $self->{option_results}->{warning_http_status} : ''; $self->{critical_http_status} = (defined($self->{option_results}->{critical_http_status})) ? $self->{option_results}->{critical_http_status} : ''; + $self->{splunk_retries} = (defined($self->{option_results}->{splunk_retries})) ? $self->{option_results}->{splunk_retries} : 5; + $self->{splunk_wait} = (defined($self->{option_results}->{splunk_wait})) ? $self->{option_results}->{splunk_wait} : 2; if ($self->{hostname} eq '') { $self->{output}->add_option_msg(short_msg => 'Need to specify hostname option.'); @@ -200,7 +204,7 @@ sub get_access_token { $self->{output}->add_option_msg(short_msg => 'error retrieving session_token'); $self->{output}->option_exit(); } - + $session_token = $xml_result->{sessionKey}; my $datas = { session_token => $session_token }; @@ -251,7 +255,6 @@ sub get_splunkd_health { } return \@splunkd_features_health; - } sub query_count { @@ -270,27 +273,44 @@ sub query_count { $self->{output}->option_exit(); } - sleep(1.5); + my $retries = 0; + my $is_done = 0; - my $query_status = $self->request_api( - method => 'GET', - endpoint => '/services/search/jobs/' . $query_sid->{sid}, - ); + while ($retries < $self->{http}->{options}->{splunk_retries}) { + my $query_status = $self->request_api( + method => 'GET', + endpoint => '/services/search/jobs/' . $query_sid->{sid} + ); - foreach (@{$query_status->{content}->{'s:dict'}->{'s:key'}}) { - if ($_->{name} eq 'isDone' && $_->{content} == 0){ - $self->{output}->add_option_msg(short_msg => "Search command wasn't completed."); - $self->{output}->option_exit(); - } elsif ($_->{name} eq 'isFailed' && $_->{content} == 1) { - $self->{output}->add_option_msg(short_msg => "Search command failed."); - $self->{output}->option_exit(); + foreach (@{$query_status->{content}->{'s:dict'}->{'s:key'}}) { + if ($_->{name} eq 'isDone' && $_->{content} == 1){ + $is_done = 1; + last; + } elsif ($_->{name} eq 'isFailed' && $_->{content} == 1) { + $self->{output}->add_option_msg(short_msg => "Search command failed."); + $self->{output}->option_exit(); + } } + + if ($is_done) { + last; + } + + $retries++; + sleep($self->{http}->{options}->{splunk_wait}); + } + + # it took too long to run query + if (!$is_done) { + $self->{output}->add_option_msg(short_msg => "Search command didn't finish in time. Considere tweaking --splunk-wait and --splunk-retries if the search is just slow"); + $self->{output}->option_exit(); } my $query_res = $self->request_api( method => 'GET', - endpoint => '/services/search/jobs/' . $query_sid->{sid} . '/results', + endpoint => '/services/search/jobs/' . $query_sid->{sid} . '/results' ); + my $query_count = $query_res->{result}->{field}->{value}->{text}; return $query_count; @@ -387,6 +407,14 @@ Specify api password. Set HTTP timeout. +=item B<--splunk-retries> + +How many times we should retry queries to splunk. To use in par with the --splunk-wait paramater (Default: 5) + +=item B<--splunk-wait> + +How long (in seconds) should we wait between each retry. To use in par with the --splunk-retries paramater (Default: 2) + =back =head1 DESCRIPTION diff --git a/src/apps/mq/activemq/jmx/mode/brokers.pm b/src/apps/mq/activemq/jmx/mode/brokers.pm index e1ba743e5..463db4b03 100644 --- a/src/apps/mq/activemq/jmx/mode/brokers.pm +++ b/src/apps/mq/activemq/jmx/mode/brokers.pm @@ -321,12 +321,12 @@ Filter destination type (Can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Good/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/ibmmq/mqi/mode/channels.pm b/src/apps/mq/ibmmq/mqi/mode/channels.pm index 213dc4132..4f23da6d7 100644 --- a/src/apps/mq/ibmmq/mqi/mode/channels.pm +++ b/src/apps/mq/ibmmq/mqi/mode/channels.pm @@ -212,17 +212,17 @@ MQTT - Telemetry =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{channel_status}, %{mca_status} +You can use the following variables: %{channel_status}, %{mca_status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{channel_status}, %{mca_status} +You can use the following variables: %{channel_status}, %{mca_status} =item B<--critical-status> Set critical threshold for status (Default: '%{channel_status} !~ /running|idle/i'). -Can used special variables like: %{channel_status}, %{mca_status} +You can use the following variables: %{channel_status}, %{mca_status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/ibmmq/mqi/mode/queuemanager.pm b/src/apps/mq/ibmmq/mqi/mode/queuemanager.pm index 5e2680095..de1c4f3f6 100644 --- a/src/apps/mq/ibmmq/mqi/mode/queuemanager.pm +++ b/src/apps/mq/ibmmq/mqi/mode/queuemanager.pm @@ -135,17 +135,17 @@ Check queue manager. =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{mgr_status}, %{channel_initiator_status}, %{command_server_status} +You can use the following variables: %{mgr_status}, %{channel_initiator_status}, %{command_server_status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{mgr_status}, %{channel_initiator_status}, %{command_server_status} +You can use the following variables: %{mgr_status}, %{channel_initiator_status}, %{command_server_status} =item B<--critical-status> Set critical threshold for status (Default: '%{mgr_status} !~ /running/i'). -Can used special variables like: %{mgr_status}, %{channel_initiator_status}, %{command_server_status} +You can use the following variables: %{mgr_status}, %{channel_initiator_status}, %{command_server_status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/ibmmq/restapi/mode/queuemanagers.pm b/src/apps/mq/ibmmq/restapi/mode/queuemanagers.pm index c3a60de4e..4c41bd1fd 100644 --- a/src/apps/mq/ibmmq/restapi/mode/queuemanagers.pm +++ b/src/apps/mq/ibmmq/restapi/mode/queuemanagers.pm @@ -147,17 +147,17 @@ Filter queue managers by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{mgr_status}, %{channel_initiator_status} +You can use the following variables: %{mgr_status}, %{channel_initiator_status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{mgr_status}, %{channel_initiator_status} +You can use the following variables: %{mgr_status}, %{channel_initiator_status} =item B<--critical-status> Set critical threshold for status (Default: '%{mgr_status} !~ /running/i'). -Can used special variables like: %{mgr_status}, %{channel_initiator_status} +You can use the following variables: %{mgr_status}, %{channel_initiator_status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/rabbitmq/restapi/mode/nodeusage.pm b/src/apps/mq/rabbitmq/restapi/mode/nodeusage.pm index 8376956e6..2b34328d3 100644 --- a/src/apps/mq/rabbitmq/restapi/mode/nodeusage.pm +++ b/src/apps/mq/rabbitmq/restapi/mode/nodeusage.pm @@ -142,12 +142,12 @@ Filter node name (Can use regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "running"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/rabbitmq/restapi/mode/queueusage.pm b/src/apps/mq/rabbitmq/restapi/mode/queueusage.pm index 574023446..1d65c7da9 100644 --- a/src/apps/mq/rabbitmq/restapi/mode/queueusage.pm +++ b/src/apps/mq/rabbitmq/restapi/mode/queueusage.pm @@ -143,12 +143,12 @@ Filter queue name (Can use regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} ne "running"'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/rabbitmq/restapi/mode/vhostusage.pm b/src/apps/mq/rabbitmq/restapi/mode/vhostusage.pm index 761b22866..cba8eec37 100644 --- a/src/apps/mq/rabbitmq/restapi/mode/vhostusage.pm +++ b/src/apps/mq/rabbitmq/restapi/mode/vhostusage.pm @@ -142,12 +142,12 @@ Filter vhost name (Can use regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "ok"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/vernemq/restapi/mode/clusters.pm b/src/apps/mq/vernemq/restapi/mode/clusters.pm index 7102dda55..848e8b5e5 100644 --- a/src/apps/mq/vernemq/restapi/mode/clusters.pm +++ b/src/apps/mq/vernemq/restapi/mode/clusters.pm @@ -143,17 +143,17 @@ Filter cluster name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "notRunning"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/mq/vernemq/restapi/mode/listeners.pm b/src/apps/mq/vernemq/restapi/mode/listeners.pm index 47813bffe..6db20a18d 100644 --- a/src/apps/mq/vernemq/restapi/mode/listeners.pm +++ b/src/apps/mq/vernemq/restapi/mode/listeners.pm @@ -143,17 +143,17 @@ Filter listener type (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "running"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/openweathermap/restapi/mode/cityweather.pm b/src/apps/openweathermap/restapi/mode/cityweather.pm index 2e493e19b..3227f457e 100644 --- a/src/apps/openweathermap/restapi/mode/cityweather.pm +++ b/src/apps/openweathermap/restapi/mode/cityweather.pm @@ -156,12 +156,12 @@ City name (e.g London or ISO 3166 code like London,uk) =item B<--warning-weather> Set warning threshold for weather string desc (Default: ''). -Can used special variables like: %{weather} +You can use the following variables: %{weather} =item B<--critical-weather> Set critical threshold for weather string desc (Default: ''). -Can used special variables like: %{weather} +You can use the following variables: %{weather} Example : --critical-weather='%{weather} eq "Clouds' diff --git a/src/apps/oracle/gg/local/mode/processes.pm b/src/apps/oracle/gg/local/mode/processes.pm index 6ef54a9c3..459527a2e 100644 --- a/src/apps/oracle/gg/local/mode/processes.pm +++ b/src/apps/oracle/gg/local/mode/processes.pm @@ -187,17 +187,17 @@ Filter processes by type (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name}, %{group}, %{type} +You can use the following variables: %{status}, %{name}, %{group}, %{type} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name}, %{group}, %{type} +You can use the following variables: %{status}, %{name}, %{group}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /ABENDED/i'). -Can used special variables like: %{status}, %{name}, %{group}, %{type} +You can use the following variables: %{status}, %{name}, %{group}, %{type} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/oracle/ovm/api/mode/manager.pm b/src/apps/oracle/ovm/api/mode/manager.pm index cc001ed4a..582c1ba22 100644 --- a/src/apps/oracle/ovm/api/mode/manager.pm +++ b/src/apps/oracle/ovm/api/mode/manager.pm @@ -137,17 +137,17 @@ Example: --filter-counters='status' =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /running/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/oracle/ovm/api/mode/servers.pm b/src/apps/oracle/ovm/api/mode/servers.pm index d28d30d9e..2444ac2ff 100644 --- a/src/apps/oracle/ovm/api/mode/servers.pm +++ b/src/apps/oracle/ovm/api/mode/servers.pm @@ -206,17 +206,17 @@ Filter servers by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{running_status}, %{is_maintenance}, %{up2date}, %{name} +You can use the following variables: %{running_status}, %{is_maintenance}, %{up2date}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{running_status}, %{is_maintenance}, %{up2date}, %{name} +You can use the following variables: %{running_status}, %{is_maintenance}, %{up2date}, %{name} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{running_status}, %{is_maintenance}, %{up2date}, %{name} +You can use the following variables: %{running_status}, %{is_maintenance}, %{up2date}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/oracle/ovm/api/mode/vm.pm b/src/apps/oracle/ovm/api/mode/vm.pm index d4847ebaf..53d113c44 100644 --- a/src/apps/oracle/ovm/api/mode/vm.pm +++ b/src/apps/oracle/ovm/api/mode/vm.pm @@ -155,17 +155,17 @@ Filter virtual machines by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{running_status}, %{name} +You can use the following variables: %{running_status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{running_status}, %{name} +You can use the following variables: %{running_status}, %{name} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{running_status}, %{name} +You can use the following variables: %{running_status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/pacemaker/local/mode/crm.pm b/src/apps/pacemaker/local/mode/crm.pm index f7af49afa..d322d9f95 100644 --- a/src/apps/pacemaker/local/mode/crm.pm +++ b/src/apps/pacemaker/local/mode/crm.pm @@ -470,42 +470,42 @@ Filter resource (also clone resource) by name (can be a regexp). =item B<--warning-connection-status> Set warning threshold for status. -Can used special variables like: %{connection_status}, %{connection_error} +You can use the following variables: %{connection_status}, %{connection_error} =item B<--critical-connection-status> Set critical threshold for status (Default: '%{connection_status} =~ /failed/i'). -Can used special variables like: %{connection_status}, %{connection_error} +You can use the following variables: %{connection_status}, %{connection_error} =item B<--warning-quorum-status> Set warning threshold for status. -Can used special variables like: %{quorum_status} +You can use the following variables: %{quorum_status} =item B<--critical-quorum-status> Set critical threshold for status (Default: '%{quorum_status} =~ /noQuorum/i'). -Can used special variables like: %{quorum_status} +You can use the following variables: %{quorum_status} =item B<--warning-resource-status> Set warning threshold for status. -Can used special variables like: %{name}, %{status}, %{node}, %{is_unmanaged} +You can use the following variables: %{name}, %{status}, %{node}, %{is_unmanaged} =item B<--critical-resource-status> Set critical threshold for status (Default: '%{status} =~ /stopped|failed/i'). -Can used special variables like: %{name}, %{status}, %{node}, %{is_unmanaged} +You can use the following variables: %{name}, %{status}, %{node}, %{is_unmanaged} =item B<--warning-clone-resource-status> Set warning threshold for status. -Can used special variables like: %{name}, %{status}, %{masters_nodes_name}, %{slaves_nodes_name}, %{is_unmanaged} +You can use the following variables: %{name}, %{status}, %{masters_nodes_name}, %{slaves_nodes_name}, %{is_unmanaged} =item B<--critical-clone-resource-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{name}, %{status}, %{masters_nodes_name}, %{slaves_nodes_name}, %{is_unmanaged} +You can use the following variables: %{name}, %{status}, %{masters_nodes_name}, %{slaves_nodes_name}, %{is_unmanaged} =item B<--ignore-failed-actions> diff --git a/src/apps/pfsense/fauxapi/mode/gateways.pm b/src/apps/pfsense/fauxapi/mode/gateways.pm index 1076de57e..e2fa8bffd 100644 --- a/src/apps/pfsense/fauxapi/mode/gateways.pm +++ b/src/apps/pfsense/fauxapi/mode/gateways.pm @@ -147,17 +147,17 @@ Filter gateway name (can be a regexp). =item B<--unknown-status> Set unknon threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /none/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/pineapp/securemail/snmp/mode/system.pm b/src/apps/pineapp/securemail/snmp/mode/system.pm index 0f5043b2a..53ddd7001 100644 --- a/src/apps/pineapp/securemail/snmp/mode/system.pm +++ b/src/apps/pineapp/securemail/snmp/mode/system.pm @@ -234,32 +234,32 @@ Check system usage. =item B<--unknown-service-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-service-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-service-status> Set critical threshold for status (Default: '%{status} !~ /running/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--unknown-storage-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-storage-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-storage-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/protocols/cifs/mode/connection.pm b/src/apps/protocols/cifs/mode/connection.pm index e11a46f41..07eb70022 100644 --- a/src/apps/protocols/cifs/mode/connection.pm +++ b/src/apps/protocols/cifs/mode/connection.pm @@ -109,12 +109,12 @@ Set the share directory. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--critical-status> Set critical threshold for status (Default: '%{message} !~ /authentication succeeded/i' -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--warning-time> diff --git a/src/apps/protocols/cifs/mode/scenario.pm b/src/apps/protocols/cifs/mode/scenario.pm index 8b6368eff..95aa74224 100644 --- a/src/apps/protocols/cifs/mode/scenario.pm +++ b/src/apps/protocols/cifs/mode/scenario.pm @@ -303,22 +303,22 @@ Can be a file or json content. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "success"') -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-step-status> Set warning threshold for status. -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--critical-step-status> Set critical threshold for status. -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/protocols/http/mode/expectedcontent.pm b/src/apps/protocols/http/mode/expectedcontent.pm index dfe631ece..6601f6e0b 100644 --- a/src/apps/protocols/http/mode/expectedcontent.pm +++ b/src/apps/protocols/http/mode/expectedcontent.pm @@ -357,17 +357,17 @@ Threshold critical for extracted value =item B<--unknown-content> Set warning threshold for content page (Default: ''). -Can used special variables like: %{content}, %{header}, %{first_header}, %{code} +You can use the following variables: %{content}, %{header}, %{first_header}, %{code} =item B<--warning-content> Set warning threshold for status (Default: ''). -Can used special variables like: %{content}, %{header}, %{first_header}, %{code} +You can use the following variables: %{content}, %{header}, %{first_header}, %{code} =item B<--critical-content> Set critical threshold for content page (Default: ''). -Can used special variables like: %{content}, %{header}, %{first_header}, %{code} +You can use the following variables: %{content}, %{header}, %{first_header}, %{code} =back diff --git a/src/apps/protocols/http/mode/jsoncontent.pm b/src/apps/protocols/http/mode/jsoncontent.pm index bb8170fd0..5c9c82032 100644 --- a/src/apps/protocols/http/mode/jsoncontent.pm +++ b/src/apps/protocols/http/mode/jsoncontent.pm @@ -415,23 +415,26 @@ Override all the format options but substitute are still applied. =item B<--format-ok> -Output format (Default: '%{count} element(s) found') -Can used: +Customize the format of the output when the status is OK (Default: '%{count} element(s) found') +You can use the following variables: '%{values}' = display all values (also text string) '%{values_ok}' = values from attributes and text node only (seperated by option values-separator) '%{values_warning}' and '%{values_critical}' =item B<--format-warning> -Output warning format (Default: %{count} element(s) found') +Customize the format of the output when the status is WARNING (Default: '%{count} element(s) found') +You can use the variables described in --format-ok =item B<--format-critical> -Output critical format (Default: %{count} element(s) found') +Customize the format of the output when the status is CRITICAL (Default: '%{count} element(s) found') +You can use the variables described in --format-ok =item B<--format-unknown> -Output unknown format (Default: %{count} element(s) found') +Customize the format of the output when the status is UNKNOWN (Default: '%{count} element(s) found') +You can use the variables described in --format-ok =item B<--values-separator> diff --git a/src/apps/protocols/http/mode/soapcontent.pm b/src/apps/protocols/http/mode/soapcontent.pm index a2ca8e11a..334fed7da 100644 --- a/src/apps/protocols/http/mode/soapcontent.pm +++ b/src/apps/protocols/http/mode/soapcontent.pm @@ -347,19 +347,21 @@ FORMAT OPTIONS: =item B<--format-ok> -Output format (Default: '%{count} element(s) found') -Can used: +Customize the format of the output when the status is OK (Default: '%{count} element(s) found') +You can use the following variables: '%{values}' = display all values (also text string) '%{values_ok}' = values from attributes and text node only (seperated by option values-separator) '%{values_warning}' and '%{values_critical}' =item B<--format-warning> -Output warning format (Default: %{count} element(s) found') +Customize the format of the output when the status is WARNING (Default: '%{count} element(s) found') +You can use the variables described in --format-ok =item B<--format-critical> -Output critical format (Default: %{count} element(s) found') +Customize the format of the output when the status is CRITICAL (Default: '%{count} element(s) found') +You can use the variables described in --format-ok =item B<--values-separator> diff --git a/src/apps/protocols/ospf/snmp/mode/neighbor.pm b/src/apps/protocols/ospf/snmp/mode/neighbor.pm index 56eea2c0a..7d5cb9d45 100644 --- a/src/apps/protocols/ospf/snmp/mode/neighbor.pm +++ b/src/apps/protocols/ospf/snmp/mode/neighbor.pm @@ -169,12 +169,12 @@ Example: --filter-counters='^status$' =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} +You can use the following variables: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} =item B<--critical-status> Set critical threshold for status (Default: '%{NbrState} =~ /down/i'). -Can used special variables like: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} +You can use the following variables: %{NbrState}, %{NbrRtrId}, %{NbrIpAddr} =item B<--warning-total-change> diff --git a/src/apps/protocols/radius/mode/login.pm b/src/apps/protocols/radius/mode/login.pm index 82cafdd9c..99eb24d75 100644 --- a/src/apps/protocols/radius/mode/login.pm +++ b/src/apps/protocols/radius/mode/login.pm @@ -268,12 +268,12 @@ Set radius-dictionary file (mandatory with --radius-attribute) (multiple option) =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{error_msg}, %{attributes}. +You can use the following variables: %{status}, %{error_msg}, %{attributes}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "accepted"'). -Can used special variables like: %{status}, %{error_msg}, %{attributes}. +You can use the following variables: %{status}, %{error_msg}, %{attributes}. =item B<--warning-time> diff --git a/src/apps/protocols/sftp/mode/connection.pm b/src/apps/protocols/sftp/mode/connection.pm index fae71a539..f17dde925 100644 --- a/src/apps/protocols/sftp/mode/connection.pm +++ b/src/apps/protocols/sftp/mode/connection.pm @@ -99,12 +99,12 @@ Check sftp connection. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--critical-status> Set critical threshold for status (Default: '%{message} !~ /authentication succeeded/i' -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--warning-time> diff --git a/src/apps/protocols/sftp/mode/scenario.pm b/src/apps/protocols/sftp/mode/scenario.pm index d634cc6b5..47edf2c3d 100644 --- a/src/apps/protocols/sftp/mode/scenario.pm +++ b/src/apps/protocols/sftp/mode/scenario.pm @@ -310,22 +310,22 @@ Can be a file or json content. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "success"') -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-step-status> Set warning threshold for status. -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--critical-step-status> Set critical threshold for status. -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/protocols/snmp/mode/cache.pm b/src/apps/protocols/snmp/mode/cache.pm new file mode 100644 index 000000000..73ea1578b --- /dev/null +++ b/src/apps/protocols/snmp/mode/cache.pm @@ -0,0 +1,115 @@ +# +# Copyright 2023 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 apps::protocols::snmp::mode::cache; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; +use JSON::XS; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'file:s' => { name => 'file' }, + 'snmpwalk:s@' => { name => 'snmpwalk' }, + 'snmpget:s@' => { name => 'snmpget' } + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (!defined($self->{option_results}->{file}) || $self->{option_results}->{file} eq '') { + $self->{output}->add_option_msg(short_msg => "Missing parameter --file"); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + + my $snmp_datas = {}; + if (defined($self->{option_results}->{snmpwalk})) { + foreach my $oid (@{$self->{option_results}->{snmpwalk}}) { + my $result = $options{snmp}->get_table(oid => $oid); + $snmp_datas = { %$snmp_datas, %$result }; + } + } + + if (defined($self->{option_results}->{snmpget})) { + my $result = $options{snmp}->get_leef(oids => $self->{option_results}->{snmpget}); + $snmp_datas = { %$snmp_datas, %$result }; + } + + my $json; + eval { + $json = JSON::XS->new->encode($snmp_datas); + }; + + my $fh; + if (!open($fh, '>', $self->{option_results}->{file})) { + $self->{output}->add_option_msg(short_msg => "Can't open file '$self->{option_results}->{file}': $!"); + $self->{output}->option_exit(); + } + print $fh $json; + close($fh); + + $self->{output}->output_add( + severity => 'OK', + short_msg => 'SNMP cache file created' + ); + + $self->{output}->display(force_ignore_perfdata => 1); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Cache SNMP datas in a JSON cache file. + +=over 8 + +=item B<--file> + +JSON cache file path. + +=item B<--snmpget> + +Retrieve a management value. + +=item B<--snmpwalk> + +Retrieve a subtree of management values. + +=back + +=cut diff --git a/src/apps/protocols/snmp/plugin.pm b/src/apps/protocols/snmp/plugin.pm index 3357c091d..9198225de 100644 --- a/src/apps/protocols/snmp/plugin.pm +++ b/src/apps/protocols/snmp/plugin.pm @@ -30,6 +30,7 @@ sub new { bless $self, $class; $self->{modes} = { + 'cache' => 'apps::protocols::snmp::mode::cache', 'collection' => 'apps::protocols::snmp::mode::collection', 'discovery' => 'snmp_standard::mode::discovery', 'dynamic-command' => 'snmp_standard::mode::dynamiccommand', diff --git a/src/apps/protocols/ssh/mode/login.pm b/src/apps/protocols/ssh/mode/login.pm index 2068bc488..e6fc1a9d8 100644 --- a/src/apps/protocols/ssh/mode/login.pm +++ b/src/apps/protocols/ssh/mode/login.pm @@ -95,12 +95,12 @@ Check SSH connection. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--critical-status> Set critical threshold for status (Default: '%{message} !~ /authentication succeeded/i' -Can used special variables like: %{status}, %{message} +You can use the following variables: %{status}, %{message} =item B<--warning-time> diff --git a/src/apps/protocols/tcp/mode/connectionstatus.pm b/src/apps/protocols/tcp/mode/connectionstatus.pm index fd497f024..3e72de159 100644 --- a/src/apps/protocols/tcp/mode/connectionstatus.pm +++ b/src/apps/protocols/tcp/mode/connectionstatus.pm @@ -182,17 +182,17 @@ Connection timeout in seconds (Default: 3) =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{port}, %{error_message} +You can use the following variables: %{status}, %{port}, %{error_message} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{port}, %{error_message} +You can use the following variables: %{status}, %{port}, %{error_message} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "failed"'). -Can used special variables like: %{status}, %{port}, %{error_message} +You can use the following variables: %{status}, %{port}, %{error_message} =item B<--warning-time> diff --git a/src/apps/protocols/tftp/mode/commands.pm b/src/apps/protocols/tftp/mode/commands.pm index 87d35063c..0d2c412c7 100644 --- a/src/apps/protocols/tftp/mode/commands.pm +++ b/src/apps/protocols/tftp/mode/commands.pm @@ -236,12 +236,12 @@ Example: --filter-counters='^status$' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "ok"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-time> diff --git a/src/apps/protocols/whois/mode/domain.pm b/src/apps/protocols/whois/mode/domain.pm index a8ab7a103..81f9b0e06 100644 --- a/src/apps/protocols/whois/mode/domain.pm +++ b/src/apps/protocols/whois/mode/domain.pm @@ -430,17 +430,17 @@ Set your domain expiration date timezone (default: 'UTC'). =item B<--unknown-status> Set critical threshold for status (Default: '%{status} =~ /checkError/i'). -Can used special variables like: %{status}, %{domain} +You can use the following variables: %{status}, %{domain} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{domain} +You can use the following variables: %{status}, %{domain} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{domain} +You can use the following variables: %{status}, %{domain} =item B<--unit> diff --git a/src/apps/proxmox/mg/restapi/mode/version.pm b/src/apps/proxmox/mg/restapi/mode/version.pm index 6f76e98fe..51db5c930 100644 --- a/src/apps/proxmox/mg/restapi/mode/version.pm +++ b/src/apps/proxmox/mg/restapi/mode/version.pm @@ -96,12 +96,12 @@ Check version. =item B<--warning-version> Set warning threshold for version. -Can used special variables like: %{version}, %{repoid}, %{release} +You can use the following variables: %{version}, %{repoid}, %{release} =item B<--critical-version> Set critical threshold for version. -Can used special variables like: %{version}, %{repoid}, %{release} +You can use the following variables: %{version}, %{repoid}, %{release} =back diff --git a/src/apps/proxmox/ve/restapi/mode/nodeusage.pm b/src/apps/proxmox/ve/restapi/mode/nodeusage.pm index 88f338631..aa402c88a 100644 --- a/src/apps/proxmox/ve/restapi/mode/nodeusage.pm +++ b/src/apps/proxmox/ve/restapi/mode/nodeusage.pm @@ -369,12 +369,12 @@ Can be: 'cpu' (%), 'memory' (%), 'swap' (%), 'fs' (%). =item B<--warning-node-status> Set warning threshold for status. -Can used special variables like: %{name}, %{state}. +You can use the following variables: %{name}, %{state}. =item B<--critical-node-status> Set critical threshold for status. -Can used special variables like: %{name}, %{state}. +You can use the following variables: %{name}, %{state}. =back diff --git a/src/apps/proxmox/ve/restapi/mode/storageusage.pm b/src/apps/proxmox/ve/restapi/mode/storageusage.pm index d23d3e9b2..f7dfccfad 100644 --- a/src/apps/proxmox/ve/restapi/mode/storageusage.pm +++ b/src/apps/proxmox/ve/restapi/mode/storageusage.pm @@ -237,12 +237,12 @@ Exact node name. =item B<--warning-storage-status> Set warning threshold for status. -Can used special variables like: %{name}, %{state}. +You can use the following variables: %{name}, %{state}. =item B<--critical-storage-status> Set critical threshold for status. -Can used special variables like: %{name}, %{state}. +You can use the following variables: %{name}, %{state}. =item B<--warning-*> B<--critical-*> diff --git a/src/apps/proxmox/ve/restapi/mode/vmusage.pm b/src/apps/proxmox/ve/restapi/mode/vmusage.pm index 0cf38970a..29f134231 100644 --- a/src/apps/proxmox/ve/restapi/mode/vmusage.pm +++ b/src/apps/proxmox/ve/restapi/mode/vmusage.pm @@ -350,12 +350,12 @@ Can be: 'read-iops', 'write-iops', 'traffic-in', 'traffic-out', =item B<--warning-vm-status> Set warning threshold for status (Default: -) -Can used special variables like: %{name}, %{state}. +You can use the following variables: %{name}, %{state}. =item B<--critical-vm-status> Set critical threshold for status (Default: -). -Can used special variables like: %{name}, %{state}. +You can use the following variables: %{name}, %{state}. =back diff --git a/src/apps/redis/rlec/restapi/mode/databasesstats.pm b/src/apps/redis/rlec/restapi/mode/databasesstats.pm index ad9de77bb..437ce0ef8 100644 --- a/src/apps/redis/rlec/restapi/mode/databasesstats.pm +++ b/src/apps/redis/rlec/restapi/mode/databasesstats.pm @@ -529,7 +529,7 @@ Example: --filter-counters='rate|latency' =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{type}, +You can use the following variables: %{status}, %{type}, %{backup_status}, %{export_status}, %{shard_list}. 'status' can be: 'pending', 'active', 'active-change-pending', 'delete-pending', 'import-pending', 'creation-failed', 'recovery'. @@ -544,7 +544,7 @@ Can used special variables like: %{status}, %{type}, Set critical threshold for status (Default: '%{status} =~ /creation-failed/i | %{backup_status} =~ /failed/i | %{export_status} =~ /failed/i | %{import_status} =~ /failed/i'). -Can used special variables like: %{status}, %{type}, +You can use the following variables: %{status}, %{type}, %{backup_status}, %{export_status}, %{shard_list}. 'status' can be: 'pending', 'active', 'active-change-pending', 'delete-pending', 'import-pending', 'creation-failed', 'recovery'. diff --git a/src/apps/redis/rlec/restapi/mode/nodesstats.pm b/src/apps/redis/rlec/restapi/mode/nodesstats.pm index 029c922a8..26d602395 100644 --- a/src/apps/redis/rlec/restapi/mode/nodesstats.pm +++ b/src/apps/redis/rlec/restapi/mode/nodesstats.pm @@ -361,7 +361,7 @@ Thresholds are on free space left. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{shard_list}, +You can use the following variables: %{status}, %{shard_list}, %{int_addr}, %{ext_addr}. 'status' can be: 'active', 'going_offline', 'offline', 'provisioning', 'decommissioning', 'down'. @@ -369,7 +369,7 @@ Can used special variables like: %{status}, %{shard_list}, =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{shard_list}, +You can use the following variables: %{status}, %{shard_list}, %{int_addr}, %{ext_addr}. 'status' can be: 'active', 'going_offline', 'offline', 'provisioning', 'decommissioning', 'down'. diff --git a/src/apps/redis/rlec/restapi/mode/shardsstats.pm b/src/apps/redis/rlec/restapi/mode/shardsstats.pm index 3fffdc12c..2322cc6f4 100644 --- a/src/apps/redis/rlec/restapi/mode/shardsstats.pm +++ b/src/apps/redis/rlec/restapi/mode/shardsstats.pm @@ -374,7 +374,7 @@ Example: --filter-counters='clients' =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{detailed_status}, +You can use the following variables: %{status}, %{detailed_status}, %{role}, %{loading}, %{sync}, %{backup}. 'status' can be: 'active', 'inactive', 'trimming'. 'detailed_status' can be: 'ok', 'importing', 'timeout', @@ -388,7 +388,7 @@ Can used special variables like: %{status}, %{detailed_status}, Set critical threshold for status (Default: '%{status} =~ /inactive/i || %{backup} =~ /failed/i || %{sync} =~ /link_down/i'). -Can used special variables like: %{status}, %{detailed_status}, +You can use the following variables: %{status}, %{detailed_status}, %{role}, %{loading}, %{sync}, %{backup}. 'status' can be: 'active', 'inactive', 'trimming'. 'detailed_status' can be: 'ok', 'importing', 'timeout', diff --git a/src/apps/redis/sentinel/mode/redisclusters.pm b/src/apps/redis/sentinel/mode/redisclusters.pm index 4ef28a932..4fe01198b 100644 --- a/src/apps/redis/sentinel/mode/redisclusters.pm +++ b/src/apps/redis/sentinel/mode/redisclusters.pm @@ -240,17 +240,17 @@ Filter clusters by name (Can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{role}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{role}, %{address}, %{port}, %{cluster_name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{role}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{role}, %{address}, %{port}, %{cluster_name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /o_down|s_down|master_down|disconnected/i'). -Can used special variables like: %{status}, %{role}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{role}, %{address}, %{port}, %{cluster_name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/redis/sentinel/mode/sentinelclusters.pm b/src/apps/redis/sentinel/mode/sentinelclusters.pm index 7b1c831ed..d00b47ad3 100644 --- a/src/apps/redis/sentinel/mode/sentinelclusters.pm +++ b/src/apps/redis/sentinel/mode/sentinelclusters.pm @@ -219,32 +219,32 @@ Filter clusters by name (Can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{address}, %{port}, %{cluster_name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{address}, %{port}, %{cluster_name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /o_down|s_down|master_down|disconnected/i'). -Can used special variables like: %{status}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{address}, %{port}, %{cluster_name} =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{address}, %{port}, %{cluster_name} =item B<--warning-quorum-status> Set warning threshold for quorum status. -Can used special variables like: %{status}, %{address}, %{port}, %{cluster_name} +You can use the following variables: %{status}, %{address}, %{port}, %{cluster_name} =item B<--critical-quorum-status> Set critical threshold for quorum status (Default: '%{status} =~ /noQuorum/'). -Can used special variables like: %{status}, %{cluster_name} +You can use the following variables: %{status}, %{cluster_name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/rudder/restapi/mode/globalcompliance.pm b/src/apps/rudder/restapi/mode/globalcompliance.pm index 296f1fcef..769d30b50 100644 --- a/src/apps/rudder/restapi/mode/globalcompliance.pm +++ b/src/apps/rudder/restapi/mode/globalcompliance.pm @@ -148,12 +148,12 @@ Set critical threshold on global compliance. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{detail}, %{value} +You can use the following variables: %{detail}, %{value} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{detail}, %{value} +You can use the following variables: %{detail}, %{value} Example : --critical-status='%{detail} eq "error" && %{value} > 5' diff --git a/src/apps/rudder/restapi/mode/nodecompliance.pm b/src/apps/rudder/restapi/mode/nodecompliance.pm index 9a84ead67..8402c7965 100644 --- a/src/apps/rudder/restapi/mode/nodecompliance.pm +++ b/src/apps/rudder/restapi/mode/nodecompliance.pm @@ -176,12 +176,12 @@ Set critical threshold on node compliance. =item B<--warning-status> Set warning threshold for status of rule compliance (Default: ''). -Can used special variables like: %{rule}, %{compliance} +You can use the following variables: %{rule}, %{compliance} =item B<--critical-status> Set critical threshold for status of rule compliance (Default: ''). -Can used special variables like: %{rule}, %{compliance} +You can use the following variables: %{rule}, %{compliance} Example : --critical-status='%{rule} eq "Global configuration for all nodes" && %{compliance} < 95' diff --git a/src/apps/rudder/restapi/mode/rulecompliance.pm b/src/apps/rudder/restapi/mode/rulecompliance.pm index 0dc24de4d..aee7dba4f 100644 --- a/src/apps/rudder/restapi/mode/rulecompliance.pm +++ b/src/apps/rudder/restapi/mode/rulecompliance.pm @@ -182,12 +182,12 @@ Set critical threshold on rule compliance. =item B<--warning-status> Set warning threshold for status of directive compliance (Default: ''). -Can used special variables like: %{directive}, %{compliance} +You can use the following variables: %{directive}, %{compliance} =item B<--critical-status> Set critical threshold for status of directive compliance (Default: ''). -Can used special variables like: %{directive}, %{compliance} +You can use the following variables: %{directive}, %{compliance} Example : --critical-status='%{directive} eq "Users" && %{compliance} < 85' diff --git a/src/apps/sahipro/restapi/mode/scenario.pm b/src/apps/sahipro/restapi/mode/scenario.pm index acdf70801..238354f08 100644 --- a/src/apps/sahipro/restapi/mode/scenario.pm +++ b/src/apps/sahipro/restapi/mode/scenario.pm @@ -525,12 +525,12 @@ Threshold critical for running scenario rest api response. =item B<--warning-status> Set warning threshold for scenario status. -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-status> Set critical threshold for scenario status (Default: '%{status} ne "SUCCESS"'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-*> B<--critical-*> diff --git a/src/apps/smartermail/restapi/mode/licenses.pm b/src/apps/smartermail/restapi/mode/licenses.pm index a1b71e4db..c113bc51a 100644 --- a/src/apps/smartermail/restapi/mode/licenses.pm +++ b/src/apps/smartermail/restapi/mode/licenses.pm @@ -92,17 +92,17 @@ Check licenses. =item B<--unknown-upgrade-protection-status> Set unknown threshold for status. -Can used special variables like: %{upgrade_protection_status} +You can use the following variables: %{upgrade_protection_status} =item B<--warning-upgrade-protection-status> Set warning threshold for status. -Can used special variables like: %{upgrade_protection_status} +You can use the following variables: %{upgrade_protection_status} =item B<--critical-upgrade-protection-status> Set critical threshold for status (Default: '%{upgrade_protection_status} =~ /expired/'). -Can used special variables like: %{upgrade_protection_status} +You can use the following variables: %{upgrade_protection_status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/smartermail/restapi/mode/services.pm b/src/apps/smartermail/restapi/mode/services.pm index 1d001d505..82e836edd 100644 --- a/src/apps/smartermail/restapi/mode/services.pm +++ b/src/apps/smartermail/restapi/mode/services.pm @@ -108,17 +108,17 @@ Only display some counters (regexp can be used). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /running/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =back diff --git a/src/apps/thales/mistral/vs9/restapi/mode/clusters.pm b/src/apps/thales/mistral/vs9/restapi/mode/clusters.pm index 75fb123dd..5d63ea28f 100644 --- a/src/apps/thales/mistral/vs9/restapi/mode/clusters.pm +++ b/src/apps/thales/mistral/vs9/restapi/mode/clusters.pm @@ -291,32 +291,32 @@ Filter clusters by name. =item B<--unknown-cluster-status> Set unknown threshold for status. -Can used special variables like: %{gatewaysClusterStatus}, %{availableForSwitching}, %{clusterName} +You can use the following variables: %{gatewaysClusterStatus}, %{availableForSwitching}, %{clusterName} =item B<--warning-cluster-status> Set warning threshold for status (Default: '%{gatewaysClusterStatus} =~ /HAC_FAILOVER/i'). -Can used special variables like: %{gatewaysClusterStatus}, %{availableForSwitching}, %{clusterName} +You can use the following variables: %{gatewaysClusterStatus}, %{availableForSwitching}, %{clusterName} =item B<--critical-cluster-status> Set critical threshold for status (Default: '%{gatewaysClusterStatus} =~ /HAC_FAILURE|HAC_DOWN|HAC_BACKUP_FAILURE/i'). -Can used special variables like: %{gatewaysClusterStatus}, %{availableForSwitching}, %{clusterName} +You can use the following variables: %{gatewaysClusterStatus}, %{availableForSwitching}, %{clusterName} =item B<--unknown-member-status> Set unknown threshold for status. -Can used special variables like: %{connectedStatus}, %{role}, %{memberName} +You can use the following variables: %{connectedStatus}, %{role}, %{memberName} =item B<--warning-member-status> Set warning threshold for status. -Can used special variables like: %{connectedStatus}, %{role}, %{memberName} +You can use the following variables: %{connectedStatus}, %{role}, %{memberName} =item B<--critical-member-status> Set critical threshold for status. -Can used special variables like: %{connectedStatus}, %{role}, %{memberName} +You can use the following variables: %{connectedStatus}, %{role}, %{memberName} =item B<--time-contact-unit> diff --git a/src/apps/thales/mistral/vs9/restapi/mode/devices.pm b/src/apps/thales/mistral/vs9/restapi/mode/devices.pm index b966b521a..ac69c7712 100644 --- a/src/apps/thales/mistral/vs9/restapi/mode/devices.pm +++ b/src/apps/thales/mistral/vs9/restapi/mode/devices.pm @@ -957,122 +957,122 @@ Check tunnels. =item B<--unknown-certificate-status> Set unknown threshold for status. -Can used special variables like: %{revoked}, %{sn}, %{certSn}, %{subjectCommonName}, %{issuerCommonName} +You can use the following variables: %{revoked}, %{sn}, %{certSn}, %{subjectCommonName}, %{issuerCommonName} =item B<--warning-certificate-status> Set warning threshold for status. -Can used special variables like: %{revoked}, %{sn}, %{certSn}, %{subjectCommonName}, %{issuerCommonName} +You can use the following variables: %{revoked}, %{sn}, %{certSn}, %{subjectCommonName}, %{issuerCommonName} =item B<--critical-certificate-status> Set critical threshold for status. -Can used special variables like: %{revoked}, %{sn}, %{certSn}, %{subjectCommonName}, %{issuerCommonName} +You can use the following variables: %{revoked}, %{sn}, %{certSn}, %{subjectCommonName}, %{issuerCommonName} =item B<--unknown-connection-status> Set unknown threshold for status (Default: '%{connectionStatus} =~ /unknown/i'). -Can used special variables like: %{sn}, %{connectionStatus} +You can use the following variables: %{sn}, %{connectionStatus} =item B<--warning-connection-status> Set warning threshold for status (Default: '%{connectionStatus} =~ /disconnected|unpaired/i'). -Can used special variables like: %{sn}, %{connectionStatus} +You can use the following variables: %{sn}, %{connectionStatus} =item B<--critical-connection-status> Set critical threshold for status. -Can used special variables like: %{sn}, %{connectionStatus} +You can use the following variables: %{sn}, %{connectionStatus} =item B<--unknown-operating-state> Set unknown threshold for status. -Can used special variables like: %{sn}, %{operatingState} +You can use the following variables: %{sn}, %{operatingState} =item B<--warning-operating-state> Set warning threshold for status. -Can used special variables like: %{sn}, %{operatingState} +You can use the following variables: %{sn}, %{operatingState} =item B<--critical-operating-state> Set critical threshold for status (Default: '%{operatingState} !~ /operating/i'). -Can used special variables like: %{sn}, %{operatingState} +You can use the following variables: %{sn}, %{operatingState} =item B<--unknown-autotest-state> Set unknown threshold for status. -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--warning-autotest-state> Set warning threshold for status. -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--critical-autotest-state> Set critical threshold for status (Default: '%{state} !~ /success/i'). -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--unknown-interface-status> Set unknown threshold for status. -Can used special variables like: %{sn}, %{name}, %{operatingStatus} +You can use the following variables: %{sn}, %{name}, %{operatingStatus} =item B<--warning-interface-status> Set warning threshold for status. -Can used special variables like: %{sn}, %{name}, %{operatingStatus} +You can use the following variables: %{sn}, %{name}, %{operatingStatus} =item B<--critical-interface-status> Set critical threshold for status (Default: '%{operatingStatus} !~ /up/i'). -Can used special variables like: %{sn}, %{name}, %{operatingStatus} +You can use the following variables: %{sn}, %{name}, %{operatingStatus} =item B<--unknown-vpn-ike-service-state> Set unknown threshold for status. -Can used special variables like: %{sn}, %{state} +You can use the following variables: %{sn}, %{state} =item B<--warning-vpn-ike-service-state> Set warning threshold for status. -Can used special variables like: %{sn}, %{state} +You can use the following variables: %{sn}, %{state} =item B<--critical-vpn-ike-service-state> Set critical threshold for status (Default: '%{state} =~ /stopped/i'). -Can used special variables like: %{sn}, %{state} +You can use the following variables: %{sn}, %{state} =item B<--unknown-vpn-ike-sa-state> Set unknown threshold for status. -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--warning-vpn-ike-sa-state> Set warning threshold for status. -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--critical-vpn-ike-sa-state> Set critical threshold for status (Default: '%{state} =~ /down/i'). -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--unknown-vpn-sa-state> Set unknown threshold for status. -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--warning-vpn-sa-state> Set warning threshold for status. -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--critical-vpn-sa-state> Set critical threshold for status (Default: '%{state} =~ /down/i'). -Can used special variables like: %{sn}, %{name}, %{state} +You can use the following variables: %{sn}, %{name}, %{state} =item B<--ntp-hostname> diff --git a/src/apps/thales/mistral/vs9/restapi/mode/mmccertificates.pm b/src/apps/thales/mistral/vs9/restapi/mode/mmccertificates.pm index c74a1d16e..ae1b25a58 100644 --- a/src/apps/thales/mistral/vs9/restapi/mode/mmccertificates.pm +++ b/src/apps/thales/mistral/vs9/restapi/mode/mmccertificates.pm @@ -229,17 +229,17 @@ Skip revoked certificates. =item B<--unknown-certificate-status> Set unknown threshold for status. -Can used special variables like: %{active}, %{revoked}, %{sn}, %{subjectCommonName}, %{issuerCommonName} +You can use the following variables: %{active}, %{revoked}, %{sn}, %{subjectCommonName}, %{issuerCommonName} =item B<--warning-certificate-status> Set warning threshold for status. -Can used special variables like: %{active}, %{revoked}, %{sn}, %{subjectCommonName}, %{issuerCommonName} +You can use the following variables: %{active}, %{revoked}, %{sn}, %{subjectCommonName}, %{issuerCommonName} =item B<--critical-certificate-status> Set critical threshold for status. -Can used special variables like: %{active}, %{revoked}, %{sn}, %{subjectCommonName}, %{issuerCommonName} +You can use the following variables: %{active}, %{revoked}, %{sn}, %{subjectCommonName}, %{issuerCommonName} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/thales/mistral/vs9/restapi/mode/mmccluster.pm b/src/apps/thales/mistral/vs9/restapi/mode/mmccluster.pm index 928031960..ba58e35db 100644 --- a/src/apps/thales/mistral/vs9/restapi/mode/mmccluster.pm +++ b/src/apps/thales/mistral/vs9/restapi/mode/mmccluster.pm @@ -141,32 +141,32 @@ Check MMC cluster status. =item B<--unknown-cluster-status> Set unknown threshold for status (Default: '%{replicationStatus} =~ /unknown/i'). -Can used special variables like: %{enabled}, %{replicationStatus} +You can use the following variables: %{enabled}, %{replicationStatus} =item B<--warning-cluster-status> Set warning threshold for status (Default: '%{replicationStatus} =~ /not_synchronized/i'). -Can used special variables like: %{enabled}, %{replicationStatus} +You can use the following variables: %{enabled}, %{replicationStatus} =item B<--critical-cluster-status> Set critical threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-node-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-node-status> Set warning threshold for status (Default: '%{status} =~ /disconnected/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-node-status> Set critical threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/tomcat/web/mode/applications.pm b/src/apps/tomcat/web/mode/applications.pm index b55953d97..c73930244 100644 --- a/src/apps/tomcat/web/mode/applications.pm +++ b/src/apps/tomcat/web/mode/applications.pm @@ -206,17 +206,17 @@ Threshold critical for http response code =item B<--unknown-status> Set unknown threshold for status (Default: '%{state} ne "running"'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} eq "stopped"'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/toshiba/storemate/sql/mode/maintenanceplan.pm b/src/apps/toshiba/storemate/sql/mode/maintenanceplan.pm index b1e7f0b3a..5d1d3dcd0 100644 --- a/src/apps/toshiba/storemate/sql/mode/maintenanceplan.pm +++ b/src/apps/toshiba/storemate/sql/mode/maintenanceplan.pm @@ -158,12 +158,12 @@ Database name (default: 'Framework'). =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{description}, %{workstation_id}, %{since} +You can use the following variables: %{description}, %{workstation_id}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '1 == 1'. We match all errors). -Can used special variables like: %{description}, %{workstation_id}, %{since} +You can use the following variables: %{description}, %{workstation_id}, %{since} =item B<--timezone> diff --git a/src/apps/video/openheadend/snmp/mode/nodeusage.pm b/src/apps/video/openheadend/snmp/mode/nodeusage.pm index 3cdd527ff..74396fad9 100644 --- a/src/apps/video/openheadend/snmp/mode/nodeusage.pm +++ b/src/apps/video/openheadend/snmp/mode/nodeusage.pm @@ -169,12 +169,12 @@ Filter node name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{dep_status}, %{display} +You can use the following variables: %{dep_status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{dep_status} =~ /false/i'). -Can used special variables like: %{dep_status}, %{display} +You can use the following variables: %{dep_status}, %{display} =item B<--warning-*> diff --git a/src/apps/video/openheadend/snmp/mode/operationstatus.pm b/src/apps/video/openheadend/snmp/mode/operationstatus.pm index 3c948a3be..3b8490a86 100644 --- a/src/apps/video/openheadend/snmp/mode/operationstatus.pm +++ b/src/apps/video/openheadend/snmp/mode/operationstatus.pm @@ -166,12 +166,12 @@ Filter by operation type (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{dep_status}, %{display} +You can use the following variables: %{status}, %{dep_status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{dep_status} =~ /false/i'). -Can used special variables like: %{status}, %{dep_status}, %{display} +You can use the following variables: %{status}, %{dep_status}, %{display} =back diff --git a/src/apps/video/zixi/restapi/mode/broadcasterinputusage.pm b/src/apps/video/zixi/restapi/mode/broadcasterinputusage.pm index 4df2e9f01..74d2f75a2 100644 --- a/src/apps/video/zixi/restapi/mode/broadcasterinputusage.pm +++ b/src/apps/video/zixi/restapi/mode/broadcasterinputusage.pm @@ -191,12 +191,12 @@ Can be: 'traffic-in', 'traffic-out'. =item B<--warning-status> Set warning threshold for status (Default: -) -Can used special variables like: %{source}, %{status}, %{error}. +You can use the following variables: %{source}, %{status}, %{error}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Connecting|Connected/i || %{error} !~ /none/i'). -Can used special variables like: %{source}, %{status}, %{error}. +You can use the following variables: %{source}, %{status}, %{error}. =back diff --git a/src/apps/video/zixi/restapi/mode/broadcasterlicenseusage.pm b/src/apps/video/zixi/restapi/mode/broadcasterlicenseusage.pm index 8d5ce37dc..7ff845ef0 100644 --- a/src/apps/video/zixi/restapi/mode/broadcasterlicenseusage.pm +++ b/src/apps/video/zixi/restapi/mode/broadcasterlicenseusage.pm @@ -256,12 +256,12 @@ Thresholds are on free license left. =item B<--warning-status> Set warning threshold for status (Default: -) -Can used special variables like: %{name}, %{error}, %{info}. +You can use the following variables: %{name}, %{error}, %{info}. =item B<--critical-status> Set critical threshold for status (Default: -). -Can used special variables like: %{name}, %{error}, %{info}. +You can use the following variables: %{name}, %{error}, %{info}. =back diff --git a/src/apps/video/zixi/restapi/mode/broadcasteroutputusage.pm b/src/apps/video/zixi/restapi/mode/broadcasteroutputusage.pm index ff997b8e2..420fae687 100644 --- a/src/apps/video/zixi/restapi/mode/broadcasteroutputusage.pm +++ b/src/apps/video/zixi/restapi/mode/broadcasteroutputusage.pm @@ -202,12 +202,12 @@ Can be: 'traffic-in', 'traffic-out', 'dropped-in'. =item B<--warning-status> Set warning threshold for status (Default: -) -Can used special variables like: %{name}, %{status}, %{error}. +You can use the following variables: %{name}, %{status}, %{error}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Connecting|Connected/i || %{error} !~ /none/i'). -Can used special variables like: %{name}, %{status}, %{error}. +You can use the following variables: %{name}, %{status}, %{error}. =back diff --git a/src/apps/video/zixi/restapi/mode/feederinputusage.pm b/src/apps/video/zixi/restapi/mode/feederinputusage.pm index 6271340f1..6142ee311 100644 --- a/src/apps/video/zixi/restapi/mode/feederinputusage.pm +++ b/src/apps/video/zixi/restapi/mode/feederinputusage.pm @@ -162,12 +162,12 @@ Can be: 'traffic-in'. =item B<--warning-status> Set warning threshold for status (Default: -) -Can used special variables like: %{name}, %{active}, %{error}. +You can use the following variables: %{name}, %{active}, %{error}. =item B<--critical-status> Set critical threshold for status (Default: -). -Can used special variables like: %{name}, %{active}, %{error}. +You can use the following variables: %{name}, %{active}, %{error}. =back diff --git a/src/apps/video/zixi/restapi/mode/feederoutputusage.pm b/src/apps/video/zixi/restapi/mode/feederoutputusage.pm index 7d307dcf8..11be3515a 100644 --- a/src/apps/video/zixi/restapi/mode/feederoutputusage.pm +++ b/src/apps/video/zixi/restapi/mode/feederoutputusage.pm @@ -162,12 +162,12 @@ Can be: 'current-birate'. =item B<--warning-status> Set warning threshold for status (Default: -) -Can used special variables like: %{name}, %{active}, %{error}, %{con_stat}. +You can use the following variables: %{name}, %{active}, %{error}, %{con_stat}. =item B<--critical-status> Set critical threshold for status (Default: -). -Can used special variables like: %{name}, %{active}, %{error}, %{con_stat}. +You can use the following variables: %{name}, %{active}, %{error}, %{con_stat}. =back diff --git a/src/apps/virtualization/hpe/simplivity/restapi/mode/hosts.pm b/src/apps/virtualization/hpe/simplivity/restapi/mode/hosts.pm index 3da013d5e..68f9a94af 100644 --- a/src/apps/virtualization/hpe/simplivity/restapi/mode/hosts.pm +++ b/src/apps/virtualization/hpe/simplivity/restapi/mode/hosts.pm @@ -257,62 +257,62 @@ Filter hosts by name. =item B<--unknown-host-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-host-status> Set warning threshold for status (Default: '%{status} =~ /suspected/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-host-status> Set critical threshold for status (Default: '%{status} =~ /faulty/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-raid-status> Set unknown threshold for component status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-raid-status> Set warning threshold for component status (Default: '%{status} =~ /yellow/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-raid-status> Set critical threshold for component status (Default: '%{status} =~ /red/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-logical-drive-status> Set unknown threshold for component status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-logical-drive-status> Set warning threshold for component status (Default: '%{status} =~ /yellow/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-logical-drive-status> Set critical threshold for component status (Default: '%{status} =~ /red/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-physical-drive-status> Set unknown threshold for component status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-physical-drive-status> Set warning threshold for component status (Default: '%{status} =~ /yellow/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-physical-drive-status> Set critical threshold for component status (Default: '%{status} =~ /red/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/virtualization/hpe/simplivity/restapi/mode/virtualmachines.pm b/src/apps/virtualization/hpe/simplivity/restapi/mode/virtualmachines.pm index 122aed1cf..82a2c7402 100644 --- a/src/apps/virtualization/hpe/simplivity/restapi/mode/virtualmachines.pm +++ b/src/apps/virtualization/hpe/simplivity/restapi/mode/virtualmachines.pm @@ -173,17 +173,17 @@ Filter virtual machines by virtual machine name. =item B<--unknown-ha-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{ha_status}, %{vm_name} +You can use the following variables: %{ha_status}, %{vm_name} =item B<--warning-ha-status> Set warning threshold for status (Default: '%{status} =~ /degraded/'). -Can used special variables like: %{ha_status}, %{vm_name} +You can use the following variables: %{ha_status}, %{vm_name} =item B<--critical-ha-status> Set critical threshold for status. -Can used special variables like: %{ha_status}, %{vm_name} +You can use the following variables: %{ha_status}, %{vm_name} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/vmware/connector/custom/connector.pm b/src/apps/vmware/connector/custom/connector.pm index 0767509a7..47ed76e69 100644 --- a/src/apps/vmware/connector/custom/connector.pm +++ b/src/apps/vmware/connector/custom/connector.pm @@ -333,17 +333,17 @@ Searchs are case insensitive. =item B<--unknown-connector-status> Set unknown threshold for connector status (Default: '%{code} < 0 || (%{code} > 0 && %{code} < 200)'). -Can used special variables like: %{code}, %{short_message}, %{extra_message}. +You can use the following variables: %{code}, %{short_message}, %{extra_message}. =item B<--warning-connector-status> Set warning threshold for connector status (Default: ''). -Can used special variables like: %{code}, %{short_message}, %{extra_message}. +You can use the following variables: %{code}, %{short_message}, %{extra_message}. =item B<--critical-connector-status> Set critical threshold for connector status (Default: ''). -Can used special variables like: %{code}, %{short_message}, %{extra_message}. +You can use the following variables: %{code}, %{short_message}, %{extra_message}. =back diff --git a/src/apps/vmware/connector/mode/alarmdatacenter.pm b/src/apps/vmware/connector/mode/alarmdatacenter.pm index 0548f406a..ab677e6e3 100644 --- a/src/apps/vmware/connector/mode/alarmdatacenter.pm +++ b/src/apps/vmware/connector/mode/alarmdatacenter.pm @@ -297,12 +297,12 @@ Check new alarms only. =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /yellow/i). -Can used special variables like: %{status}, %{name}, %{entity}, %{type}. +You can use the following variables: %{status}, %{name}, %{entity}, %{type}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /red/i'). -Can used special variables like: %{status}, %{name}, %{entity}, %{type}. +You can use the following variables: %{status}, %{name}, %{entity}, %{type}. =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/alarmhost.pm b/src/apps/vmware/connector/mode/alarmhost.pm index 80da1dbe8..e7fe5c547 100644 --- a/src/apps/vmware/connector/mode/alarmhost.pm +++ b/src/apps/vmware/connector/mode/alarmhost.pm @@ -288,12 +288,12 @@ Check new alarms only. =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /yellow/i). -Can used special variables like: %{status}, %{name}, %{entity}, %{type}. +You can use the following variables: %{status}, %{name}, %{entity}, %{type}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /red/i'). -Can used special variables like: %{status}, %{name}, %{entity}, %{type}. +You can use the following variables: %{status}, %{name}, %{entity}, %{type}. =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/countvmhost.pm b/src/apps/vmware/connector/mode/countvmhost.pm index f3ab006e8..4a9af9833 100644 --- a/src/apps/vmware/connector/mode/countvmhost.pm +++ b/src/apps/vmware/connector/mode/countvmhost.pm @@ -191,17 +191,17 @@ Search in following cluster(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/cpuhost.pm b/src/apps/vmware/connector/mode/cpuhost.pm index 685160e1c..337c11699 100644 --- a/src/apps/vmware/connector/mode/cpuhost.pm +++ b/src/apps/vmware/connector/mode/cpuhost.pm @@ -197,17 +197,17 @@ Search in following cluster(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/cpuvm.pm b/src/apps/vmware/connector/mode/cpuvm.pm index f3d9a9b5a..cc2009549 100644 --- a/src/apps/vmware/connector/mode/cpuvm.pm +++ b/src/apps/vmware/connector/mode/cpuvm.pm @@ -233,17 +233,17 @@ Search in following host(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{connection_state} !~ /^connected$/i or %{power_state} !~ /^poweredOn$/i'). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/datastorecountvm.pm b/src/apps/vmware/connector/mode/datastorecountvm.pm index ee08ef0e2..89b81baf8 100644 --- a/src/apps/vmware/connector/mode/datastorecountvm.pm +++ b/src/apps/vmware/connector/mode/datastorecountvm.pm @@ -184,17 +184,17 @@ Search in following datacenter(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{accessible} !~ /^true|1$/i'). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/datastorehost.pm b/src/apps/vmware/connector/mode/datastorehost.pm index 4c3802a46..7da8da310 100644 --- a/src/apps/vmware/connector/mode/datastorehost.pm +++ b/src/apps/vmware/connector/mode/datastorehost.pm @@ -189,17 +189,17 @@ Datastore name is a regexp. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/datastoreio.pm b/src/apps/vmware/connector/mode/datastoreio.pm index 2225cfb55..47ec07e1b 100644 --- a/src/apps/vmware/connector/mode/datastoreio.pm +++ b/src/apps/vmware/connector/mode/datastoreio.pm @@ -164,17 +164,17 @@ Search in following datacenter(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{accessible} !~ /^true|1$/i'). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/datastoreiops.pm b/src/apps/vmware/connector/mode/datastoreiops.pm index 8634a9400..501e74bc9 100644 --- a/src/apps/vmware/connector/mode/datastoreiops.pm +++ b/src/apps/vmware/connector/mode/datastoreiops.pm @@ -242,17 +242,17 @@ Only display VMs with iops higher value (default: 50). =item B<--unknown-status> Set unknown threshold for status (Default: '%{accessible} !~ /^true|1$/i'). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/vmware/connector/mode/datastoresnapshot.pm b/src/apps/vmware/connector/mode/datastoresnapshot.pm index 0a61bc4b4..1e3d14e06 100644 --- a/src/apps/vmware/connector/mode/datastoresnapshot.pm +++ b/src/apps/vmware/connector/mode/datastoresnapshot.pm @@ -173,17 +173,17 @@ Search in following datacenter(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{accessible} !~ /^true|1$/i'). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/datastoreusage.pm b/src/apps/vmware/connector/mode/datastoreusage.pm index e87e3da76..8bb9f857a 100644 --- a/src/apps/vmware/connector/mode/datastoreusage.pm +++ b/src/apps/vmware/connector/mode/datastoreusage.pm @@ -267,17 +267,17 @@ Explicitly ask vmware to refreshes free-space and capacity values (slower). =item B<--unknown-status> Set unknown threshold for status (Default: '%{accessible} !~ /^true|1$/i'). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{accessible} +You can use the following variables: %{accessible} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/vmware/connector/mode/datastorevm.pm b/src/apps/vmware/connector/mode/datastorevm.pm index a817cda3b..224584297 100644 --- a/src/apps/vmware/connector/mode/datastorevm.pm +++ b/src/apps/vmware/connector/mode/datastorevm.pm @@ -243,17 +243,17 @@ Display virtual machine description. =item B<--unknown-status> Set unknown threshold for status (Default: '%{connection_state} !~ /^connected$/i or %{power_state} !~ /^poweredOn$/i'). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/vmware/connector/mode/devicevm.pm b/src/apps/vmware/connector/mode/devicevm.pm index 49bae3e45..088c7816e 100644 --- a/src/apps/vmware/connector/mode/devicevm.pm +++ b/src/apps/vmware/connector/mode/devicevm.pm @@ -200,17 +200,17 @@ Device to check (Required) (Example: --device='VirtualCdrom'). =item B<--unknown-status> Set unknown threshold for status (Default: '%{connection_state} !~ /^connected$/i'). -Can used special variables like: %{connection_state} +You can use the following variables: %{connection_state} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state} +You can use the following variables: %{connection_state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{connection_state} +You can use the following variables: %{connection_state} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/healthhost.pm b/src/apps/vmware/connector/mode/healthhost.pm index 48b50164f..f0831bc58 100644 --- a/src/apps/vmware/connector/mode/healthhost.pm +++ b/src/apps/vmware/connector/mode/healthhost.pm @@ -329,17 +329,17 @@ Check storage(s) status. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/vmware/connector/mode/limitvm.pm b/src/apps/vmware/connector/mode/limitvm.pm index fbd50d3c3..48c49c335 100644 --- a/src/apps/vmware/connector/mode/limitvm.pm +++ b/src/apps/vmware/connector/mode/limitvm.pm @@ -242,32 +242,32 @@ Check disk limits (since vsphere 5.0). =item B<--warning-disk-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state}, %{limit} +You can use the following variables: %{connection_state}, %{power_state}, %{limit} =item B<--critical-disk-status> Set critical threshold for status (Default: '%{connection_state} !~ /^connected$/i || %{limit} != -1'). -Can used special variables like: %{connection_state}, %{power_state}, %{limit} +You can use the following variables: %{connection_state}, %{power_state}, %{limit} =item B<--warning-cpu-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state}, %{limit} +You can use the following variables: %{connection_state}, %{power_state}, %{limit} =item B<--critical-cpu-status> Set critical threshold for status (Default: '%{connection_state} !~ /^connected$/i || %{limit} != -1'). -Can used special variables like: %{connection_state}, %{power_state}, %{limit} +You can use the following variables: %{connection_state}, %{power_state}, %{limit} =item B<--warning-memory-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state}, %{limit} +You can use the following variables: %{connection_state}, %{power_state}, %{limit} =item B<--critical-memory-status> Set critical threshold for status (Default: '%{connection_state} !~ /^connected$/i || %{limit} != -1'). -Can used special variables like: %{connection_state}, %{power_state}, %{limit} +You can use the following variables: %{connection_state}, %{power_state}, %{limit} =back diff --git a/src/apps/vmware/connector/mode/maintenancehost.pm b/src/apps/vmware/connector/mode/maintenancehost.pm index 7c8dd4a53..4fd992339 100644 --- a/src/apps/vmware/connector/mode/maintenancehost.pm +++ b/src/apps/vmware/connector/mode/maintenancehost.pm @@ -145,27 +145,27 @@ Search in following cluster(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-maintenance-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{maintenance} +You can use the following variables: %{maintenance} =item B<--critical-maintenance-status> Set critical threshold for status (Default: '%{maintenance} !~ /false/'). -Can used special variables like: %{maintenance} +You can use the following variables: %{maintenance} =back diff --git a/src/apps/vmware/connector/mode/memoryhost.pm b/src/apps/vmware/connector/mode/memoryhost.pm index 549379a22..58ed61bca 100644 --- a/src/apps/vmware/connector/mode/memoryhost.pm +++ b/src/apps/vmware/connector/mode/memoryhost.pm @@ -262,17 +262,17 @@ Thresholds are on free space left. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-consumed-memory> diff --git a/src/apps/vmware/connector/mode/memoryvm.pm b/src/apps/vmware/connector/mode/memoryvm.pm index cf9eef31b..8ebffb00c 100644 --- a/src/apps/vmware/connector/mode/memoryvm.pm +++ b/src/apps/vmware/connector/mode/memoryvm.pm @@ -340,17 +340,17 @@ Display virtual machine description. =item B<--unknown-status> Set unknown threshold for status (Default: '%{connection_state} !~ /^connected$/i or %{power_state} !~ /^poweredOn$/i'). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--units> diff --git a/src/apps/vmware/connector/mode/nethost.pm b/src/apps/vmware/connector/mode/nethost.pm index 3068f8711..09bb7a3dc 100644 --- a/src/apps/vmware/connector/mode/nethost.pm +++ b/src/apps/vmware/connector/mode/nethost.pm @@ -391,32 +391,32 @@ It monitors only ESX nic that belongs to the filtered vswitches. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-link-status> Set warning threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-link-status> Set warning threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--critical-link-status> Set critical threshold for status (Default: '%{link_status} !~ /up/'). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/vmware/connector/mode/netvm.pm b/src/apps/vmware/connector/mode/netvm.pm index ec13c9d7a..e8e6b171b 100644 --- a/src/apps/vmware/connector/mode/netvm.pm +++ b/src/apps/vmware/connector/mode/netvm.pm @@ -323,17 +323,17 @@ Display virtual machine description. =item B<--unknown-status> Set unknown threshold for status (Default: '%{connection_state} !~ /^connected$/i or %{power_state} !~ /^poweredOn$/i'). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--speed-in> diff --git a/src/apps/vmware/connector/mode/servicehost.pm b/src/apps/vmware/connector/mode/servicehost.pm index 5da125bee..ed0c0db52 100644 --- a/src/apps/vmware/connector/mode/servicehost.pm +++ b/src/apps/vmware/connector/mode/servicehost.pm @@ -180,27 +180,27 @@ Filter services you want to check (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i && %{maintenance} =~ /false/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-service-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{running}, %{label}, %{policy} +You can use the following variables: %{running}, %{label}, %{policy} =item B<--critical-service-status> Set critical threshold for status (Default: '%{policy} =~ /^on|automatic/i && !%{running}'). -Can used special variables like: %{running}, %{label}, %{policy} +You can use the following variables: %{running}, %{label}, %{policy} =back diff --git a/src/apps/vmware/connector/mode/statuscluster.pm b/src/apps/vmware/connector/mode/statuscluster.pm index 4963760b3..c774f5ab3 100644 --- a/src/apps/vmware/connector/mode/statuscluster.pm +++ b/src/apps/vmware/connector/mode/statuscluster.pm @@ -132,17 +132,17 @@ Search in following datacenter(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{overall_status} =~ /gray/i || %{vsan_status} =~ /gray/i'). -Can used special variables like: %{overall_status}, %{vsan_status}, %{drs_enabled}, %{ha_enabled} +You can use the following variables: %{overall_status}, %{vsan_status}, %{drs_enabled}, %{ha_enabled} =item B<--warning-status> Set warning threshold for status (Default: '%{overall_status} =~ /yellow/i || %{vsan_status} =~ /yellow/i'). -Can used special variables like: %{overall_status}, %{vsan_status}, %{drs_enabled}, %{ha_enabled} +You can use the following variables: %{overall_status}, %{vsan_status}, %{drs_enabled}, %{ha_enabled} =item B<--critical-status> Set critical threshold for status (Default: '%{overall_status} =~ /red/i || %{vsan_status} =~ /red/i'). -Can used special variables like: %{overall_status}, %{vsan_status}, %{drs_enabled}, %{ha_enabled} +You can use the following variables: %{overall_status}, %{vsan_status}, %{drs_enabled}, %{ha_enabled} =back diff --git a/src/apps/vmware/connector/mode/statushost.pm b/src/apps/vmware/connector/mode/statushost.pm index fa51c18f1..ecd7c09bc 100644 --- a/src/apps/vmware/connector/mode/statushost.pm +++ b/src/apps/vmware/connector/mode/statushost.pm @@ -148,32 +148,32 @@ Search in following cluster(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-overall-status> Set warning threshold for status (Default: '%{overall_status} =~ /gray/i'). -Can used special variables like: %{overall_status} +You can use the following variables: %{overall_status} =item B<--warning-overall-status> Set warning threshold for status (Default: '%{overall_status} =~ /yellow/i'). -Can used special variables like: %{overall_status} +You can use the following variables: %{overall_status} =item B<--critical-overall-status> Set critical threshold for status (Default: '%{overall_status} =~ /red/i'). -Can used special variables like: %{overall_status} +You can use the following variables: %{overall_status} =back diff --git a/src/apps/vmware/connector/mode/statusvm.pm b/src/apps/vmware/connector/mode/statusvm.pm index dc7cc0ae3..4a1bf2bee 100644 --- a/src/apps/vmware/connector/mode/statusvm.pm +++ b/src/apps/vmware/connector/mode/statusvm.pm @@ -168,32 +168,32 @@ Search in following host(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{connection_state} !~ /^connected$/i'). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{connection_state} +You can use the following variables: %{connection_state} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--unknown-overall-status> Set unknown threshold for status (Default: '%{overall_status} =~ /gray/i'). -Can used special variables like: %{overall_status} +You can use the following variables: %{overall_status} =item B<--warning-overall-status> Set warning threshold for status (Default: '%{overall_status} =~ /yellow/i'). -Can used special variables like: %{overall_status} +You can use the following variables: %{overall_status} =item B<--critical-overall-status> Set critical threshold for status (Default: '%{overall_status} =~ /red/i'). -Can used special variables like: %{overall_status} +You can use the following variables: %{overall_status} =back diff --git a/src/apps/vmware/connector/mode/storagehost.pm b/src/apps/vmware/connector/mode/storagehost.pm index d419ea5a0..dc7b5787b 100644 --- a/src/apps/vmware/connector/mode/storagehost.pm +++ b/src/apps/vmware/connector/mode/storagehost.pm @@ -361,47 +361,47 @@ Filter paths by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i && %{maintenance} =~ /false/i'). -Can used special variables like: %{status}, %{maintenance} +You can use the following variables: %{status}, %{maintenance} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{maintenance} +You can use the following variables: %{status}, %{maintenance} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{maintenance} +You can use the following variables: %{status}, %{maintenance} =item B<--warning-adapter-status> Set warning threshold for adapter status. -Can used special variables like: %{name}, %{host}, %{status} +You can use the following variables: %{name}, %{host}, %{status} =item B<--critical-adapter-status> Set critical threshold for adapter status (Default: '%{status} =~ /fault/'). -Can used special variables like: %{name}, %{host}, %{status} +You can use the following variables: %{name}, %{host}, %{status} =item B<--warning-lun-status> Set warning threshold for lun status (Default: '%{status} =~ /degraded|quiesced/'). -Can used special variables like: %{name}, %{host}, %{status} +You can use the following variables: %{name}, %{host}, %{status} =item B<--critical-lun-status> Set critical threshold for lun status (Default: '%{status} =~ /lostcommunication|error/'). -Can used special variables like: %{name}, %{host}, %{status} +You can use the following variables: %{name}, %{host}, %{status} =item B<--warning-path-status> Set warning threshold for path status. -Can used special variables like: %{name}, %{host}, %{status} +You can use the following variables: %{name}, %{host}, %{status} =item B<--critical-path-status> Set critical threshold for path status (Default: '%{status} =~ /dead/'). -Can used special variables like: %{name}, %{host}, %{status} +You can use the following variables: %{name}, %{host}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/vmware/connector/mode/swaphost.pm b/src/apps/vmware/connector/mode/swaphost.pm index 365065789..8504c4415 100644 --- a/src/apps/vmware/connector/mode/swaphost.pm +++ b/src/apps/vmware/connector/mode/swaphost.pm @@ -151,17 +151,17 @@ Search in following cluster(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/swapvm.pm b/src/apps/vmware/connector/mode/swapvm.pm index 00852aaa3..bbc8968a5 100644 --- a/src/apps/vmware/connector/mode/swapvm.pm +++ b/src/apps/vmware/connector/mode/swapvm.pm @@ -176,17 +176,17 @@ Display virtual machine description. =item B<--unknown-status> Set unknown threshold for status (Default: '%{connection_state} !~ /^connected$/i or %{power_state} !~ /^poweredOn$/i'). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{connection_state}, %{power_state} +You can use the following variables: %{connection_state}, %{power_state} =item B<--warning-*> diff --git a/src/apps/vmware/connector/mode/timehost.pm b/src/apps/vmware/connector/mode/timehost.pm index 132319fca..435ac8f37 100644 --- a/src/apps/vmware/connector/mode/timehost.pm +++ b/src/apps/vmware/connector/mode/timehost.pm @@ -157,17 +157,17 @@ Search in following cluster(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-time> diff --git a/src/apps/vmware/connector/mode/uptimehost.pm b/src/apps/vmware/connector/mode/uptimehost.pm index bcc011394..e8e1f0c6f 100644 --- a/src/apps/vmware/connector/mode/uptimehost.pm +++ b/src/apps/vmware/connector/mode/uptimehost.pm @@ -157,17 +157,17 @@ Search in following cluster(s) (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} !~ /^connected$/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-time> diff --git a/src/apps/vmware/vcsa/restapi/mode/health.pm b/src/apps/vmware/vcsa/restapi/mode/health.pm index 55a00e87a..bfa887a4e 100644 --- a/src/apps/vmware/vcsa/restapi/mode/health.pm +++ b/src/apps/vmware/vcsa/restapi/mode/health.pm @@ -121,17 +121,17 @@ Filter service (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{health}, %{display} +You can use the following variables: %{health}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{health}, %{display} +You can use the following variables: %{health}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{health} !~ /green/'). -Can used special variables like: %{health}, %{display} +You can use the following variables: %{health}, %{display} =back diff --git a/src/apps/vmware/vcsa/snmp/mode/interfaces.pm b/src/apps/vmware/vcsa/snmp/mode/interfaces.pm index a4f793a08..8b9f878d7 100644 --- a/src/apps/vmware/vcsa/snmp/mode/interfaces.pm +++ b/src/apps/vmware/vcsa/snmp/mode/interfaces.pm @@ -94,12 +94,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/voip/3cx/restapi/mode/extension.pm b/src/apps/voip/3cx/restapi/mode/extension.pm index 836967f51..5c6bfe6b9 100644 --- a/src/apps/voip/3cx/restapi/mode/extension.pm +++ b/src/apps/voip/3cx/restapi/mode/extension.pm @@ -165,17 +165,17 @@ Filter extension. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration} +You can use the following variables: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration} +You can use the following variables: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration} +You can use the following variables: %{extension}, %{registered}, %{dnd}, %{profile}, %{status}, %{duration} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/voip/3cx/restapi/mode/system.pm b/src/apps/voip/3cx/restapi/mode/system.pm index 7caf09967..11e4183a0 100644 --- a/src/apps/voip/3cx/restapi/mode/system.pm +++ b/src/apps/voip/3cx/restapi/mode/system.pm @@ -190,17 +190,17 @@ Filter updates' category. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{error}, %{service} +You can use the following variables: %{error}, %{service} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{error}, %{service} +You can use the following variables: %{error}, %{service} =item B<--critical-status> Set critical threshold for status (Default: '%{error} =~ /false/'). -Can used special variables like: %{error}, %{service} +You can use the following variables: %{error}, %{service} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/voip/asterisk/ami/mode/dahdistatus.pm b/src/apps/voip/asterisk/ami/mode/dahdistatus.pm index b58f9016a..7216ea204 100644 --- a/src/apps/voip/asterisk/ami/mode/dahdistatus.pm +++ b/src/apps/voip/asterisk/ami/mode/dahdistatus.pm @@ -126,12 +126,12 @@ Filter dahdi description (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /UNCONFIGURED|YEL|BLU/i'). -Can used special variables like: %{description}, %{status} +You can use the following variables: %{description}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /RED/i'). -Can used special variables like: %{description}, %{status} +You can use the following variables: %{description}, %{status} =back diff --git a/src/apps/voip/asterisk/ami/mode/sippeersusage.pm b/src/apps/voip/asterisk/ami/mode/sippeersusage.pm index 9b0cdc79e..f3e5f3d31 100644 --- a/src/apps/voip/asterisk/ami/mode/sippeersusage.pm +++ b/src/apps/voip/asterisk/ami/mode/sippeersusage.pm @@ -183,12 +183,12 @@ Filter sip peer name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /LAGGED|UNKNOWN/i'). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /UNREACHABLE/i'). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--warning-*> diff --git a/src/apps/vtom/restapi/mode/jobs.pm b/src/apps/vtom/restapi/mode/jobs.pm index e04bd93d9..492db6c0c 100644 --- a/src/apps/vtom/restapi/mode/jobs.pm +++ b/src/apps/vtom/restapi/mode/jobs.pm @@ -361,22 +361,22 @@ Can use format: 'Europe/London' or '+0100'. =item B<--warning-status> Set warning threshold for status (Default: -) -Can used special variables like: %{name}, %{status}, %{exit_code}, %{message}, %{environment}, %{application} +You can use the following variables: %{name}, %{status}, %{exit_code}, %{message}, %{environment}, %{application} =item B<--critical-status> Set critical threshold for status (Default: '%{exit_code} =~ /Error/i'). -Can used special variables like: %{name}, %{status}, %{exit_code}, %{message}, %{environment}, %{application} +You can use the following variables: %{name}, %{status}, %{exit_code}, %{message}, %{environment}, %{application} =item B<--warning-long> Set warning threshold for long jobs (Default: none) -Can used special variables like: %{name}, %{status}, %{elapsed}, %{application} +You can use the following variables: %{name}, %{status}, %{elapsed}, %{application} =item B<--critical-long> Set critical threshold for long jobs (Default: none). -Can used special variables like: %{name}, %{status}, %{elapsed}, %{application} +You can use the following variables: %{name}, %{status}, %{elapsed}, %{application} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/wallix/bastion/snmp/mode/license.pm b/src/apps/wallix/bastion/snmp/mode/license.pm index fe047e62e..4b370259e 100644 --- a/src/apps/wallix/bastion/snmp/mode/license.pm +++ b/src/apps/wallix/bastion/snmp/mode/license.pm @@ -191,7 +191,8 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - 'unit:s' => { name => 'unit', default => 's' } + 'filter-category:s' => { name => 'filter_category' }, + 'unit:s' => { name => 'unit', default => 's' } }); return $self; @@ -209,6 +210,9 @@ sub check_options { sub add_license { my ($self, %options) = @_; + return if (defined($self->{option_results}->{filter_category}) && $self->{option_results}->{filter_category} ne '' && + $options{name} !~ /$self->{option_results}->{filter_category}/); + $self->{licenses}->{ $options{name} } = { name => $options{name}, used => $options{used} @@ -300,20 +304,24 @@ Check license. =over 8 +=item B<--filter-category> + +Filter licenses by category ('primary', 'secondary', 'resource'). + +=item B<--unit> + +Select the unit for the expired license threshold. May be 's' for seconds, 'm' for minutes, +'h' for hours, 'd' for days, 'w' for weeks. Default is seconds. + =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "expired"'). -Can used special variables like: %{status} - -=item B<--unit> - -Select the unit for expires threshold. May be 's' for seconds, 'm' for minutes, -'h' for hours, 'd' for days, 'w' for weeks. Default is seconds. +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/wallix/bastion/snmp/mode/system.pm b/src/apps/wallix/bastion/snmp/mode/system.pm index efb0a9629..fceb4a3bc 100644 --- a/src/apps/wallix/bastion/snmp/mode/system.pm +++ b/src/apps/wallix/bastion/snmp/mode/system.pm @@ -169,12 +169,12 @@ Example: --filter-counters='status' =item B<--warning-services-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-services-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/wazuh/restapi/mode/agents.pm b/src/apps/wazuh/restapi/mode/agents.pm index c5616f4ae..05493a13a 100644 --- a/src/apps/wazuh/restapi/mode/agents.pm +++ b/src/apps/wazuh/restapi/mode/agents.pm @@ -148,12 +148,12 @@ Filter agent name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{node_name}, %{display} +You can use the following variables: %{status}, %{node_name}, %{display} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}, %{node_name}, %{display} +You can use the following variables: %{status}, %{node_name}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/apps/wazuh/restapi/mode/manager.pm b/src/apps/wazuh/restapi/mode/manager.pm index 9b2ba28bd..a655fd3a4 100644 --- a/src/apps/wazuh/restapi/mode/manager.pm +++ b/src/apps/wazuh/restapi/mode/manager.pm @@ -200,12 +200,12 @@ Filter log name (can be a regexp). =item B<--warning-process-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-process-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/airespace/snmp/mode/apstatus.pm b/src/centreon/common/airespace/snmp/mode/apstatus.pm index e33d12d17..fd263e09a 100644 --- a/src/centreon/common/airespace/snmp/mode/apstatus.pm +++ b/src/centreon/common/airespace/snmp/mode/apstatus.pm @@ -321,22 +321,22 @@ Monitor radio interfaces channels utilization. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "enable" and %{opstatus} !~ /associated|downloading/'). -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--warning-radio-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--critical-radio-status> Set critical threshold for status (Default: '%{admstatus} eq "enable" and %{opstatus} eq "down"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/bluearc/snmp/mode/clusterstatus.pm b/src/centreon/common/bluearc/snmp/mode/clusterstatus.pm index 3acd57864..940983872 100644 --- a/src/centreon/common/bluearc/snmp/mode/clusterstatus.pm +++ b/src/centreon/common/bluearc/snmp/mode/clusterstatus.pm @@ -131,17 +131,17 @@ Filter node name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{state} =~ /unknown/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: -). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /offline/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =back diff --git a/src/centreon/common/bluearc/snmp/mode/interfaces.pm b/src/centreon/common/bluearc/snmp/mode/interfaces.pm index be68cc08a..7a2be78fd 100644 --- a/src/centreon/common/bluearc/snmp/mode/interfaces.pm +++ b/src/centreon/common/bluearc/snmp/mode/interfaces.pm @@ -94,12 +94,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/bluearc/snmp/mode/volumeusage.pm b/src/centreon/common/bluearc/snmp/mode/volumeusage.pm index 5457813d0..5ef8d67fb 100644 --- a/src/centreon/common/bluearc/snmp/mode/volumeusage.pm +++ b/src/centreon/common/bluearc/snmp/mode/volumeusage.pm @@ -221,12 +221,12 @@ Filter volume name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /needsChecking/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: -). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/ironport/snmp/mode/mailusage.pm b/src/centreon/common/cisco/ironport/snmp/mode/mailusage.pm index 4aa0a00e6..d88ba7da8 100644 --- a/src/centreon/common/cisco/ironport/snmp/mode/mailusage.pm +++ b/src/centreon/common/cisco/ironport/snmp/mode/mailusage.pm @@ -252,17 +252,17 @@ Check email security usage. =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{queue_status}, %{resource_conservation} +You can use the following variables: %{queue_status}, %{resource_conservation} =item B<--warning-status> Set warning threshold for status (Default: '%{resource_conservation} =~ /memoryShortage|queueSpaceShortage/i || %{queue_status} =~ /queueSpaceShortage/i'). -Can used special variables like: %{queue_status}, %{resource_conservation} +You can use the following variables: %{queue_status}, %{resource_conservation} =item B<--critical-status> Set critical threshold for status (Default: '%{resource_conservation} =~ /queueFull/i || %{queue_status} =~ /queueFull/i'). -Can used special variables like: %{queue_status}, %{resource_conservation} +You can use the following variables: %{queue_status}, %{resource_conservation} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/ironport/xmlapi/mode/systemusage.pm b/src/centreon/common/cisco/ironport/xmlapi/mode/systemusage.pm index 32ca790cd..1ac03ce3f 100644 --- a/src/centreon/common/cisco/ironport/xmlapi/mode/systemusage.pm +++ b/src/centreon/common/cisco/ironport/xmlapi/mode/systemusage.pm @@ -301,12 +301,12 @@ Threshold critical for http response code =item B<--warning-system-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{system_status} +You can use the following variables: %{system_status} =item B<--critical-system-status> Set critical threshold for status (Default: '%{system_status} !~ /online/i'). -Can used special variables like: %{system_status} +You can use the following variables: %{system_status} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/standard/snmp/mode/aaaservers.pm b/src/centreon/common/cisco/standard/snmp/mode/aaaservers.pm index ca43d7e20..74e2ef782 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/aaaservers.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/aaaservers.pm @@ -304,17 +304,17 @@ Filter AAA server by name (E.g.: 10.199.126.100:1812:1813. Format: [address]:[au =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /dead/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/standard/snmp/mode/bgp.pm b/src/centreon/common/cisco/standard/snmp/mode/bgp.pm index 54020811e..1db282dc7 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/bgp.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/bgp.pm @@ -264,17 +264,17 @@ Filter based on IP of peers (regexp allowed) =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{adminStatus}, %{state}, %{localAddr}, %{remoteAddr}, %{remoteAs} +You can use the following variables: %{adminStatus}, %{state}, %{localAddr}, %{remoteAddr}, %{remoteAs} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{adminStatus}, %{state}, %{localAddr}, %{remoteAddr}, %{remoteAs} +You can use the following variables: %{adminStatus}, %{state}, %{localAddr}, %{remoteAddr}, %{remoteAs} =item B<--critical-status> Set critical threshold for status (Default: '%{adminStatus} =~ /start/ && %{state} !~ /established/'). -Can used special variables like: %{adminStatus}, %{state}, %{localAddr}, %{remoteAddr}, %{remoteAs} +You can use the following variables: %{adminStatus}, %{state}, %{localAddr}, %{remoteAddr}, %{remoteAs} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/standard/snmp/mode/components/module.pm b/src/centreon/common/cisco/standard/snmp/mode/components/module.pm index d4c842d13..e36d3e691 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/components/module.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/components/module.pm @@ -76,7 +76,8 @@ sub check { $oid =~ /\.([0-9]+)$/; my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_cefcModuleOperStatus}, instance => $instance); - my $module_descr = $self->{results}->{$self->{physical_name} }->{ $self->{physical_name} . '.' . $instance }; + my $module_descr = defined($self->{results}->{ $self->{physical_name} }->{ $self->{physical_name} . '.' . $instance }) ? + $self->{results}->{ $self->{physical_name} }->{ $self->{physical_name} . '.' . $instance } : 'n/a'; next if ($self->check_filter(section => 'module', instance => $instance, name => $module_descr)); diff --git a/src/centreon/common/cisco/standard/snmp/mode/configuration.pm b/src/centreon/common/cisco/standard/snmp/mode/configuration.pm index 1357861a9..90ace34b6 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/configuration.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/configuration.pm @@ -132,12 +132,12 @@ Check Cisco changed and saved configurations (CISCO-CONFIG-MAN-MIB). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{running_last_changed}, %{running_last_saved}, %{startup_last_changed} +You can use the following variables: %{running_last_changed}, %{running_last_saved}, %{startup_last_changed} =item B<--critical-status> Set critical threshold for status (Default: '%{running_last_changed} > %{running_last_saved}'). -Can used special variables like: %{running_last_changed}, %{running_last_saved}, %{startup_last_changed} +You can use the following variables: %{running_last_changed}, %{running_last_saved}, %{startup_last_changed} =back diff --git a/src/centreon/common/cisco/standard/snmp/mode/interfaces.pm b/src/centreon/common/cisco/standard/snmp/mode/interfaces.pm index 8400d824e..a834d4b50 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/interfaces.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/interfaces.pm @@ -244,12 +244,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/standard/snmp/mode/memoryflash.pm b/src/centreon/common/cisco/standard/snmp/mode/memoryflash.pm index 8f699ce76..e3b600558 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/memoryflash.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/memoryflash.pm @@ -195,17 +195,17 @@ Check memory flash usages. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /readOnly/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/standard/snmp/mode/qosusage.pm b/src/centreon/common/cisco/standard/snmp/mode/qosusage.pm index c251f8584..dddcb4df3 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/qosusage.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/qosusage.pm @@ -431,7 +431,7 @@ sub manage_selection { (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); if (scalar(keys %{$self->{interface_classmap}}) <= 0 && !defined($options{disco})) { - $self->{output}->add_option_msg(short_msg => 'Cannot found classmap.'); + $self->{output}->add_option_msg(short_msg => 'Cannot find classmap.'); $self->{output}->option_exit(); } } diff --git a/src/centreon/common/cisco/standard/snmp/mode/stack.pm b/src/centreon/common/cisco/standard/snmp/mode/stack.pm index 145f2c0da..8de08f172 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/stack.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/stack.pm @@ -280,22 +280,22 @@ Set thresholds on members count for each states. =item B<--warning-stack-status> Set warning threshold for stack status (Default: ''). -Can used special variables like: %{stack_status} +You can use the following variables: %{stack_status} =item B<--critical-stack-status> Set critical threshold for stack status (Default: '%{stack_status} =~ /notredundant/'). -Can used special variables like: %{stack_status} +You can use the following variables: %{stack_status} =item B<--warning-status> Set warning threshold for members status (Default: ''). -Can used special variables like: %{name}, %{role}, %{state} +You can use the following variables: %{name}, %{role}, %{state} =item B<--critical-status> Set critical threshold for member status (Default: '%{state} !~ /ready/ && %{state} !~ /provisioned/'). -Can used special variables like: %{name}, %{role}, %{state} +You can use the following variables: %{name}, %{role}, %{state} Role can be: 'master', 'member', 'notMember', 'standby'. diff --git a/src/centreon/common/cisco/standard/snmp/mode/vpc.pm b/src/centreon/common/cisco/standard/snmp/mode/vpc.pm index dd430d4b8..a28ce8fc1 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/vpc.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/vpc.pm @@ -345,47 +345,47 @@ Check virtual port-channel (vPC). =item B<--unknown-peer-status> Set unknown threshold for status. -Can used special variables like: %{role}, %{role_last}, %{domain_id} +You can use the following variables: %{role}, %{role_last}, %{domain_id} =item B<--warning-peer-status> Set warning threshold for status. -Can used special variables like: %{role}, %{role_last}, %{domain_id} +You can use the following variables: %{role}, %{role_last}, %{domain_id} =item B<--critical-peer-status> Set critical threshold for status (Default: '%{role} ne %{role_last}'). -Can used special variables like: %{role}, %{role_last}, %{domain_id} +You can use the following variables: %{role}, %{role_last}, %{domain_id} =item B<--unknown-keepalive-status> Set unknown threshold for status. -Can used special variables like: %{keepalive_status}, %{domain_id} +You can use the following variables: %{keepalive_status}, %{domain_id} =item B<--warning-keepalive-status> Set warning threshold for status. -Can used special variables like: %{keepalive_status}, %{domain_id} +You can use the following variables: %{keepalive_status}, %{domain_id} =item B<--critical-keepalive-status> Set critical threshold for status (Default: '%{keepalive_status} ne "alive"'). -Can used special variables like: %{keepalive_status}, %{domain_id} +You can use the following variables: %{keepalive_status}, %{domain_id} =item B<--unknown-link-status> Set unknown threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-link-status> Set warning threshold for status (Default: '%{link_status} =~ /downStar/i') -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--critical-link-status> Set critical threshold for status (Default: '%{link_status} eq "down"'). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/standard/snmp/mode/vss.pm b/src/centreon/common/cisco/standard/snmp/mode/vss.pm index b5ce2c041..60c2e7d60 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/vss.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/vss.pm @@ -267,47 +267,47 @@ Check virtual switching system. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{mode} +You can use the following variables: %{mode} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{mode} +You can use the following variables: %{mode} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{mode} +You can use the following variables: %{mode} =item B<--unknown-member-status> Set unknown threshold for status. -Can used special variables like: %{role}, %{role_last}, %{switch_id} +You can use the following variables: %{role}, %{role_last}, %{switch_id} =item B<--warning-member-status> Set warning threshold for status. -Can used special variables like: %{role}, %{role_last}, %{switch_id} +You can use the following variables: %{role}, %{role_last}, %{switch_id} =item B<--critical-member-status> Set critical threshold for status (Default: '%{role} ne %{role_last}'). -Can used special variables like: %{role}, %{role_last}, %{switch_id} +You can use the following variables: %{role}, %{role_last}, %{switch_id} =item B<--unknown-link-status> Set unknown threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-link-status> Set warning threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--critical-link-status> Set critical threshold for status (Default: '%{link_status} eq "down"'). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cisco/standard/snmp/mode/wan3g.pm b/src/centreon/common/cisco/standard/snmp/mode/wan3g.pm index b6ffa65e4..b979af3e2 100644 --- a/src/centreon/common/cisco/standard/snmp/mode/wan3g.pm +++ b/src/centreon/common/cisco/standard/snmp/mode/wan3g.pm @@ -359,77 +359,77 @@ Filter by name (can be a regexp). =item B<--unknown-modem-status> Set unknown threshold for status (Default: '%{modem_status} =~ /unknown/i'). -Can used special variables like: %{modem_status}, %{display} +You can use the following variables: %{modem_status}, %{display} =item B<--warning-modem-status> Set warning threshold for status (Default: '%{modem_status} =~ /lowPowerMode/i'). -Can used special variables like: %{modem_status}, %{display} +You can use the following variables: %{modem_status}, %{display} =item B<--critical-modem-status> Set critical threshold for status (Default: '%{modem_status} =~ /offLine/i'). -Can used special variables like: %{modem_status}, %{display} +You can use the following variables: %{modem_status}, %{display} =item B<--unknown-connection-status> Set unknown threshold for status (Default: '%{connection_status} =~ /unknown/i'). -Can used special variables like: %{connection_status}, %{display} +You can use the following variables: %{connection_status}, %{display} =item B<--warning-connection-status> Set warning threshold for status. -Can used special variables like: %{connection_status}, %{display} +You can use the following variables: %{connection_status}, %{display} =item B<--critical-connection-status> Set critical threshold for status (Default: '%{connection_status} =~ /inactive|idle|disconnected|error/i'). -Can used special variables like: %{connection_status}, %{display} +You can use the following variables: %{connection_status}, %{display} =item B<--unknown-sim-status> Set unknown threshold for status (Default: '%{sim_status} =~ /unknown/i'). -Can used special variables like: %{sim_status}, %{display} +You can use the following variables: %{sim_status}, %{display} =item B<--warning-sim-status> Set warning threshold for status. -Can used special variables like: %{sim_status}, %{display} +You can use the following variables: %{sim_status}, %{display} =item B<--critical-sim-status> Set critical threshold for status (Default: '%{sim_status} !~ /ok|unknown/i'). -Can used special variables like: %{sim_status}, %{display} +You can use the following variables: %{sim_status}, %{display} =item B<--unknown-radio-status> Set unknown threshold for status (Default: '%{current_band} =~ /unknown/i'). -Can used special variables like: %{current_band}, %{channel_number}, %{display} +You can use the following variables: %{current_band}, %{channel_number}, %{display} =item B<--warning-radio-status> Set warning threshold for status. -Can used special variables like: %{current_band}, %{channel_number}, %{display} +You can use the following variables: %{current_band}, %{channel_number}, %{display} =item B<--critical-radio-status> Set critical threshold for status (Default: '%{current_band} =~ /invalid|none/i'). -Can used special variables like: %{current_band}, %{channel_number}, %{display} +You can use the following variables: %{current_band}, %{channel_number}, %{display} =item B<--unknown-network-status> Set unknown threshold for status (Default: '%{service_status} =~ /unknown/i'). -Can used special variables like: %{service_status}, %{display} +You can use the following variables: %{service_status}, %{display} =item B<--warning-network-status> Set warning threshold for status. -Can used special variables like: %{service_status}, %{display} +You can use the following variables: %{service_status}, %{display} =item B<--critical-network-status> Set critical threshold for status (Default: '%{service_status} =~ /emergencyOnly|noService/i'). -Can used special variables like: %{service_status}, %{display} +You can use the following variables: %{service_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cps/ups/snmp/mode/batterystatus.pm b/src/centreon/common/cps/ups/snmp/mode/batterystatus.pm index 832586cd1..969f6a2c2 100644 --- a/src/centreon/common/cps/ups/snmp/mode/batterystatus.pm +++ b/src/centreon/common/cps/ups/snmp/mode/batterystatus.pm @@ -144,17 +144,17 @@ Check battery status and charge remaining. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown|notPresent/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /low/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cps/ups/snmp/mode/inputlines.pm b/src/centreon/common/cps/ups/snmp/mode/inputlines.pm index d47985305..0526ad6bb 100644 --- a/src/centreon/common/cps/ups/snmp/mode/inputlines.pm +++ b/src/centreon/common/cps/ups/snmp/mode/inputlines.pm @@ -132,17 +132,17 @@ Check INPUT lines metrics. =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /normal/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/cps/ups/snmp/mode/outputlines.pm b/src/centreon/common/cps/ups/snmp/mode/outputlines.pm index efd27c2d9..972a69966 100644 --- a/src/centreon/common/cps/ups/snmp/mode/outputlines.pm +++ b/src/centreon/common/cps/ups/snmp/mode/outputlines.pm @@ -166,17 +166,17 @@ Check output lines metrics. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /rebooting|onBattery|onBypass/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/emc/navisphere/mode/hbastate.pm b/src/centreon/common/emc/navisphere/mode/hbastate.pm index b07eb85b2..d1772567a 100644 --- a/src/centreon/common/emc/navisphere/mode/hbastate.pm +++ b/src/centreon/common/emc/navisphere/mode/hbastate.pm @@ -182,9 +182,9 @@ Set hba uid to check (not set, means 'all'). =item B<--path-status> -Set how much path must be connected (Can be multiple). +Set how many paths must be connected (can be defined multiple times). Syntax: [WARNING],[CRITICAL],filter_uid,filter_server -Example: ,@0:1,.*,.* - Means all server must have at least two paths connected. +Example: ,@0:1,.*,.* - Means all servers must have at least two paths connected. =back diff --git a/src/centreon/common/fortinet/fortigate/snmp/mode/apusage.pm b/src/centreon/common/fortinet/fortigate/snmp/mode/apusage.pm index 9be386ab9..1d253cfd8 100644 --- a/src/centreon/common/fortinet/fortigate/snmp/mode/apusage.pm +++ b/src/centreon/common/fortinet/fortigate/snmp/mode/apusage.pm @@ -239,17 +239,17 @@ Filter by access point name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admin} eq "enable" and %{status} !~ /online/i''). -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =back diff --git a/src/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm b/src/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm index 1e48a6324..eacd6f2d7 100644 --- a/src/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm +++ b/src/centreon/common/fortinet/fortigate/snmp/mode/clusterstatus.pm @@ -271,12 +271,12 @@ Check cluster status. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{serial}, %{hostname}, %{sync_status}, %{role}, %{roleLast} +You can use the following variables: %{serial}, %{hostname}, %{sync_status}, %{role}, %{roleLast} =item B<--critical-status> Set critical threshold for status (Default: '%{role} ne %{roleLast} or %{sync_status} =~ /unsynchronized/'). -Can used special variables like: %{serial}, %{hostname}, %{sync_status}, %{role}, %{roleLast} +You can use the following variables: %{serial}, %{hostname}, %{sync_status}, %{role}, %{roleLast} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/fortinet/fortigate/snmp/mode/interfaces.pm b/src/centreon/common/fortinet/fortigate/snmp/mode/interfaces.pm index 8280974a3..087548ec7 100644 --- a/src/centreon/common/fortinet/fortigate/snmp/mode/interfaces.pm +++ b/src/centreon/common/fortinet/fortigate/snmp/mode/interfaces.pm @@ -105,12 +105,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/fortinet/fortigate/snmp/mode/sdwan.pm b/src/centreon/common/fortinet/fortigate/snmp/mode/sdwan.pm index 0e842c970..3798222c4 100644 --- a/src/centreon/common/fortinet/fortigate/snmp/mode/sdwan.pm +++ b/src/centreon/common/fortinet/fortigate/snmp/mode/sdwan.pm @@ -365,17 +365,17 @@ Filter sd-wan links by vdom name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{vdom}, %{id}, %{name}, %{ifName} +You can use the following variables: %{state}, %{vdom}, %{id}, %{name}, %{ifName} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{vdom}, %{id}, %{name}, %{ifName} +You can use the following variables: %{state}, %{vdom}, %{id}, %{name}, %{ifName} =item B<--critical-status> Set critical threshold for status (Default: '%{state} eq "down"'). -Can used special variables like: %{state}, %{vdom}, %{id}, %{name}, %{ifName} +You can use the following variables: %{state}, %{vdom}, %{id}, %{name}, %{ifName} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/fortinet/fortigate/snmp/mode/vdomusage.pm b/src/centreon/common/fortinet/fortigate/snmp/mode/vdomusage.pm index a58c3bdc8..cb72b7ebf 100644 --- a/src/centreon/common/fortinet/fortigate/snmp/mode/vdomusage.pm +++ b/src/centreon/common/fortinet/fortigate/snmp/mode/vdomusage.pm @@ -436,12 +436,12 @@ Time in minutes before reloading cache file (default: 60). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{op_mode}, %{ha_state} +You can use the following variables: %{op_mode}, %{ha_state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{op_mode}, %{ha_state} +You can use the following variables: %{op_mode}, %{ha_state} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/h3c/snmp/mode/interfaces.pm b/src/centreon/common/h3c/snmp/mode/interfaces.pm index 990c615b0..7b3427770 100644 --- a/src/centreon/common/h3c/snmp/mode/interfaces.pm +++ b/src/centreon/common/h3c/snmp/mode/interfaces.pm @@ -226,12 +226,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/riverbed/steelhead/snmp/mode/status.pm b/src/centreon/common/riverbed/steelhead/snmp/mode/status.pm index 188c46965..3c0a1f78e 100644 --- a/src/centreon/common/riverbed/steelhead/snmp/mode/status.pm +++ b/src/centreon/common/riverbed/steelhead/snmp/mode/status.pm @@ -149,12 +149,12 @@ Check the current status of the optimization service. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{health}, %{status} +You can use the following variables: %{health}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{health} !~ /Healthy/ || %{status} !~ /running/'). -Can used special variables like: %{health}, %{status} +You can use the following variables: %{health}, %{status} =item B<--warning-uptime> diff --git a/src/centreon/common/xppc/snmp/mode/batterystatus.pm b/src/centreon/common/xppc/snmp/mode/batterystatus.pm index 89d4c4cff..1f70006ad 100644 --- a/src/centreon/common/xppc/snmp/mode/batterystatus.pm +++ b/src/centreon/common/xppc/snmp/mode/batterystatus.pm @@ -146,17 +146,17 @@ Example: --filter-counters='status|current' =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /low/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/common/xppc/snmp/mode/outputlines.pm b/src/centreon/common/xppc/snmp/mode/outputlines.pm index 2578277ff..9b0eb4b20 100644 --- a/src/centreon/common/xppc/snmp/mode/outputlines.pm +++ b/src/centreon/common/xppc/snmp/mode/outputlines.pm @@ -140,17 +140,17 @@ Check output lines metrics. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /rebooting|onBypass/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /onBattery/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-*> B<--critical-*> diff --git a/src/centreon/plugins/dbi.pm b/src/centreon/plugins/dbi.pm index 85d0f2923..ff61fa1f5 100644 --- a/src/centreon/plugins/dbi.pm +++ b/src/centreon/plugins/dbi.pm @@ -365,32 +365,34 @@ dbi class =item B<--datasource> -Datasource (required. Depends of database server). +Database server information, mandatory if the server's address and port are not +defined in the corresponding options. The syntax depends on the database type. =item B<--username> -Database username. +User name used to connect to the database. =item B<--password> -Database password. +Password for the defined user name. =item B<--connect-options> -Add options in database connect. +Add connection options for the DBI connect method. Format: name=value,name2=value2,... =item B<--connect-query> -Execute a query just after connection. +Execute a query just after the connection. =item B<--sql-errors-exit> -Exit code for DB Errors (default: unknown) +Expected status in case of DB error or timeout. +Possible values are warning, critical and unknown (default). =item B<--timeout> -Timeout in seconds for connection +Timeout in seconds for connection. =item B<--exec-timeout> diff --git a/src/centreon/plugins/http.pm b/src/centreon/plugins/http.pm index 261dc066e..225e642e3 100644 --- a/src/centreon/plugins/http.pm +++ b/src/centreon/plugins/http.pm @@ -252,24 +252,24 @@ HTTP abstraction layer for lwp and curl backends =item B<--http-peer-addr> -Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) +Set the address you want to connect to. Useful if hostname is only a vhost, to avoid IP resolution. =item B<--proxyurl> -Proxy URL +Proxy URL. Eg: http://my.proxy:3128 =item B<--proxypac> -Proxy pac file (can be an url or local file) +Proxy pac file (can be a URL or a local file). =item B<--insecure> -Insecure SSL connections. +Accept insecure SSL connections. =item B<--http-backend> -Set the backend used (Default: 'lwp') -For curl: --http-backend=curl +Perl library to use for HTTP transactions. +Possible values are: lwp (default) and curl. =back diff --git a/src/centreon/plugins/multi.pm b/src/centreon/plugins/multi.pm index f2c8a9e17..877b90b5a 100644 --- a/src/centreon/plugins/multi.pm +++ b/src/centreon/plugins/multi.pm @@ -108,13 +108,14 @@ Check multiple modes at once. =item B<--modes-exec> -Which modes to select (separated by coma). +Modes to use, separated by commas. Example for linux: --modes-exec=cpu,memory,storage,interfaces =item B<--option-mode> -Set options for a specifi mode (can be multiple). -Example interfaces and storage snmp: +Define options for the modes selected in --modes-exec. +The option can be used several times. +E.g.: to define two options for the interfaces mode and one for the storage mode: --option-mode='interfaces,--statefile-dir=/tmp' --option-mode='interfaces,--add-traffic' --option-mode='storage,--statefile-dir=/tmp' =back diff --git a/src/centreon/plugins/output.pm b/src/centreon/plugins/output.pm index 6e9c5efb4..1b9afc7b7 100644 --- a/src/centreon/plugins/output.pm +++ b/src/centreon/plugins/output.pm @@ -1516,26 +1516,33 @@ Output class =item B<--verbose> -Display long output. +Display extended status information (long output). =item B<--debug> -Display also debug messages. +Display debug messages. =item B<--filter-perfdata> Filter perfdata that match the regexp. +Eg: adding --filter-perfdata='avg' will remove all metrics that do not contain +'avg' from performance data. =item B<--filter-perfdata-adv> -Advanced perfdata filter. - -Eg: --filter-perfdata-adv='not (%(value) == 0 and %(max) eq "")' +Filter perfdata based on a "if" condition using the following variables: +label, value, unit, warning, critical, min, max. +Variables must be written either %{variable} or %(variable). +Eg: adding --filter-perfdata-adv='not (%(value) == 0 and %(max) eq "")' will +remove all metrics whose value equals 0 and that don't have a maximum value. =item B<--explode-perfdata-max> -Put max perfdata (if it exist) in a specific perfdata -(without values: same with '_max' suffix) (Multiple options) +Create a new metric for each metric that comes with a maximum limit. The new +metric will be named identically with a '_max' suffix). +Eg: it will split 'used_prct'=26.93%;0:80;0:90;0;100 +into 'used_prct'=26.93%;0:80;0:90;0;100 'used_prct_max'=100%;;;; + =item B<--change-perfdata> B<--extend-perfdata> @@ -1546,11 +1553,11 @@ Common examples: =over 4 -Change storage free perfdata in used: --change-perfdata=free,used,invert() +Convert storage free perfdata into used: --change-perfdata=free,used,invert() -Change storage free perfdata in used: --change-perfdata=used,free,invert() +Convert storage free perfdata into used: --change-perfdata=used,free,invert() -Scale traffic values automaticaly: --change-perfdata=traffic,,scale(auto) +Scale traffic values automatically: --change-perfdata=traffic,,scale(auto) Scale traffic values in Mbps: --change-perfdata=traffic_in,,scale(Mbps),mbps @@ -1560,8 +1567,14 @@ Change traffic values in percent: --change-perfdata=traffic_in,,percent() =item B<--extend-perfdata-group> -Extend perfdata from multiple perfdatas (methods in target are: min, max, average, sum) -Syntax: --extend-perfdata-group=searchlabel,newlabel,target[,[newuom],[min],[max]] +Add new aggregated metrics (min, max, average or sum) for groups of metrics defined by a regex match on the metrics' names. +Syntax: --extend-perfdata-group=regex,namesofnewmetrics,calculation[,[newuom],[min],[max]] +regex: regular expression +namesofnewmetrics: how the new metrics' names are composed (can use $1, $2... for groups defined by () in regex). +calculation: how the values of the new metrics should be calculated +newuom (optional): unit of measure for the new metrics +min (optional): lowest value the metrics can reach +max (optional): highest value the metrics can reach Common examples: @@ -1575,11 +1588,16 @@ Sum traffic by interface: --extend-perfdata-group='traffic_in_(.*),traffic_$1,su =item B<--change-short-output> B<--change-long-output> -Change short/long output display: --change-short-output=pattern~replace~modifier +Modify the short/long output that is returned by the plugin. +Syntax: --change-short-output=pattern~replacement~modifier +Most commonly used modifiers are i (case insensitive) and g (replace all occurrences). +Eg: adding --change-short-output='OK~Up~gi' will replace all occurrences of 'OK', 'ok', 'Ok' or 'oK' with 'Up' =item B<--change-exit> -Change exit code: --change-exit=unknown=critical +Replace an exit code with one of your choice. +Eg: adding --change-exit=unknown=critical will result in a CRITICAL state +instead of an UNKNOWN state. =item B<--range-perfdata> @@ -1588,53 +1606,61 @@ Change perfdata range thresholds display: =item B<--filter-uom> -Filter UOM that match the regexp. +Masks the units when they don't match the given regular expression. =item B<--opt-exit> -Optional exit code for an execution error (i.e. wrong option provided, -SSH connection refused, timeout, etc) -(Default: unknown). +Replace the exit code in case of an execution error (i.e. wrong option provided, +SSH connection refused, timeout, etc). Default: unknown. =item B<--output-ignore-perfdata> -Remove perfdata from output. +Remove all the metrics from the service. The service will still have a status +and an output. =item B<--output-ignore-label> -Remove label status from output. +Remove the status label ("OK:", "WARNING:", "UNKNOWN:", CRITICAL:") from the +beginning of the output. +Eg: 'OK: Ram Total:...' will become 'Ram Total:...' =item B<--output-xml> -Display output in XML format. +Return the output in XML format (to send to an XML API). =item B<--output-json> -Display output in JSON format. +Return the output in JSON format (to send to a JSON API). =item B<--output-openmetrics> -Display metrics in OpenMetrics format. +Return the output in OpenMetrics format (to send to a tool expecting this +format). =item B<--output-file> -Write output in file (can be used with json and xml options) +Write output in file (can be combined with json, xml and openmetrics options). +E.g.: --output-file=/tmp/output.txt will write the output in /tmp/output.txt. =item B<--disco-format> -Display discovery arguments (if the mode manages it). +Applies only to modes beginning with 'list-'. +Returns the list of available macros to configure a service discovery rule +(formatted in XML). =item B<--disco-show> -Display discovery values (if the mode manages it). +Applies only to modes beginning with 'list-'. +Returns the list of discovered objects (formatted in XML) for service discovery. =item B<--float-precision> -Set the float precision for thresholds (Default: 8). +Define the float precision for thresholds (default: 8). =item B<--source-encoding> -Set encoding of monitoring sources (In some case. Default: 'UTF-8'). +Define the character encoding of the response sent by the monitored resource +Default: 'UTF-8'. =head1 DESCRIPTION diff --git a/src/centreon/plugins/script.pm b/src/centreon/plugins/script.pm index 529286aa6..faee006e9 100644 --- a/src/centreon/plugins/script.pm +++ b/src/centreon/plugins/script.pm @@ -451,36 +451,38 @@ Specify the path to the plugin. =item B<--list-plugin> -Print available plugins. +List all available plugins. =item B<--version> -Print global version. +Return the version of the plugin. =item B<--help> -Print a brief help message and exits. +Return the help message for the plugin and exit. =item B<--ignore-warn-msg> -Perl warn messages are ignored (not displayed). +Ignore Perl warning messages (they will not be displayed). =item B<--runas> -Run the script as a different user (prefer to use directly the good user). +Run the script as a different user. =item B<--global-timeout> -Set script timeout. +Define the script's timeout. =item B<--environment> -Set environment variables for the script (prefer to set it before running it for better performance). +Define environment variables for the script (set them in the execution environment +before running it for better performance). =item B<--convert-args> -Change strings of arguments. Useful to use '!' in nrpe protocol. -Example: --convert-args='##,\x21' +Replace a pattern in the provided arguments. Useful to bypass forbidden characters. +E.g.: when a password transmitted via the NRPE protocol contains '!' (which is +interpreted as a separator), you can send '##' instead of the '!' and the plugin will replace '##' with '!', using the --convert-args='##,\x21' option. =back diff --git a/src/centreon/plugins/script_custom.pm b/src/centreon/plugins/script_custom.pm index fc38d6177..177f6aadd 100644 --- a/src/centreon/plugins/script_custom.pm +++ b/src/centreon/plugins/script_custom.pm @@ -271,15 +271,15 @@ __END__ =item B<--mode> -Choose a mode. +Define the mode in which you want the plugin to be executed (see --list-mode). =item B<--dyn-mode> -Specify a mode with the path (separated by '::'). +Specify a mode with the module's path (advanced). =item B<--list-mode> -List available modes. +List all available modes. =item B<--mode-version> @@ -287,23 +287,25 @@ Check minimal version of mode. If not, unknown error. =item B<--version> -Display plugin version. +Return the version of the plugin. =item B<--custommode> -Choose a custom mode. +When a plugin offers several ways (CLI, library, etc.) to get the an information +the desired one must be defined with this option. =item B<--list-custommode> -List available custom modes. +List all available custom modes. =item B<--multiple> -Multiple custom mode objects (required by some specific modes) +Multiple custom mode objects. This may be required by some specific modes (advanced). =item B<--pass-manager> -Use a password manager. +Define the password manager you want to use. +Supported managers are: environment, file, keepass, hashicorpvault and teampass. =back diff --git a/src/centreon/plugins/script_simple.pm b/src/centreon/plugins/script_simple.pm index a090b4b01..65cf79c6a 100644 --- a/src/centreon/plugins/script_simple.pm +++ b/src/centreon/plugins/script_simple.pm @@ -202,15 +202,15 @@ __END__ =item B<--mode> -Choose a mode. +Define the mode in which you want the plugin to be executed (see --list-mode). =item B<--dyn-mode> -Specify a mode with the path (separated by '::'). +Specify a mode with the module's path (advanced). =item B<--list-mode> -List available modes. +List all available modes. =item B<--mode-version> @@ -218,11 +218,12 @@ Check minimal version of mode. If not, unknown error. =item B<--version> -Display plugin version. +Return the version of the plugin. =item B<--pass-manager> -Use a password manager. +Define the password manager you want to use. +Supported managers are: environment, file, keepass, hashicorpvault and teampass. =back diff --git a/src/centreon/plugins/script_snmp.pm b/src/centreon/plugins/script_snmp.pm index d85d4a524..45bb4ef80 100644 --- a/src/centreon/plugins/script_snmp.pm +++ b/src/centreon/plugins/script_snmp.pm @@ -210,15 +210,15 @@ __END__ =item B<--mode> -Choose a mode. +Define the mode in which you want the plugin to be executed (see --list-mode). =item B<--dyn-mode> -Specify a mode with the path (separated by '::'). +Specify a mode with the module's path (advanced). =item B<--list-mode> -List available modes. +List all available modes. =item B<--mode-version> @@ -226,11 +226,12 @@ Check minimal version of mode. If not, unknown error. =item B<--version> -Display plugin version. +Return the version of the plugin. =item B<--pass-manager> -Use a password manager. +Define the password manager you want to use. +Supported managers are: environment, file, keepass, hashicorpvault and teampass. =back diff --git a/src/centreon/plugins/script_sql.pm b/src/centreon/plugins/script_sql.pm index 639e68462..415989eff 100644 --- a/src/centreon/plugins/script_sql.pm +++ b/src/centreon/plugins/script_sql.pm @@ -270,15 +270,15 @@ __END__ =item B<--mode> -Choose a mode. +Define the mode in which you want the plugin to be executed (see --list-mode). =item B<--dyn-mode> -Specify a mode with the path (separated by '::'). +Specify a mode with the module's path (advanced). =item B<--list-mode> -List available modes. +List all available modes. =item B<--mode-version> @@ -286,23 +286,25 @@ Check minimal version of mode. If not, unknown error. =item B<--version> -Display plugin version. +Return the version of the plugin. =item B<--sqlmode> -Choose a sql mode (Default: "dbi"). +This plugin offers several ways to query the database (default: dbi). +See --list-sqlmode. =item B<--list-sqlmode> -List available sql modes. +List all available sql modes. =item B<--multiple> -Multiple database connections (required by some specific modes). +Enable connecting to multiple databases (required by some specific modes such as replication). =item B<--pass-manager> -Use a password manager. +Define the password manager you want to use. +Supported managers are: environment, file, keepass, hashicorpvault and teampass. =back diff --git a/src/centreon/plugins/script_wsman.pm b/src/centreon/plugins/script_wsman.pm index a094723cf..5293d22ea 100644 --- a/src/centreon/plugins/script_wsman.pm +++ b/src/centreon/plugins/script_wsman.pm @@ -206,15 +206,15 @@ __END__ =item B<--mode> -Choose a mode. +Define the mode in which you want the plugin to be executed (see --list-mode). =item B<--dyn-mode> -Specify a mode with the path (separated by '::'). +Specify a mode with the module's path (advanced). =item B<--list-mode> -List available modes. +List all available modes. =item B<--mode-version> @@ -222,11 +222,12 @@ Check minimal version of mode. If not, unknown error. =item B<--version> -Display plugin version. +Return the version of the plugin. =item B<--pass-manager> -Use a password manager. +Define the password manager you want to use. +Supported managers are: environment, file, keepass, hashicorpvault and teampass. =back diff --git a/src/centreon/plugins/snmp.pm b/src/centreon/plugins/snmp.pm index 06eb1c9bf..40757165d 100644 --- a/src/centreon/plugins/snmp.pm +++ b/src/centreon/plugins/snmp.pm @@ -22,6 +22,7 @@ package centreon::plugins::snmp; use strict; use warnings; +use centreon::plugins::misc; use SNMP; use Socket; use POSIX; @@ -54,6 +55,7 @@ sub new { 'maxrepetitions:s' => { name => 'maxrepetitions', default => 50 }, 'subsetleef:s' => { name => 'subsetleef', default => 50 }, 'subsettable:s' => { name => 'subsettable', default => 100 }, + 'snmp-cache-file:s' => { name => 'snmp_cache_file' }, 'snmp-autoreduce:s' => { name => 'snmp_autoreduce' }, 'snmp-force-getnext' => { name => 'snmp_force_getnext' }, 'snmp-username:s' => { name => 'snmp_security_name' }, @@ -221,6 +223,24 @@ sub autoreduce_leef { return 0; } +sub get_leef_cache { + my ($self, %options) = @_; + + my $results = {}; + foreach my $oid (@{$options{oids}}) { + if (defined($self->{snmp_cache}->{$oid})) { + $results->{$oid} = $self->{snmp_cache}->{$oid}; + } + } + + if ($options{nothing_quit} == 1 && scalar(keys %$results) <= 0) { + $self->{output}->add_option_msg(short_msg => 'SNMP GET Request: Cant get a single value.'); + $self->{output}->option_exit(exit_litteral => $self->{snmp_errors_exit}); + } + + return $results; +} + sub get_leef { my ($self, %options) = @_; # $options{dont_quit} = integer @@ -247,6 +267,10 @@ sub get_leef { @{$self->{oids_loaded}} = (); } + if ($self->{use_snmp_cache} == 1) { + return $self->get_leef_cache(oids => $options{oids}, nothing_quit => $nothing_quit); + } + my $results = {}; $self->{array_ref_ar} = []; my $subset_current = 0; @@ -396,6 +420,43 @@ sub multiple_find_bigger { return $getting->{pop(@values)}; } +sub get_multiple_table_cache { + my ($self, %options) = @_; + + my $results = {}; + foreach my $entry (@{$options{oids}}) { + my $result = $self->get_table_cache( + oid => $entry->{oid}, + start => $entry->{start}, + end => $entry->{end}, + nothing_quit => 0 + ); + if ($options{return_type} == 0) { + $results->{ $entry->{oid} } = $result; + } else { + $results = { %$results, %$result }; + } + } + + my $total = 0; + if ($options{nothing_quit} == 1) { + if ($options{return_type} == 1) { + $total = scalar(keys %$results); + } else { + foreach (keys %$results) { + $total += scalar(keys %{$results->{$_}}); + } + } + + if ($total == 0) { + $self->{output}->add_option_msg(short_msg => 'SNMP Table Request: Cant get a single value.'); + $self->{output}->option_exit(exit_litteral => $self->{snmp_errors_exit}); + } + } + + return $results; +} + sub get_multiple_table { my ($self, %options) = @_; # $options{dont_quit} = integer @@ -408,6 +469,14 @@ sub get_multiple_table { my ($nothing_quit) = (defined($options{nothing_quit}) && $options{nothing_quit} == 1) ? 1 : 0; $self->set_error(); + if ($self->{use_snmp_cache} == 1) { + return $self->get_multiple_table_cache( + oids => $options{oids}, + return_type => $return_type, + nothing_quit => $nothing_quit + ); + } + my $working_oids = {}; my $results = {}; # Check overlap @@ -429,7 +498,7 @@ sub get_multiple_table { } if ($return_type == 0) { - $results->{$entry->{oid}} = {}; + $results->{ $entry->{oid} } = {}; } } @@ -560,6 +629,29 @@ sub get_multiple_table { return $results; } +sub get_table_cache { + my ($self, %options) = @_; + + my $branch = defined($options{start}) ? $options{start} : $options{oid}; + + my $results = {}; + foreach my $oid ($self->oid_lex_sort(keys %{$self->{snmp_cache}})) { + if ($oid =~ /^$branch\./) { + $results->{$oid} = $self->{snmp_cache}->{$oid}; + if (defined($options{end}) && $self->check_oid_up(current => $oid, end => $options{end})) { + last; + } + } + } + + if ($options{nothing_quit} == 1 && scalar(keys %$results) <= 0) { + $self->{output}->add_option_msg(short_msg => 'SNMP Table Request: Cant get a single value.'); + $self->{output}->option_exit(exit_litteral => $self->{snmp_errors_exit}); + } + + return $results; +} + sub get_table { my ($self, %options) = @_; # $options{dont_quit} = integer @@ -578,6 +670,15 @@ sub get_table { $options{end} = $self->clean_oid($options{end}); } + if ($self->{use_snmp_cache} == 1) { + return $self->get_table_cache( + oid => $options{oid}, + start => $options{start}, + end => $options{end}, + nothing_quit => $nothing_quit + ); + } + # we use a medium (UDP have a PDU limit. SNMP protcol cant send multiples for one request) # So we need to manage # It's for "bulk". We ask 50 next values. If you set 1, it's like a getnext (snmp v1) @@ -597,7 +698,7 @@ sub get_table { $self->{output}->option_exit(exit_litteral => $self->{snmp_errors_exit}); } - my $main_indice = $1 . "." . $2; + my $main_indice = $1 . '.' . $2; my $results = {}; # Quit if base not the same or 'ENDOFMIBVIEW' value @@ -751,7 +852,28 @@ sub check_oid_up { sub check_options { my ($self, %options) = @_; - # $options{option_results} = ref to options result + + $self->{snmp_errors_exit} = $options{option_results}->{snmp_errors_exit}; + + $self->{use_snmp_cache} = 0; + if (defined($options{option_results}->{snmp_cache_file}) && $options{option_results}->{snmp_cache_file} ne '') { + centreon::plugins::misc::mymodule_load( + output => $self->{output}, + module => 'JSON::XS', + error_msg => "Cannot load module 'JSON::XS'." + ); + my $content = centreon::plugins::misc::slurp_file(output => $self->{output}, file => $options{option_results}->{snmp_cache_file}); + eval { + $self->{snmp_cache} = JSON::XS->new->decode($content); + }; + if ($@) { + $self->{output}->add_option_msg(short_msg => "Cannot decode json cache file: $@"); + $self->{output}->option_exit(); + } + + $self->{use_snmp_cache} = 1; + return ; + } if (!defined($options{option_results}->{host})) { $self->{output}->add_option_msg(short_msg => 'Missing parameter --hostname.'); @@ -768,7 +890,6 @@ sub check_options { $self->{maxrepetitions} = $options{option_results}->{maxrepetitions}; $self->{subsetleef} = (defined($options{option_results}->{subsetleef}) && $options{option_results}->{subsetleef} =~ /^[0-9]+$/) ? $options{option_results}->{subsetleef} : 50; $self->{subsettable} = (defined($options{option_results}->{subsettable}) && $options{option_results}->{subsettable} =~ /^[0-9]+$/) ? $options{option_results}->{subsettable} : 100; - $self->{snmp_errors_exit} = $options{option_results}->{snmp_errors_exit}; $self->{snmp_autoreduce} = 0; $self->{snmp_autoreduce_divisor} = 2; if (defined($options{option_results}->{snmp_autoreduce})) { @@ -985,27 +1106,29 @@ snmp class =item B<--hostname> -Hostname to query (required). +Name or address of the host to monitor (mandatory). =item B<--snmp-community> -Read community (defaults to public). +SNMP community (default value: public). It is recommended to use a read-only +community. =item B<--snmp-version> -Version: 1 for SNMP v1 (default), 2 for SNMP v2c, 3 for SNMP v3. +Version of the SNMP protocol. 1 for SNMP v1 (default), 2 for SNMP v2c, 3 for SNMP v3. =item B<--snmp-port> -Port (default: 161). +UDP port to send the SNMP request to (default: 161). =item B<--snmp-timeout> -Timeout in secondes (default: 1) before retries. +Time to wait before sending the request again if no reply has been received, +in seconds (default: 1). See also --snmp-retries. =item B<--snmp-retries> -Set the number of retries (default: 5) before failure. +Maximum number of retries (default: 5). =item B<--maxrepetitions> @@ -1017,77 +1140,91 @@ How many oid values per SNMP request (default: 50) (for get_leef method. Be caut =item B<--snmp-autoreduce> -Auto reduce SNMP request size in case of SNMP errors (By default, the divisor is 2). +Progressively reduce the number requested OIDs in bulk mode. Use it in case of +SNMP errors (By default, the number is divided by 2). =item B<--snmp-force-getnext> -Use snmp getnext function (even in snmp v2c and v3). +Use snmp getnext function in snmp v2c and v3. This will request one OID at a +time. + +=item B<--snmp-cache-file> + +Use SNMP cache file. =item B<--snmp-username> -Security name (only for SNMP v3). +SNMP v3 only: +User name (securityName). =item B<--authpassphrase> -Authentication protocol pass phrase. +SNMP v3 only: +Pass phrase hashed using the authentication protocol defined in the +--authprotocol option. =item B<--authprotocol> +SNMP v3 only: Authentication protocol: MD5|SHA. Since net-snmp 5.9.1: SHA224|SHA256|SHA384|SHA512. =item B<--privpassphrase> -Privacy protocol pass phrase +SNMP v3 only: +Privacy pass phrase (privPassword) to encrypt messages using the protocol +defined in the --privprotocol option. =item B<--privprotocol> -Privacy protocol: DES|AES. Since net-snmp 5.9.1: AES192|AES192C|AES256|AES256C. +SNMP v3 only: +Privacy protocol (privProtocol) used to encrypt messages. +Supported protocols are: DES|AES and since net-snmp 5.9.1: AES192|AES192C|AES256|AES256C. =item B<--contextname> -Context name +SNMP v3 only: +Context name (contextName), if relevant for the monitored host. =item B<--contextengineid> -Context engine ID +SNMP v3 only: +Context engine ID (contextEngineID), if relevant for the monitored host, given +as a hexadecimal string. =item B<--securityengineid> -Security engine ID +SNMP v3 only: +Security engine ID, given as a hexadecimal string. =item B<--snmp-errors-exit> -Exit code for SNMP Errors (default: unknown) +Expected status in case of SNMP error or timeout. +Possible values are warning, critical and unknown (default). =item B<--snmp-tls-transport> -TLS Transport communication used (can be: 'dtlsudp', 'tlstcp'). +Transport protocol for TLS communication (can be: 'dtlsudp', 'tlstcp'). =item B<--snmp-tls-our-identity> -Our X.509 identity to use, which should either be a fingerprint or the -filename that holds the certificate. +X.509 certificate to identify ourselves. Can be the path to the certificate file +or its contents. =item B<--snmp-tls-their-identity> -The remote server's identity to connect to, specified as either a -fingerprint or a file name. Either this must be specified, or the -hostname below along with a trust anchor. +X.509 certificate to identify the remote host. Can be the path to the +certificate file or its contents. This option is unnecessary if the certificate +is already trusted by your system. =item B<--snmp-tls-their-hostname> -The remote server's hostname that is expected. If their certificate -was signed by a CA then their hostname presented in the certificate -must match this value or the connection fails to be established (to -avoid man-in-the-middle attacks). +Common Name (CN) expected in the certificate sent by the host if it differs from +the value of the --hostname parameter. =item B<--snmp-tls-trust-cert> -A trusted certificate to use as trust anchor (like a CA certificate) -for verifying a remote server's certificate. If a CA certificate is -used to validate a certificate then the TheirHostname parameter must -also be specified to ensure their presented hostname in the certificate -matches. +A trusted CA certificate used to verify a remote host's certificate. +If you use this option, you must also define --snmp-tls-their-hostname. =back diff --git a/src/centreon/plugins/ssh.pm b/src/centreon/plugins/ssh.pm index f89f9a174..6e56f43ae 100644 --- a/src/centreon/plugins/ssh.pm +++ b/src/centreon/plugins/ssh.pm @@ -108,8 +108,8 @@ SSH abstraction layer for sscli, plink and libssh backends =item B<--ssh-backend> -Set the backend used (Default: 'sshcli') -Can be: sshcli, plink, libssh. +Define the backend you want to use. +It can be: sshcli (default), plink and libssh. =item B<--ssh-username> diff --git a/src/centreon/plugins/statefile.pm b/src/centreon/plugins/statefile.pm index 0cf02546b..a6b8ba2bc 100644 --- a/src/centreon/plugins/statefile.pm +++ b/src/centreon/plugins/statefile.pm @@ -459,7 +459,7 @@ Memcached server to use (only one server). =item B<--redis-server> -Redis server to use (only one server). SYntax: address[:port] +Redis server to use (only one server). Syntax: address[:port] =item B<--redis-attribute> diff --git a/src/cloud/aws/apigateway/mode/latency.pm b/src/cloud/aws/apigateway/mode/latency.pm index bb2381e3f..94495bb1e 100644 --- a/src/cloud/aws/apigateway/mode/latency.pm +++ b/src/cloud/aws/apigateway/mode/latency.pm @@ -181,7 +181,7 @@ Default statistic: 'sum' =item B<--api-name> -Set the API name (Required) (Can be multiple). +Set the API name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/apigateway/mode/requests.pm b/src/cloud/aws/apigateway/mode/requests.pm index 1c17bc89b..0a28163ad 100644 --- a/src/cloud/aws/apigateway/mode/requests.pm +++ b/src/cloud/aws/apigateway/mode/requests.pm @@ -182,7 +182,7 @@ Default statistic: 'sum' =item B<--api-name> -Set the api name (Required) (Can be multiple). +Set the api name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/billing/mode/estimatedcharges.pm b/src/cloud/aws/billing/mode/estimatedcharges.pm index 355ee80c5..57615ceb8 100644 --- a/src/cloud/aws/billing/mode/estimatedcharges.pm +++ b/src/cloud/aws/billing/mode/estimatedcharges.pm @@ -127,7 +127,7 @@ See 'https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/billing-metr =item B<--service> -Set the Amazon service (Required) (Can be multiple). +Set the Amazon service (Required) (can be defined multiple times). =item B<--warning-billing> diff --git a/src/cloud/aws/cloudfront/mode/errors.pm b/src/cloud/aws/cloudfront/mode/errors.pm index b8381af59..6f32fe4af 100644 --- a/src/cloud/aws/cloudfront/mode/errors.pm +++ b/src/cloud/aws/cloudfront/mode/errors.pm @@ -158,7 +158,7 @@ Default statistic: 'average' / Valid statistic: 'average'. =item B<--id> -Set the instance id (Required) (Can be multiple). +Set the instance id (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/cloudfront/mode/requests.pm b/src/cloud/aws/cloudfront/mode/requests.pm index 101c493e0..2b52a321d 100644 --- a/src/cloud/aws/cloudfront/mode/requests.pm +++ b/src/cloud/aws/cloudfront/mode/requests.pm @@ -154,7 +154,7 @@ Default statistic: 'sum' / Valid statistic: 'sum'. =item B<--id> -Set the instance id (Required) (Can be multiple). +Set the instance id (Required) (can be defined multiple times). =item B<--warning-requests> diff --git a/src/cloud/aws/cloudfront/mode/throughput.pm b/src/cloud/aws/cloudfront/mode/throughput.pm index 628e58708..5cb878a70 100644 --- a/src/cloud/aws/cloudfront/mode/throughput.pm +++ b/src/cloud/aws/cloudfront/mode/throughput.pm @@ -163,7 +163,7 @@ Default statistic: 'sum' / Valid statistic: 'sum'. =item B<--id> -Set the instance id (Required) (Can be multiple). +Set the instance id (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/cloudtrail/mode/checktrailstatus.pm b/src/cloud/aws/cloudtrail/mode/checktrailstatus.pm new file mode 100644 index 000000000..b360db747 --- /dev/null +++ b/src/cloud/aws/cloudtrail/mode/checktrailstatus.pm @@ -0,0 +1,84 @@ +# +# Copyright 2023 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 cloud::aws::cloudtrail::mode::checktrailstatus; + +use strict; +use warnings; + +use base qw(centreon::plugins::mode); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'trail-name:s' => { name => 'trail_name' } + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (!length($self->{option_results}->{trail_name})) { + $self->{output}->add_option_msg(short_msg => "Need to specify --trail-name option."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + + my $status = $options{custom}->cloudtrail_trail_status( + trail_name => $self->{option_results}->{trail_name} + ); + + $self->{output}->output_add(severity => $status->{IsLogging} ? "ok" : "critical", + short_msg => sprintf("Trail is logging: %s", $status->{IsLogging})); + $self->{output}->perfdata_add(label => "trail_is_logging", unit => '', + value => sprintf("%s", $status->{IsLogging} ), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0 + ); + + $self->{output}->display(); + $self->{output}->exit(); +} + + +1; + +=head1 MODE + +Check cloudtrail trail status. + +=over 8 + +=item B<--trail-name> + +Filter by trail name. + +=back + +=cut \ No newline at end of file diff --git a/src/cloud/aws/cloudtrail/mode/countevents.pm b/src/cloud/aws/cloudtrail/mode/countevents.pm new file mode 100644 index 000000000..bb9891348 --- /dev/null +++ b/src/cloud/aws/cloudtrail/mode/countevents.pm @@ -0,0 +1,126 @@ +# +# Copyright 2023 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 cloud::aws::cloudtrail::mode::countevents; + +use strict; +use warnings; + +use base qw(centreon::plugins::mode); + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'event-type:s' => { name => 'event_type' }, + 'error-message:s' => { name => 'error_message' }, + 'delta:s' => { name => 'delta' }, + 'warning-count:s' => { name => 'warning_count' }, + 'critical-count:s' => { name => 'critical_count' } + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); + + if (($self->{perfdata}->threshold_validate(label => 'warning-count', value => $self->{option_results}->{warning_count})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong warning-count threshold '" . $self->{option_results}->{warning_count} . "'."); + $self->{output}->option_exit(); + } + if (($self->{perfdata}->threshold_validate(label => 'critical-count', value => $self->{option_results}->{critical_count})) == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong critical-count threshold '" . $self->{option_results}->{critical_count} . "'."); + $self->{output}->option_exit(); + } +} + +sub run { + my ($self, %options) = @_; + + $self->{events} = $options{custom}->cloudtrail_events( + event_type => $self->{option_results}->{event_type}, + error_message => $self->{option_results}->{error_message}, + delta => $self->{option_results}->{delta} + ); + + my $count; + if (length($self->{option_results}->{event_type}) || length($self->{option_results}->{error_message})) { + $count = 0; + foreach my $event (@{$self->{events}}) { + if ((defined($self->{option_results}->{event_type}) && length($self->{option_results}->{event_type}) && ($event->{eventType} eq $self->{option_results}->{event_type})) + || (defined($self->{option_results}->{error_message}) && length($self->{option_results}->{error_message}) && ($event->{errorMessage} =~ $self->{option_results}->{error_message}))) { + $count++; + } + } + } else { + $count = scalar @{$self->{events}}; + } + + my $exit = $self->{perfdata}->threshold_check(value => $count, threshold => [ { label => 'critical-count', exit_litteral => 'critical' }, { label => 'warning-count', exit_litteral => 'warning' } ]); + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Number of events: %.2f", $count)); + $self->{output}->perfdata_add(label => "events_count", unit => '', + value => sprintf("%.2f", $count), + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0 + ); + + $self->{output}->display(); + $self->{output}->exit(); +} + +1; + +__END__ + +=head1 MODE + +Check cloudtrail events. + +=over 8 + +=item B<--event-type> + +Filter by event type. + +=item B<--error-message> + +Filter on an error message pattern + +=item B<--delta> + +Time depth for search (minutes). + +=item B<--warning-count> + +Set warning threshold for the number of events. + +=item B<--critical-count> + +Set critical threshold for the number of events. + +=back + +=cut diff --git a/src/cloud/aws/cloudtrail/plugin.pm b/src/cloud/aws/cloudtrail/plugin.pm new file mode 100644 index 000000000..4274dd1e3 --- /dev/null +++ b/src/cloud/aws/cloudtrail/plugin.pm @@ -0,0 +1,51 @@ +# +# Copyright 2023 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 cloud::aws::cloudtrail::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} = '0.1'; + %{ $self->{modes} } = ( + 'checktrailstatus' => 'cloud::aws::cloudtrail::mode::checktrailstatus', + 'countevents' => 'cloud::aws::cloudtrail::mode::countevents' + ); + + $self->{custom_modes}{paws} = 'cloud::aws::custom::paws'; + $self->{custom_modes}{awscli} = 'cloud::aws::custom::awscli'; + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Amazon CloudTrail. + +=cut diff --git a/src/cloud/aws/cloudwatch/mode/getalarms.pm b/src/cloud/aws/cloudwatch/mode/getalarms.pm index b72cd2f5d..af5ee4af8 100644 --- a/src/cloud/aws/cloudwatch/mode/getalarms.pm +++ b/src/cloud/aws/cloudwatch/mode/getalarms.pm @@ -164,12 +164,12 @@ Filter by alarm name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{state_value} =~ /INSUFFICIENT_DATA/i') -Can used special variables like: %{alarm_name}, %{state_value}, %{metric_name}, %{last_update} +You can use the following variables: %{alarm_name}, %{state_value}, %{metric_name}, %{last_update} =item B<--critical-status> Set critical threshold for status (Default: '%{state_value} =~ /ALARM/i'). -Can used special variables like: %{alarm_name}, %{state_value}, %{metric_name}, %{last_update} +You can use the following variables: %{alarm_name}, %{state_value}, %{metric_name}, %{last_update} =item B<--memory> diff --git a/src/cloud/aws/cloudwatchlogs/mode/getlogs.pm b/src/cloud/aws/cloudwatchlogs/mode/getlogs.pm index c53b28ffe..e9b69a1b0 100644 --- a/src/cloud/aws/cloudwatchlogs/mode/getlogs.pm +++ b/src/cloud/aws/cloudwatchlogs/mode/getlogs.pm @@ -175,17 +175,17 @@ If not set: lookup logs since the last execution. =item B<--unknown-status> Set unknown threshold for status (Default: '') -Can used special variables like: %{message}, %{stream_name}, %{since} +You can use the following variables: %{message}, %{stream_name}, %{since} =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{message}, %{stream_name}, %{since} +You can use the following variables: %{message}, %{stream_name}, %{since} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{message}, %{stream_name}, %{since} +You can use the following variables: %{message}, %{stream_name}, %{since} =back diff --git a/src/cloud/aws/custom/awscli.pm b/src/cloud/aws/custom/awscli.pm index 00559678e..2843e5d27 100644 --- a/src/cloud/aws/custom/awscli.pm +++ b/src/cloud/aws/custom/awscli.pm @@ -976,6 +976,80 @@ sub directconnect_describe_virtual_interfaces { return $results; } +sub cloudtrail_events_set_cmd { + my ($self, %options) = @_; + + return if (defined($self->{option_results}->{command_options}) && $self->{option_results}->{command_options} ne ''); + + my $cmd_options = "lookup-events --region $self->{option_results}->{region} --output json"; + if (defined($options{delta})) { + my $endtime = time(); + my $starttime = $endtime - ($options{delta} * 60); + $cmd_options .= " --start-time $starttime"; + $cmd_options .= " --end-time $endtime"; + } + $cmd_options .= " --starting-token $options{next_token}" if (length($options{next_token})); + $cmd_options .= " --endpoint-url $self->{endpoint_url}" if (length($self->{endpoint_url})); + $cmd_options .= " --no-verify-ssl 2>/dev/null" if (length($self->{option_results}->{skip_ssl_check})); + + return $cmd_options; +} + +sub cloudtrail_events { + my ($self, %options) = @_; + + my $cmd_options = $self->cloudtrail_events_set_cmd(%options); + + my $events_results = []; + eval { + while (my $list_events = $self->execute(cmd_options => $cmd_options)) { + foreach (@{$list_events->{Events}}) { + my $event = JSON::XS->new->utf8->decode($_->{CloudTrailEvent}); + push @{$events_results}, { + eventID => $event->{eventID}, + eventType => $event->{eventType}, + errorMessage => $event->{errorMessage} + }; + } + + last if (!defined($list_events->{NextToken})); + $options{next_token} = $list_events->{NextToken}; + } + }; + + return $events_results; +} + +sub cloudtrail_trail_status_set_cmd { + my ($self, %options) = @_; + + return if (defined($self->{option_results}->{command_options}) && $self->{option_results}->{command_options} ne ''); + + my $cmd_options = "get-trail-status --region $self->{option_results}->{region} --output json"; + $cmd_options .= " --name $options{trail_name}"; + $cmd_options .= " --endpoint-url $self->{endpoint_url}" if (length($self->{endpoint_url})); + $cmd_options .= " --no-verify-ssl 2>/dev/null" if (length($self->{option_results}->{skip_ssl_check})); + + return $cmd_options; +} + +sub cloudtrail_trail_status { + my ($self, %options) = @_; + + my $cmd_options = $self->cloudtrail_trail_status_set_cmd(%options); + + my $trail_status; + eval { + $trail_status = $self->execute(cmd_options => $cmd_options); + }; + if ($@) { + $self->{output}->add_option_msg(short_msg => "error: $@"); + $self->{output}->option_exit(); + } + + return $trail_status; +} + 1; __END__ @@ -1032,7 +1106,7 @@ Set cloudwatch statistics (Can be: 'minimum', 'maximum', 'average', 'sum'). =item B<--zeroed> -Set metrics value to 0 if none. Usefull when CloudWatch +Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. =item B<--timeout> diff --git a/src/cloud/aws/custom/paws.pm b/src/cloud/aws/custom/paws.pm index c9fe895a8..e4cca26be 100644 --- a/src/cloud/aws/custom/paws.pm +++ b/src/cloud/aws/custom/paws.pm @@ -50,7 +50,8 @@ sub new { 'period:s' => { name => 'period' }, 'statistic:s@' => { name => 'statistic' }, 'zeroed' => { name => 'zeroed' }, - 'proxyurl:s' => { name => 'proxyurl' } + 'proxyurl:s' => { name => 'proxyurl' }, + 'endpoint:s' => { name => 'endpoint' } }); } $options{options}->add_help(package => __PACKAGE__, sections => 'PAWS OPTIONS', once => 1); @@ -839,6 +840,68 @@ sub directconnect_describe_virtual_interfaces { return $results; } +sub cloudtrail_events { + my ($self, %options) = @_; + + my $events_results = []; + eval { + my $ct; + if (defined($self->{option_results}->{endpoint}) && length $self->{option_results}->{endpoint}) { + $ct = $self->{paws}->service('CloudTrail', region => $self->{option_results}->{region} , endpoint => $self->{option_results}->{endpoint}); + } else { + $ct = $self->{paws}->service('CloudTrail', region => $self->{option_results}->{region}); + } + my %ct_options = (); + if (defined($options{delta})) { + $ct_options{EndTime} = time(); + $ct_options{StartTime} = $ct_options{EndTime} - ($options{delta} * 60); + } + + while (my $list_events = $ct->LookupEvents(%ct_options)) { + foreach (@{$list_events->{Events}}) { + my $event = JSON::XS->new->utf8->decode($_->{CloudTrailEvent}); + push @{$events_results}, { + eventID => $event->{eventID}, + eventType => $event->{eventType}, + errorMessage => $event->{errorMessage} + }; + } + + last if (!defined($list_events->{NextToken})); + $ct_options{NextToken} = $list_events->{NextToken}; + } + }; + if ($@) { + $self->{output}->add_option_msg(short_msg => "error: $@"); + $self->{output}->option_exit(); + } + + return $events_results; +} + +sub cloudtrail_trail_status { + my ($self, %options) = @_; + + my $trail_status; + eval { + my $ct; + if (defined($self->{option_results}->{endpoint}) && length $self->{option_results}->{endpoint}) { + $ct = $self->{paws}->service('CloudTrail', region => $self->{option_results}->{region} , endpoint => $self->{option_results}->{endpoint}); + } else { + $ct = $self->{paws}->service('CloudTrail', region => $self->{option_results}->{region}); + } + my %ct_options = (); + $ct_options{Name} = $options{trail_name}; + $trail_status = $ct->GetTrailStatus(%ct_options); + }; + if ($@) { + $self->{output}->add_option_msg(short_msg => "error: $@"); + $self->{output}->option_exit(); + } + + return $trail_status; +} + 1; __END__ @@ -890,7 +953,7 @@ Set cloudwatch statistics =item B<--zeroed> -Set metrics value to 0 if none. Usefull when CloudWatch +Set metrics value to 0 if none. Useful when CloudWatch does not return value when not defined. =item B<--proxyurl> diff --git a/src/cloud/aws/directconnect/mode/connections.pm b/src/cloud/aws/directconnect/mode/connections.pm index f11d23263..992581d71 100644 --- a/src/cloud/aws/directconnect/mode/connections.pm +++ b/src/cloud/aws/directconnect/mode/connections.pm @@ -230,12 +230,12 @@ Filter metrics (Can be: 'ConnectionBpsEgress', 'ConnectionBpsIngress', =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{bandwidth}, %{connectionName} +You can use the following variables: %{state}, %{bandwidth}, %{connectionName} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{bandwidth}, %{connectionName} +You can use the following variables: %{state}, %{bandwidth}, %{connectionName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/aws/directconnect/mode/virtualinterfaces.pm b/src/cloud/aws/directconnect/mode/virtualinterfaces.pm index e616440c8..b7e0ef6d0 100644 --- a/src/cloud/aws/directconnect/mode/virtualinterfaces.pm +++ b/src/cloud/aws/directconnect/mode/virtualinterfaces.pm @@ -227,12 +227,12 @@ Filter metrics (Can be: 'VirtualInterfaceBpsEgress', 'VirtualInterfaceBpsIngress =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{vlan}, %{type}, %{virtualInterfaceId} +You can use the following variables: %{state}, %{vlan}, %{type}, %{virtualInterfaceId} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{vlan}, %{type}, %{virtualInterfaceId} +You can use the following variables: %{state}, %{vlan}, %{type}, %{virtualInterfaceId} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/aws/ec2/mode/cpu.pm b/src/cloud/aws/ec2/mode/cpu.pm index 909a05fb6..46d037b63 100644 --- a/src/cloud/aws/ec2/mode/cpu.pm +++ b/src/cloud/aws/ec2/mode/cpu.pm @@ -196,7 +196,7 @@ Set the instance type (Required) (Can be: 'asg', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/ec2/mode/diskio.pm b/src/cloud/aws/ec2/mode/diskio.pm index 793db8466..6f9a4062d 100644 --- a/src/cloud/aws/ec2/mode/diskio.pm +++ b/src/cloud/aws/ec2/mode/diskio.pm @@ -237,7 +237,7 @@ Set the instance type (Required) (Can be: 'asg', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--add-ebs-metrics> diff --git a/src/cloud/aws/ec2/mode/instancesstatus.pm b/src/cloud/aws/ec2/mode/instancesstatus.pm index d92413d97..3fb5f85fb 100644 --- a/src/cloud/aws/ec2/mode/instancesstatus.pm +++ b/src/cloud/aws/ec2/mode/instancesstatus.pm @@ -279,12 +279,12 @@ Select the unit for uptime threshold. May be 's' for seconds, 'm' for minutes, =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/aws/ec2/mode/network.pm b/src/cloud/aws/ec2/mode/network.pm index aafd32850..ee333032d 100644 --- a/src/cloud/aws/ec2/mode/network.pm +++ b/src/cloud/aws/ec2/mode/network.pm @@ -191,7 +191,7 @@ Set the instance type (Required) (Can be: 'asg', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/ec2/mode/status.pm b/src/cloud/aws/ec2/mode/status.pm index fcbf4e15b..6faa40b3f 100644 --- a/src/cloud/aws/ec2/mode/status.pm +++ b/src/cloud/aws/ec2/mode/status.pm @@ -196,18 +196,18 @@ Set the instance type (Required) (Can be: 'asg', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}. +You can use the following variables: %{status}. 'status' can be: 'passed', 'failed'. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. 'status' can be: 'passed', 'failed'. =back diff --git a/src/cloud/aws/efs/mode/connections.pm b/src/cloud/aws/efs/mode/connections.pm index 3ab667e11..351d7b36f 100644 --- a/src/cloud/aws/efs/mode/connections.pm +++ b/src/cloud/aws/efs/mode/connections.pm @@ -139,7 +139,7 @@ See 'https://docs.aws.amazon.com/efs/latest/ug/monitoring-cloudwatch.html' for m =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--warning-client-connections> diff --git a/src/cloud/aws/efs/mode/datausage.pm b/src/cloud/aws/efs/mode/datausage.pm index bd98eb2ac..9739acc0b 100644 --- a/src/cloud/aws/efs/mode/datausage.pm +++ b/src/cloud/aws/efs/mode/datausage.pm @@ -172,7 +172,7 @@ See 'https://docs.aws.amazon.com/efs/latest/ug/monitoring-cloudwatch.html' for m =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/elasticache/mode/commandsmemcached.pm b/src/cloud/aws/elasticache/mode/commandsmemcached.pm index a0c477a15..1a3dd3a27 100644 --- a/src/cloud/aws/elasticache/mode/commandsmemcached.pm +++ b/src/cloud/aws/elasticache/mode/commandsmemcached.pm @@ -215,7 +215,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/commandsredis.pm b/src/cloud/aws/elasticache/mode/commandsredis.pm index 441d9364f..5fb325a12 100644 --- a/src/cloud/aws/elasticache/mode/commandsredis.pm +++ b/src/cloud/aws/elasticache/mode/commandsredis.pm @@ -217,7 +217,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/connections.pm b/src/cloud/aws/elasticache/mode/connections.pm index 3ada8f825..29e982b41 100644 --- a/src/cloud/aws/elasticache/mode/connections.pm +++ b/src/cloud/aws/elasticache/mode/connections.pm @@ -228,7 +228,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/cpu.pm b/src/cloud/aws/elasticache/mode/cpu.pm index 4624b184e..c26bdd5b7 100644 --- a/src/cloud/aws/elasticache/mode/cpu.pm +++ b/src/cloud/aws/elasticache/mode/cpu.pm @@ -161,7 +161,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/evictions.pm b/src/cloud/aws/elasticache/mode/evictions.pm index a07b36f29..52169f39c 100644 --- a/src/cloud/aws/elasticache/mode/evictions.pm +++ b/src/cloud/aws/elasticache/mode/evictions.pm @@ -216,7 +216,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/items.pm b/src/cloud/aws/elasticache/mode/items.pm index 261521ea1..1ee4bae8f 100644 --- a/src/cloud/aws/elasticache/mode/items.pm +++ b/src/cloud/aws/elasticache/mode/items.pm @@ -228,7 +228,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/network.pm b/src/cloud/aws/elasticache/mode/network.pm index 3589d95ea..fa2451630 100644 --- a/src/cloud/aws/elasticache/mode/network.pm +++ b/src/cloud/aws/elasticache/mode/network.pm @@ -218,7 +218,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/replication.pm b/src/cloud/aws/elasticache/mode/replication.pm index 8ec210c91..4cec454e0 100644 --- a/src/cloud/aws/elasticache/mode/replication.pm +++ b/src/cloud/aws/elasticache/mode/replication.pm @@ -233,7 +233,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/requestsmemcached.pm b/src/cloud/aws/elasticache/mode/requestsmemcached.pm index f9fe5a300..030cdc7c4 100644 --- a/src/cloud/aws/elasticache/mode/requestsmemcached.pm +++ b/src/cloud/aws/elasticache/mode/requestsmemcached.pm @@ -216,7 +216,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/requestsredis.pm b/src/cloud/aws/elasticache/mode/requestsredis.pm index 4545b5f14..eeb4f2e20 100644 --- a/src/cloud/aws/elasticache/mode/requestsredis.pm +++ b/src/cloud/aws/elasticache/mode/requestsredis.pm @@ -214,7 +214,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/usagememcached.pm b/src/cloud/aws/elasticache/mode/usagememcached.pm index 586960f3f..e8172be66 100644 --- a/src/cloud/aws/elasticache/mode/usagememcached.pm +++ b/src/cloud/aws/elasticache/mode/usagememcached.pm @@ -167,7 +167,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elasticache/mode/usageredis.pm b/src/cloud/aws/elasticache/mode/usageredis.pm index c0ae8767f..ca305aeb3 100644 --- a/src/cloud/aws/elasticache/mode/usageredis.pm +++ b/src/cloud/aws/elasticache/mode/usageredis.pm @@ -167,7 +167,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the cluster name (Required) (Can be multiple). +Set the cluster name (Required) (can be defined multiple times). =item B<--node-id> diff --git a/src/cloud/aws/elb/application/mode/connections.pm b/src/cloud/aws/elb/application/mode/connections.pm index 280c0c00f..488806b9d 100644 --- a/src/cloud/aws/elb/application/mode/connections.pm +++ b/src/cloud/aws/elb/application/mode/connections.pm @@ -211,13 +211,13 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::application::plugin --customm See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html' for more informations. -Default statistic: 'sum' / Most usefull statistics: 'sum'. +Default statistic: 'sum' / Most useful statistics: 'sum'. =over 8 =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/elb/application/mode/httpcodes.pm b/src/cloud/aws/elb/application/mode/httpcodes.pm index 33cee5688..e7bc15568 100644 --- a/src/cloud/aws/elb/application/mode/httpcodes.pm +++ b/src/cloud/aws/elb/application/mode/httpcodes.pm @@ -225,13 +225,13 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::application::plugin --customm See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html' for more informations. -Default statistic: 'sum' / Most usefull statistics: 'sum'. +Default statistic: 'sum' / Most useful statistics: 'sum'. =over 8 =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/elb/application/mode/targetshealth.pm b/src/cloud/aws/elb/application/mode/targetshealth.pm index 6c738bd65..f8554dfdd 100644 --- a/src/cloud/aws/elb/application/mode/targetshealth.pm +++ b/src/cloud/aws/elb/application/mode/targetshealth.pm @@ -205,13 +205,13 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::application::plugin --customm See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html' for more informations. -Default statistic: 'average' / Most usefull statistics: 'average', 'minimum', 'maximum'. +Default statistic: 'average' / Most useful statistics: 'average', 'minimum', 'maximum'. =over 8 =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/elb/classic/mode/httpcodes.pm b/src/cloud/aws/elb/classic/mode/httpcodes.pm index 5c407ce08..769688a6b 100644 --- a/src/cloud/aws/elb/classic/mode/httpcodes.pm +++ b/src/cloud/aws/elb/classic/mode/httpcodes.pm @@ -241,7 +241,7 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::classic::plugin --custommode= See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-cloudwatch-metrics.html' for more informations. -Default statistic: 'sum' / Most usefull statistics: 'sum'. +Default statistic: 'sum' / Most useful statistics: 'sum'. =over 8 @@ -251,7 +251,7 @@ Set the instance type (Required) (Can be: 'loadbalancer', 'availabilityzone'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/elb/classic/mode/performances.pm b/src/cloud/aws/elb/classic/mode/performances.pm index cb31708cc..84b42b09a 100644 --- a/src/cloud/aws/elb/classic/mode/performances.pm +++ b/src/cloud/aws/elb/classic/mode/performances.pm @@ -216,7 +216,7 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::classic::plugin --custommode= See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-cloudwatch-metrics.html' for more informations. -Default statistic: 'sum', 'average' / Most usefull statistics: RequestCount: 'sum', Latency: 'average'. +Default statistic: 'sum', 'average' / Most useful statistics: RequestCount: 'sum', Latency: 'average'. =over 8 @@ -226,7 +226,7 @@ Set the instance type (Required) (Can be: 'loadbalancer', 'availabilityzone'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/elb/classic/mode/queues.pm b/src/cloud/aws/elb/classic/mode/queues.pm index 4b96b058d..da61418ee 100644 --- a/src/cloud/aws/elb/classic/mode/queues.pm +++ b/src/cloud/aws/elb/classic/mode/queues.pm @@ -217,7 +217,7 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::classic::plugin --custommode= See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-cloudwatch-metrics.html' for more informations. -Default statistic: 'sum', 'maximum' / Most usefull statistics: SpilloverCount: 'sum', SurgeQueueLength: 'maximum'. +Default statistic: 'sum', 'maximum' / Most useful statistics: SpilloverCount: 'sum', SurgeQueueLength: 'maximum'. =over 8 @@ -227,7 +227,7 @@ Set the instance type (Required) (Can be: 'loadbalancer', 'availabilityzone'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/elb/classic/mode/targetshealth.pm b/src/cloud/aws/elb/classic/mode/targetshealth.pm index 40acc6e81..f3eb6f87f 100644 --- a/src/cloud/aws/elb/classic/mode/targetshealth.pm +++ b/src/cloud/aws/elb/classic/mode/targetshealth.pm @@ -217,7 +217,7 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::classic::plugin --custommode= See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-cloudwatch-metrics.html' for more informations. -Default statistic: 'average' / Most usefull statistics: 'average', 'minimum', 'maximum'. +Default statistic: 'average' / Most useful statistics: 'average', 'minimum', 'maximum'. =over 8 @@ -227,7 +227,7 @@ Set the instance type (Required) (Can be: 'loadbalancer', 'availabilityzone'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/elb/network/mode/targetshealth.pm b/src/cloud/aws/elb/network/mode/targetshealth.pm index b572ed353..3e55d7243 100644 --- a/src/cloud/aws/elb/network/mode/targetshealth.pm +++ b/src/cloud/aws/elb/network/mode/targetshealth.pm @@ -201,13 +201,13 @@ perl centreon_plugins.pl --plugin=cloud::aws::elb::network::plugin --custommode= See 'https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-cloudwatch-metrics.html' for more informations. -Default statistic: 'average' / Most usefull statistics: 'average', 'minimum', 'maximum'. +Default statistic: 'average' / Most useful statistics: 'average', 'minimum', 'maximum'. =over 8 =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--availability-zone> diff --git a/src/cloud/aws/fsx/mode/datausage.pm b/src/cloud/aws/fsx/mode/datausage.pm index a7ed176a1..ec5561e8a 100644 --- a/src/cloud/aws/fsx/mode/datausage.pm +++ b/src/cloud/aws/fsx/mode/datausage.pm @@ -171,7 +171,7 @@ See 'https://docs.aws.amazon.com/efs/latest/ug/efs-metrics.html' for more inform =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/fsx/mode/freespace.pm b/src/cloud/aws/fsx/mode/freespace.pm index a9a8872e3..77f2c565a 100644 --- a/src/cloud/aws/fsx/mode/freespace.pm +++ b/src/cloud/aws/fsx/mode/freespace.pm @@ -131,7 +131,7 @@ See 'https://docs.aws.amazon.com/efs/latest/ug/efs-metrics.html' for more inform =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--statistic> diff --git a/src/cloud/aws/kinesis/mode/recordsstats.pm b/src/cloud/aws/kinesis/mode/recordsstats.pm index 3f4b2b900..527fdbbeb 100644 --- a/src/cloud/aws/kinesis/mode/recordsstats.pm +++ b/src/cloud/aws/kinesis/mode/recordsstats.pm @@ -221,7 +221,7 @@ Check metrics about records statistics in Kinesis streams. =item B<--name> -Set the stream name (Required) (Can be multiple). +Set the stream name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/kinesis/mode/streams.pm b/src/cloud/aws/kinesis/mode/streams.pm index 9ebc43548..7cfc0cd11 100644 --- a/src/cloud/aws/kinesis/mode/streams.pm +++ b/src/cloud/aws/kinesis/mode/streams.pm @@ -198,7 +198,7 @@ note: Outgoing* metrics are only available when enhanced stats are enabled (paid =item B<--stream-name> -Set the stream name (Required) (Can be multiple). +Set the stream name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/lambda/mode/invocations.pm b/src/cloud/aws/lambda/mode/invocations.pm index b71e7d06b..30c62ff03 100644 --- a/src/cloud/aws/lambda/mode/invocations.pm +++ b/src/cloud/aws/lambda/mode/invocations.pm @@ -206,7 +206,7 @@ Default statistic: 'sum', 'average'. =item B<--name> -Set the function name (Required) (Can be multiple). +Set the function name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/connections.pm b/src/cloud/aws/rds/mode/connections.pm index 97a775151..284a62c0d 100644 --- a/src/cloud/aws/rds/mode/connections.pm +++ b/src/cloud/aws/rds/mode/connections.pm @@ -179,7 +179,7 @@ Set the instance type (Required) (Can be: 'cluster', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/cpu.pm b/src/cloud/aws/rds/mode/cpu.pm index ad9e0c74c..04aafcafe 100644 --- a/src/cloud/aws/rds/mode/cpu.pm +++ b/src/cloud/aws/rds/mode/cpu.pm @@ -191,7 +191,7 @@ Set the instance type (Required) (Can be: 'cluster', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/diskio.pm b/src/cloud/aws/rds/mode/diskio.pm index b17a7a889..58a7ad358 100644 --- a/src/cloud/aws/rds/mode/diskio.pm +++ b/src/cloud/aws/rds/mode/diskio.pm @@ -217,7 +217,7 @@ Set the instance type (Required) (Can be: 'cluster', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/instancestatus.pm b/src/cloud/aws/rds/mode/instancestatus.pm index 68cf4659c..6e69bb98f 100644 --- a/src/cloud/aws/rds/mode/instancestatus.pm +++ b/src/cloud/aws/rds/mode/instancestatus.pm @@ -196,12 +196,12 @@ Filter by instance id (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-*> diff --git a/src/cloud/aws/rds/mode/network.pm b/src/cloud/aws/rds/mode/network.pm index fae464a34..86ad76d47 100644 --- a/src/cloud/aws/rds/mode/network.pm +++ b/src/cloud/aws/rds/mode/network.pm @@ -179,7 +179,7 @@ Set the instance type (Required) (Can be: 'cluster', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/queries.pm b/src/cloud/aws/rds/mode/queries.pm index 6dce2f2ef..98be95b92 100644 --- a/src/cloud/aws/rds/mode/queries.pm +++ b/src/cloud/aws/rds/mode/queries.pm @@ -193,7 +193,7 @@ Set the instance type (Required) (Can be: 'cluster', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/storage.pm b/src/cloud/aws/rds/mode/storage.pm index bc4df4c24..48c1dc9c1 100644 --- a/src/cloud/aws/rds/mode/storage.pm +++ b/src/cloud/aws/rds/mode/storage.pm @@ -345,7 +345,7 @@ Set the instance type (Required) (Can be: 'cluster', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/transactions.pm b/src/cloud/aws/rds/mode/transactions.pm index d4827672a..43edc7e71 100644 --- a/src/cloud/aws/rds/mode/transactions.pm +++ b/src/cloud/aws/rds/mode/transactions.pm @@ -191,7 +191,7 @@ Set the instance type (Required) (Can be: 'cluster', 'instance'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/rds/mode/volume.pm b/src/cloud/aws/rds/mode/volume.pm index 7770e5533..9b7f2544c 100644 --- a/src/cloud/aws/rds/mode/volume.pm +++ b/src/cloud/aws/rds/mode/volume.pm @@ -241,7 +241,7 @@ Set the instance type (Required) (Can be: 'cluster'). =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/s3/mode/bucketsize.pm b/src/cloud/aws/s3/mode/bucketsize.pm index b12aa93bc..119772f03 100644 --- a/src/cloud/aws/s3/mode/bucketsize.pm +++ b/src/cloud/aws/s3/mode/bucketsize.pm @@ -172,12 +172,12 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--storage-type> Set the storage type of the bucket (Default: 'StandardStorage') -(Can be multiple: 'StandardStorage', 'StandardIAStorage', 'ReducedRedundancyStorage'). +((can be defined multiple times): 'StandardStorage', 'StandardIAStorage', 'ReducedRedundancyStorage'). =item B<--warning-$metric$-$storagetype$-$statistic$> diff --git a/src/cloud/aws/s3/mode/objects.pm b/src/cloud/aws/s3/mode/objects.pm index 79ebd2a20..d90c8c562 100644 --- a/src/cloud/aws/s3/mode/objects.pm +++ b/src/cloud/aws/s3/mode/objects.pm @@ -155,7 +155,7 @@ Default statistic: 'average' / All satistics are valid. =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--warning-$metric$-$statistic$> diff --git a/src/cloud/aws/s3/mode/requests.pm b/src/cloud/aws/s3/mode/requests.pm index 5d892e63a..2aa901f27 100644 --- a/src/cloud/aws/s3/mode/requests.pm +++ b/src/cloud/aws/s3/mode/requests.pm @@ -147,7 +147,7 @@ Default statistic: 'sum' / Valid statistics: 'sum'. =item B<--name> -Set the instance name (Required) (Can be multiple). +Set the instance name (Required) (can be defined multiple times). =item B<--filter-metric> diff --git a/src/cloud/aws/ses/mode/emails.pm b/src/cloud/aws/ses/mode/emails.pm index 3ce6cc990..6bb7d6eea 100644 --- a/src/cloud/aws/ses/mode/emails.pm +++ b/src/cloud/aws/ses/mode/emails.pm @@ -229,7 +229,7 @@ See 'https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activ =item B<--dimension> -Set SES dimensions (Can be multiple). Syntax: +Set SES dimensions (can be defined multiple times). Syntax: --dimension='DimensionName1=Value1' --dimension='DimensionName2=Value2'. =item B<--warning-emails-*> diff --git a/src/cloud/azure/analytics/eventhubs/mode/health.pm b/src/cloud/azure/analytics/eventhubs/mode/health.pm index 913f9a795..ed152061c 100644 --- a/src/cloud/azure/analytics/eventhubs/mode/health.pm +++ b/src/cloud/azure/analytics/eventhubs/mode/health.pm @@ -54,22 +54,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/common/storageaccount/health.pm b/src/cloud/azure/common/storageaccount/health.pm index d7a14f184..854224b15 100644 --- a/src/cloud/azure/common/storageaccount/health.pm +++ b/src/cloud/azure/common/storageaccount/health.pm @@ -54,7 +54,7 @@ __END__ Check Storage Account health status. -(Usefull to determine host status) +(Useful to determine host status) =over 8 @@ -74,22 +74,22 @@ Default: 'Microsoft.Storage'. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/compute/aks/mode/health.pm b/src/cloud/azure/compute/aks/mode/health.pm index 1b193616d..8c8c2918f 100644 --- a/src/cloud/azure/compute/aks/mode/health.pm +++ b/src/cloud/azure/compute/aks/mode/health.pm @@ -40,7 +40,7 @@ __END__ =head1 MODE Check Azure Kubernetes Cluster health status. -(Usefull to determine host status) +(Useful to determine host status) =over 8 @@ -56,25 +56,25 @@ Set resource group (Required if resource's name is used). Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/compute/virtualmachine/mode/health.pm b/src/cloud/azure/compute/virtualmachine/mode/health.pm index 8156348bf..300e26465 100644 --- a/src/cloud/azure/compute/virtualmachine/mode/health.pm +++ b/src/cloud/azure/compute/virtualmachine/mode/health.pm @@ -41,7 +41,7 @@ __END__ Check Virtual Machine health status. -(Usefull to determine host status) +(Useful to determine host status) =over 8 @@ -56,22 +56,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/compute/vmscalesets/mode/health.pm b/src/cloud/azure/compute/vmscalesets/mode/health.pm index a2dfb2605..3f2faa29a 100644 --- a/src/cloud/azure/compute/vmscalesets/mode/health.pm +++ b/src/cloud/azure/compute/vmscalesets/mode/health.pm @@ -40,7 +40,7 @@ __END__ =head1 MODE Check Azure Virtual Machine Scale Sets Health. -(Usefull to determine host status) +(Useful to determine host status) =over 8 @@ -56,25 +56,25 @@ Set resource group (Required if resource's name is used). Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/custom/api.pm b/src/cloud/azure/custom/api.pm index c40569e82..328a70e63 100644 --- a/src/cloud/azure/custom/api.pm +++ b/src/cloud/azure/custom/api.pm @@ -1255,13 +1255,13 @@ Microsoft Azure Rest API To connect to the Azure Rest API, you must register an application. -Follow the 'How-to guide' in https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal +Follow the 'How-to guide' at https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal The application needs the 'Monitoring Reader' role (See https://docs.microsoft.com/en-us/azure/azure-monitor/platform/roles-permissions-security#monitoring-reader). This custom mode is using the 'OAuth 2.0 Client Credentials Grant Flow' -For futher informations, visit https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow +For further informations, visit https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow =over 8 @@ -1299,12 +1299,14 @@ Set interval of the metric query (Can be : PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total', 'count'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--zeroed> -Set metrics value to 0 if none. Usefull when Monitor -does not return value when not defined. +Set metrics value to 0 if they are missing. Useful when some metrics are +undefined. =item B<--timeout> diff --git a/src/cloud/azure/custom/azcli.pm b/src/cloud/azure/custom/azcli.pm index 3ca8bc9da..494c3e8fb 100644 --- a/src/cloud/azure/custom/azcli.pm +++ b/src/cloud/azure/custom/azcli.pm @@ -646,12 +646,14 @@ Set interval of the metric query (Can be : PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total', 'count'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--zeroed> -Set metrics value to 0 if none. Usefull when Monitor -does not return value when not defined. +Set metrics value to 0 if they are missing. Useful when some metrics are +undefined. =item B<--timeout> diff --git a/src/cloud/azure/database/cosmosdb/mode/health.pm b/src/cloud/azure/database/cosmosdb/mode/health.pm index 9c5e53f5f..dc5513d8a 100644 --- a/src/cloud/azure/database/cosmosdb/mode/health.pm +++ b/src/cloud/azure/database/cosmosdb/mode/health.pm @@ -54,22 +54,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/database/redis/mode/health.pm b/src/cloud/azure/database/redis/mode/health.pm index ee9f85dff..7efb5b970 100644 --- a/src/cloud/azure/database/redis/mode/health.pm +++ b/src/cloud/azure/database/redis/mode/health.pm @@ -54,22 +54,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/database/sqldatabase/mode/health.pm b/src/cloud/azure/database/sqldatabase/mode/health.pm index eac17463e..51c386f81 100644 --- a/src/cloud/azure/database/sqldatabase/mode/health.pm +++ b/src/cloud/azure/database/sqldatabase/mode/health.pm @@ -56,25 +56,25 @@ Set resource group (Required if resource's name is used). Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/database/sqlserver/mode/serverstatus.pm b/src/cloud/azure/database/sqlserver/mode/serverstatus.pm index 88cd08f2b..42c357ccc 100644 --- a/src/cloud/azure/database/sqlserver/mode/serverstatus.pm +++ b/src/cloud/azure/database/sqlserver/mode/serverstatus.pm @@ -127,12 +127,12 @@ Filter server name (Can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{fqdn}, %{display} +You can use the following variables: %{state}, %{fqdn}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} ne "Ready"'). -Can used special variables like: %{state}, %{fqdn}, %{display} +You can use the following variables: %{state}, %{fqdn}, %{display} =back diff --git a/src/cloud/azure/integration/eventgrid/mode/health.pm b/src/cloud/azure/integration/eventgrid/mode/health.pm index 2e1e8f6f7..9fab26528 100644 --- a/src/cloud/azure/integration/eventgrid/mode/health.pm +++ b/src/cloud/azure/integration/eventgrid/mode/health.pm @@ -56,22 +56,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/integration/servicebus/mode/health.pm b/src/cloud/azure/integration/servicebus/mode/health.pm index ec1685d72..1591d3e6c 100644 --- a/src/cloud/azure/integration/servicebus/mode/health.pm +++ b/src/cloud/azure/integration/servicebus/mode/health.pm @@ -41,7 +41,7 @@ __END__ Check Service Bus namespace status. -(Usefull to determine host status) +(Useful to determine host status) =over 8 @@ -56,22 +56,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/management/monitor/mode/getmetrics.pm b/src/cloud/azure/management/monitor/mode/getmetrics.pm index 987f563dd..f58b574ce 100644 --- a/src/cloud/azure/management/monitor/mode/getmetrics.pm +++ b/src/cloud/azure/management/monitor/mode/getmetrics.pm @@ -233,7 +233,7 @@ Set resource type (Required if resource's name is used). =item B<--metric> -Set monitor metrics (Required) (Can be multiple). +Set monitor metrics (Required) (can be defined multiple times). =item B<--metric-namespace> diff --git a/src/cloud/azure/management/monitor/mode/health.pm b/src/cloud/azure/management/monitor/mode/health.pm index 22438360b..62c86d3a4 100644 --- a/src/cloud/azure/management/monitor/mode/health.pm +++ b/src/cloud/azure/management/monitor/mode/health.pm @@ -131,7 +131,7 @@ __END__ =head1 MODE -Check resource health status. Usefull to determine host status (ie UP/DOWN). +Check resource health status. Useful to determine host status (ie UP/DOWN). =over 8 diff --git a/src/cloud/azure/management/recovery/mode/backupitemsstatus.pm b/src/cloud/azure/management/recovery/mode/backupitemsstatus.pm index 6bf84a87b..4c5fbaa63 100644 --- a/src/cloud/azure/management/recovery/mode/backupitemsstatus.pm +++ b/src/cloud/azure/management/recovery/mode/backupitemsstatus.pm @@ -202,12 +202,12 @@ Example: --filter-counters='^total-completed$' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{precheck_status}, %{last_backup_status}, %{display} +You can use the following variables: %{precheck_status}, %{last_backup_status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{precheck_status} ne "Passed" || %{last_backup_status} eq "Failed"'). -Can used special variables like: %{precheck_status}, %{last_backup_status}, %{display} +You can use the following variables: %{precheck_status}, %{last_backup_status}, %{display} =item B<--warning-*> diff --git a/src/cloud/azure/management/recovery/mode/backupjobsstatus.pm b/src/cloud/azure/management/recovery/mode/backupjobsstatus.pm index 0ef422622..b9f873a80 100644 --- a/src/cloud/azure/management/recovery/mode/backupjobsstatus.pm +++ b/src/cloud/azure/management/recovery/mode/backupjobsstatus.pm @@ -219,12 +219,12 @@ Default: all existing job statuses are displayed. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "Failed"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/cloud/azure/management/recovery/mode/replicationhealth.pm b/src/cloud/azure/management/recovery/mode/replicationhealth.pm index 3aba0935c..44d340385 100644 --- a/src/cloud/azure/management/recovery/mode/replicationhealth.pm +++ b/src/cloud/azure/management/recovery/mode/replicationhealth.pm @@ -158,22 +158,22 @@ Filter item name (Can be a regexp). =item B<--warning-replication-status> Set warning threshold for replication health (Default: '%{replication_status} eq "Warning"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-replication-status> Set critical threshold for replication health (Default: '%{replication_status} eq "Critical"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-failover-status> Set warning threshold for failover status (Default: '%{failover_status} eq "Warning"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-failover-status> Set critical threshold for failover status (Default: '%{failover_status} eq "Critical"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/cloud/azure/management/resource/mode/deploymentsstatus.pm b/src/cloud/azure/management/resource/mode/deploymentsstatus.pm index b5db2056a..35501a437 100644 --- a/src/cloud/azure/management/resource/mode/deploymentsstatus.pm +++ b/src/cloud/azure/management/resource/mode/deploymentsstatus.pm @@ -179,12 +179,12 @@ Example: --filter-counters='^total-succeeded$' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "Succeeded"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/cloud/azure/network/appgateway/mode/health.pm b/src/cloud/azure/network/appgateway/mode/health.pm index 41ecdf986..b1102c89d 100644 --- a/src/cloud/azure/network/appgateway/mode/health.pm +++ b/src/cloud/azure/network/appgateway/mode/health.pm @@ -56,22 +56,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/network/expressroute/mode/circuitstatus.pm b/src/cloud/azure/network/expressroute/mode/circuitstatus.pm index 1c5045ac8..68df47ea8 100644 --- a/src/cloud/azure/network/expressroute/mode/circuitstatus.pm +++ b/src/cloud/azure/network/expressroute/mode/circuitstatus.pm @@ -141,12 +141,12 @@ Filter circuit name (Can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{circuit_status}, %{provider_status}, %{display} +You can use the following variables: %{circuit_status}, %{provider_status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{circuit_status} ne "Enabled" || %{provider_status} ne "Provisioned"'). -Can used special variables like: %{circuit_status}, %{provider_status}, %{display} +You can use the following variables: %{circuit_status}, %{provider_status}, %{display} =back diff --git a/src/cloud/azure/network/expressroute/mode/health.pm b/src/cloud/azure/network/expressroute/mode/health.pm index c31530c90..2c956ca4c 100644 --- a/src/cloud/azure/network/expressroute/mode/health.pm +++ b/src/cloud/azure/network/expressroute/mode/health.pm @@ -41,7 +41,7 @@ __END__ Check ExpressRoute Circuit health status. -(Usefull to determine host status) +(Useful to determine host status) =over 8 @@ -56,22 +56,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/network/virtualnetwork/mode/peeringsstatus.pm b/src/cloud/azure/network/virtualnetwork/mode/peeringsstatus.pm index b75c068e0..f63daa001 100644 --- a/src/cloud/azure/network/virtualnetwork/mode/peeringsstatus.pm +++ b/src/cloud/azure/network/virtualnetwork/mode/peeringsstatus.pm @@ -158,12 +158,12 @@ Filter peering name (Can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{peering_state}, %{provisioning_state}, %{peer}, %{display} +You can use the following variables: %{peering_state}, %{provisioning_state}, %{peer}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{peering_state} ne "Connected" || %{provisioning_state} ne "Succeeded"'). -Can used special variables like: %{peering_state}, %{provisioning_state}, %{peer}, %{display} +You can use the following variables: %{peering_state}, %{provisioning_state}, %{peer}, %{display} =back diff --git a/src/cloud/azure/network/vpngateway/mode/health.pm b/src/cloud/azure/network/vpngateway/mode/health.pm index 25347bc39..079014d60 100644 --- a/src/cloud/azure/network/vpngateway/mode/health.pm +++ b/src/cloud/azure/network/vpngateway/mode/health.pm @@ -41,7 +41,7 @@ __END__ Check Virtual Machine health status. -(Usefull to determine host status) +(Useful to determine host status) =over 8 @@ -56,22 +56,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/network/vpngateway/mode/vpngatewaystatus.pm b/src/cloud/azure/network/vpngateway/mode/vpngatewaystatus.pm index 2dde9f73c..501591669 100644 --- a/src/cloud/azure/network/vpngateway/mode/vpngatewaystatus.pm +++ b/src/cloud/azure/network/vpngateway/mode/vpngatewaystatus.pm @@ -136,12 +136,12 @@ Filter vpn name (Can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{provisioning_state}, %{gateway_type}, %{vpn_type}, %{display} +You can use the following variables: %{provisioning_state}, %{gateway_type}, %{vpn_type}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{provisioning_state} ne "Succeeded"'). -Can used special variables like: %{provisioning_state}, %{gateway_type}, %{vpn_type}, %{display} +You can use the following variables: %{provisioning_state}, %{gateway_type}, %{vpn_type}, %{display} =back diff --git a/src/cloud/azure/web/appserviceplan/mode/health.pm b/src/cloud/azure/web/appserviceplan/mode/health.pm index 7ead74b96..5efc7b50c 100644 --- a/src/cloud/azure/web/appserviceplan/mode/health.pm +++ b/src/cloud/azure/web/appserviceplan/mode/health.pm @@ -56,22 +56,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/azure/web/signalr/mode/health.pm b/src/cloud/azure/web/signalr/mode/health.pm index 6b6a4f95d..2b0eba47f 100644 --- a/src/cloud/azure/web/signalr/mode/health.pm +++ b/src/cloud/azure/web/signalr/mode/health.pm @@ -54,22 +54,22 @@ Set resource group (Required if resource's name is used). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^Unavailable$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /^Unknown$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =item B<--ok-status> Set ok threshold for status (Default: '%{status} =~ /^Available$/'). -Can used special variables like: %{status}, %{summary} +You can use the following variables: %{status}, %{summary} =back diff --git a/src/cloud/docker/restapi/mode/containerusage.pm b/src/cloud/docker/restapi/mode/containerusage.pm index 3f6a8ed02..ffed712f4 100644 --- a/src/cloud/docker/restapi/mode/containerusage.pm +++ b/src/cloud/docker/restapi/mode/containerusage.pm @@ -346,12 +346,12 @@ Example: --filter-counters='^container-status$' =item B<--warning-container-status> Set warning threshold for status. -Can used special variables like: %{name}, %{state}, %{health}. +You can use the following variables: %{name}, %{state}, %{health}. =item B<--critical-container-status> Set critical threshold for status. -Can used special variables like: %{name}, %{state}, %{health}. +You can use the following variables: %{name}, %{state}, %{health}. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/docker/restapi/mode/nodestatus.pm b/src/cloud/docker/restapi/mode/nodestatus.pm index a0b491afa..594c725e0 100644 --- a/src/cloud/docker/restapi/mode/nodestatus.pm +++ b/src/cloud/docker/restapi/mode/nodestatus.pm @@ -140,12 +140,12 @@ Check node status. =item B<--warning-node-status> Set warning threshold for status (Default: -) -Can used special variables like: %{display}, %{status}, %{manager_status}. +You can use the following variables: %{display}, %{status}, %{manager_status}. =item B<--critical-node-status> Set critical threshold for status (Default: '%{status} !~ /ready/ || %{manager_status} !~ /reachable|-/'). -Can used special variables like: %{display}, %{status}, %{manager_status}. +You can use the following variables: %{display}, %{status}, %{manager_status}. =item B<--warning-*> diff --git a/src/cloud/docker/restapi/mode/servicestatus.pm b/src/cloud/docker/restapi/mode/servicestatus.pm index 48c3a5e10..2e0a7d81f 100644 --- a/src/cloud/docker/restapi/mode/servicestatus.pm +++ b/src/cloud/docker/restapi/mode/servicestatus.pm @@ -156,17 +156,17 @@ Filter service by service name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{service_id}, %{task_id}, %{service_name}, %{node_name}, %{node_id}, %{desired_state}, %{state_message}, %{container_id}. +You can use the following variables: %{service_id}, %{task_id}, %{service_name}, %{node_name}, %{node_id}, %{desired_state}, %{state_message}, %{container_id}. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{service_id}, %{task_id}, %{service_name}, %{node_name}, %{node_id}, %{desired_state}, %{state_message}, %{container_id}. +You can use the following variables: %{service_id}, %{task_id}, %{service_name}, %{node_name}, %{node_id}, %{desired_state}, %{state_message}, %{container_id}. =item B<--critical-status> Set critical threshold for status (Default: '%{desired_state} ne %{state} and %{state} !~ /complete|preparing|assigned/'). -Can used special variables like: %{service_id}, %{task_id}, %{service_name}, %{node_name}, %{node_id}, %{desired_state}, %{state_message}, %{container_id}. +You can use the following variables: %{service_id}, %{task_id}, %{service_name}, %{node_name}, %{node_id}, %{desired_state}, %{state_message}, %{container_id}. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/cloudsql/common/mode/cpu.pm b/src/cloud/google/gcp/cloudsql/common/mode/cpu.pm index 3862baa12..5c678abd2 100644 --- a/src/cloud/google/gcp/cloudsql/common/mode/cpu.pm +++ b/src/cloud/google/gcp/cloudsql/common/mode/cpu.pm @@ -130,7 +130,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/cloudsql/common/mode/network.pm b/src/cloud/google/gcp/cloudsql/common/mode/network.pm index 08e6a04e8..4301222a4 100644 --- a/src/cloud/google/gcp/cloudsql/common/mode/network.pm +++ b/src/cloud/google/gcp/cloudsql/common/mode/network.pm @@ -159,7 +159,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/cloudsql/common/mode/storage.pm b/src/cloud/google/gcp/cloudsql/common/mode/storage.pm index 51a8e4e88..7e307dddd 100644 --- a/src/cloud/google/gcp/cloudsql/common/mode/storage.pm +++ b/src/cloud/google/gcp/cloudsql/common/mode/storage.pm @@ -148,7 +148,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/cloudsql/mysql/mode/innodb.pm b/src/cloud/google/gcp/cloudsql/mysql/mode/innodb.pm index b63ac3ff9..f8236b2dd 100644 --- a/src/cloud/google/gcp/cloudsql/mysql/mode/innodb.pm +++ b/src/cloud/google/gcp/cloudsql/mysql/mode/innodb.pm @@ -173,7 +173,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/cloudsql/mysql/mode/queries.pm b/src/cloud/google/gcp/cloudsql/mysql/mode/queries.pm index 4bd762623..f91938494 100644 --- a/src/cloud/google/gcp/cloudsql/mysql/mode/queries.pm +++ b/src/cloud/google/gcp/cloudsql/mysql/mode/queries.pm @@ -138,7 +138,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/compute/computeengine/mode/cpu.pm b/src/cloud/google/gcp/compute/computeengine/mode/cpu.pm index b45dc2402..93da84f2b 100644 --- a/src/cloud/google/gcp/compute/computeengine/mode/cpu.pm +++ b/src/cloud/google/gcp/compute/computeengine/mode/cpu.pm @@ -130,7 +130,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/compute/computeengine/mode/diskio.pm b/src/cloud/google/gcp/compute/computeengine/mode/diskio.pm index 6860fbd9d..f94c33995 100644 --- a/src/cloud/google/gcp/compute/computeengine/mode/diskio.pm +++ b/src/cloud/google/gcp/compute/computeengine/mode/diskio.pm @@ -212,7 +212,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/compute/computeengine/mode/network.pm b/src/cloud/google/gcp/compute/computeengine/mode/network.pm index 0e8037278..42db9fe9d 100644 --- a/src/cloud/google/gcp/compute/computeengine/mode/network.pm +++ b/src/cloud/google/gcp/compute/computeengine/mode/network.pm @@ -178,7 +178,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/google/gcp/custom/api.pm b/src/cloud/google/gcp/custom/api.pm index f31f2ac73..11941cfb3 100644 --- a/src/cloud/google/gcp/custom/api.pm +++ b/src/cloud/google/gcp/custom/api.pm @@ -474,7 +474,7 @@ Google Cloud Platform Rest API To connect to the GCP Rest API, you need to create an API key. -Follow the 'How-to guide' in https://cloud.google.com/video-intelligence/docs/common/auth +Follow the 'How-to guide' at https://cloud.google.com/video-intelligence/docs/common/auth =over 8 @@ -496,7 +496,7 @@ Set GCP scope endpoint URL (Default: 'https://www.googleapis.com/auth/cloud-plat =item B<--zeroed> -Set metrics value to 0 if none. Usefull when Stackdriver +Set metrics value to 0 if none. Useful when Stackdriver does not return value when not defined. =item B<--timeout> diff --git a/src/cloud/google/gcp/management/stackdriver/mode/getmetrics.pm b/src/cloud/google/gcp/management/stackdriver/mode/getmetrics.pm index d6c19d04b..688a5b9b4 100644 --- a/src/cloud/google/gcp/management/stackdriver/mode/getmetrics.pm +++ b/src/cloud/google/gcp/management/stackdriver/mode/getmetrics.pm @@ -231,7 +231,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-metric> @@ -243,7 +245,7 @@ Threshold critical. =item B<--extra-filter> -Set extra filters (Can be multiple). +Set extra filters (can be defined multiple times). Example: --extra-filter='metric.labels.mylabel = "LABELBLEUE"' diff --git a/src/cloud/google/gcp/storage/mode/bucket.pm b/src/cloud/google/gcp/storage/mode/bucket.pm index 51019ad28..e807c8a8b 100644 --- a/src/cloud/google/gcp/storage/mode/bucket.pm +++ b/src/cloud/google/gcp/storage/mode/bucket.pm @@ -159,7 +159,9 @@ Set timeframe in seconds (i.e. 3600 to check last hour). =item B<--aggregation> -Set monitor aggregation (Can be multiple, Can be: 'minimum', 'maximum', 'average', 'total'). +Aggregate monitoring. Can apply to: 'minimum', 'maximum', 'average', 'total' +and 'count'. +Can be called multiple times. =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/ibm/softlayer/mode/events.pm b/src/cloud/ibm/softlayer/mode/events.pm index 40547ebee..be25c11fe 100644 --- a/src/cloud/ibm/softlayer/mode/events.pm +++ b/src/cloud/ibm/softlayer/mode/events.pm @@ -199,13 +199,13 @@ Filter events status (Default: 'Active') =item B<--warning-event> Set warning threshold for status. -Can used special variables like: %{id}, %{subject}, %{status}, %{items}, +You can use the following variables: %{id}, %{subject}, %{status}, %{items}, %{start_date}, %{since_start}, %{end_date}, %{since_end}. =item B<--critical-event> Set critical threshold for status (Default: '%{status} =~ /Active/ && %{items} > 0'). -Can used special variables like: %{id}, %{subject}, %{status}, %{items}, +You can use the following variables: %{id}, %{subject}, %{status}, %{items}, %{start_date}, %{since_start}, %{end_date}, %{since_end}. =item B<--warning-*> diff --git a/src/cloud/ibm/softlayer/mode/opentickets.pm b/src/cloud/ibm/softlayer/mode/opentickets.pm index 47945b7d9..4f6635055 100644 --- a/src/cloud/ibm/softlayer/mode/opentickets.pm +++ b/src/cloud/ibm/softlayer/mode/opentickets.pm @@ -159,12 +159,12 @@ Name of the ticket group (Can be a regexp). =item B<--warning-ticket> Set warning threshold for status. -Can used special variables like: %{id}, %{title}, %{priority}, %{create_date}, %{group}, %{since}. +You can use the following variables: %{id}, %{title}, %{priority}, %{create_date}, %{group}, %{since}. =item B<--critical-ticket> Set critical threshold for status. -Can used special variables like: %{id}, %{title}, %{priority}, %{create_date}, %{group}, %{since}. +You can use the following variables: %{id}, %{title}, %{priority}, %{create_date}, %{group}, %{since}. =item B<--warning-open> diff --git a/src/cloud/iics/restapi/mode/agents.pm b/src/cloud/iics/restapi/mode/agents.pm index ca8f84321..4b29634af 100644 --- a/src/cloud/iics/restapi/mode/agents.pm +++ b/src/cloud/iics/restapi/mode/agents.pm @@ -224,32 +224,32 @@ Filter agents if active or not. =item B<--unknown-agent-status> Set unknown threshold for status. -Can used special variables like: %{active}, %{readyToRun}, %{id}, %{name} +You can use the following variables: %{active}, %{readyToRun}, %{id}, %{name} =item B<--warning-agent-status> Set warning threshold for status. -Can used special variables like: %{active}, %{readyToRun}, %{id}, %{name} +You can use the following variables: %{active}, %{readyToRun}, %{id}, %{name} =item B<--critical-agent-status> Set critical threshold for status (Default: '%{active} eq "yes" and %{readyToRun} eq "no"'). -Can used special variables like: %{active}, %{readyToRun}, %{id}, %{name} +You can use the following variables: %{active}, %{readyToRun}, %{id}, %{name} =item B<--unknown-engine-status> Set unknown threshold for status. -Can used special variables like: %{agentName}, %{appDisplayName}, %{status}, %{desiredStatus} +You can use the following variables: %{agentName}, %{appDisplayName}, %{status}, %{desiredStatus} =item B<--warning-engine-status> Set warning threshold for status. -Can used special variables like: %{agentName}, %{appDisplayName}, %{status}, %{desiredStatus} +You can use the following variables: %{agentName}, %{appDisplayName}, %{status}, %{desiredStatus} =item B<--critical-engine-status> Set critical threshold for status. -Can used special variables like: %{agentName}, %{appDisplayName}, %{status}, %{desiredStatus} +You can use the following variables: %{agentName}, %{appDisplayName}, %{status}, %{desiredStatus} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/kubernetes/mode/cronjobstatus.pm b/src/cloud/kubernetes/mode/cronjobstatus.pm index 18fe569db..312ada14a 100644 --- a/src/cloud/kubernetes/mode/cronjobstatus.pm +++ b/src/cloud/kubernetes/mode/cronjobstatus.pm @@ -168,13 +168,13 @@ Filter CronJob namespace (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{name}, %{namespace}, %{active}, +You can use the following variables: %{name}, %{namespace}, %{active}, %{last_schedule}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{name}, %{namespace}, %{active}, +You can use the following variables: %{name}, %{namespace}, %{active}, %{last_schedule}. =back diff --git a/src/cloud/kubernetes/mode/daemonsetstatus.pm b/src/cloud/kubernetes/mode/daemonsetstatus.pm index ab876fa9c..43d672936 100644 --- a/src/cloud/kubernetes/mode/daemonsetstatus.pm +++ b/src/cloud/kubernetes/mode/daemonsetstatus.pm @@ -186,13 +186,13 @@ Filter DaemonSet namespace (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{up_to_date} < %{desired}') -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date}, %{ready}, %{misscheduled}. =item B<--critical-status> Set critical threshold for status (Default: '%{available} < %{desired}'). -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date}, %{ready}, %{misscheduled}. =back diff --git a/src/cloud/kubernetes/mode/deploymentstatus.pm b/src/cloud/kubernetes/mode/deploymentstatus.pm index fdfc6f296..6f81de707 100644 --- a/src/cloud/kubernetes/mode/deploymentstatus.pm +++ b/src/cloud/kubernetes/mode/deploymentstatus.pm @@ -173,13 +173,13 @@ Filter deployment namespace (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{up_to_date} < %{desired}') -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date}. =item B<--critical-status> Set critical threshold for status (Default: '%{available} < %{desired}'). -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date}. =back diff --git a/src/cloud/kubernetes/mode/nodestatus.pm b/src/cloud/kubernetes/mode/nodestatus.pm index c40ebd6ff..eeefb52b3 100644 --- a/src/cloud/kubernetes/mode/nodestatus.pm +++ b/src/cloud/kubernetes/mode/nodestatus.pm @@ -147,12 +147,12 @@ Filter node name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{type}, %{status}, %{reason}, %{message}, %{name}. +You can use the following variables: %{type}, %{status}, %{reason}, %{message}, %{name}. =item B<--critical-status> Set critical threshold for status (Default: '(%{type} =~ /Ready/i && %{status} !~ /True/i) || (%{type} =~ /.*Pressure/i && %{status} !~ /False/i)'). -Can used special variables like: %{type}, %{status}, %{reason}, %{message}, %{name}. +You can use the following variables: %{type}, %{status}, %{reason}, %{message}, %{name}. =back diff --git a/src/cloud/kubernetes/mode/persistentvolumestatus.pm b/src/cloud/kubernetes/mode/persistentvolumestatus.pm index 95a6adac5..54bfd7fd0 100644 --- a/src/cloud/kubernetes/mode/persistentvolumestatus.pm +++ b/src/cloud/kubernetes/mode/persistentvolumestatus.pm @@ -116,12 +116,12 @@ Filter persistent volume name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{name}, %{phase}. +You can use the following variables: %{name}, %{phase}. =item B<--critical-status> Set critical threshold for status (Default: '%{phase} !~ /Bound|Available|Released/i'). -Can used special variables like: %{name}, %{phase}. +You can use the following variables: %{name}, %{phase}. =back diff --git a/src/cloud/kubernetes/mode/podstatus.pm b/src/cloud/kubernetes/mode/podstatus.pm index 144ac8741..a8c4287f0 100644 --- a/src/cloud/kubernetes/mode/podstatus.pm +++ b/src/cloud/kubernetes/mode/podstatus.pm @@ -298,29 +298,29 @@ Filter pod namespace (can be a regexp). =item B<--extra-filter> -Add an extra filter based on labels (Can be multiple) +Add an extra filter based on labels (can be defined multiple times) Example : --extra-filter='app=mynewapp' =item B<--warning-pod-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{name}, %{namespace}. +You can use the following variables: %{status}, %{name}, %{namespace}. =item B<--critical-pod-status> Set critical threshold for status (Default: '%{status} !~ /running/i'). -Can used special variables like: %{status}, %{name}, %{namespace}. +You can use the following variables: %{status}, %{name}, %{namespace}. =item B<--warning-container-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{name}. +You can use the following variables: %{status}, %{name}. =item B<--critical-container-status> Set critical threshold for status (Default: '%{status} !~ /running/i || %{state} !~ /^ready$/'). -Can used special variables like: %{status}, %{state}, %{name}. +You can use the following variables: %{status}, %{state}, %{name}. =item B<--warning-*> diff --git a/src/cloud/kubernetes/mode/replicasetstatus.pm b/src/cloud/kubernetes/mode/replicasetstatus.pm index c55e40c2d..8ec4b24b6 100644 --- a/src/cloud/kubernetes/mode/replicasetstatus.pm +++ b/src/cloud/kubernetes/mode/replicasetstatus.pm @@ -153,13 +153,13 @@ Filter ReplicaSet namespace (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{ready}. =item B<--critical-status> Set critical threshold for status (Default: '%{ready} < %{desired}'). -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{ready}. =back diff --git a/src/cloud/kubernetes/mode/replicationcontrollerstatus.pm b/src/cloud/kubernetes/mode/replicationcontrollerstatus.pm index 79cf60248..bce3cd5af 100644 --- a/src/cloud/kubernetes/mode/replicationcontrollerstatus.pm +++ b/src/cloud/kubernetes/mode/replicationcontrollerstatus.pm @@ -153,13 +153,13 @@ Filter ReplicationController namespace (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{ready}. =item B<--critical-status> Set critical threshold for status (Default: '%{ready} < %{desired}'). -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{ready}. =back diff --git a/src/cloud/kubernetes/mode/statefulsetstatus.pm b/src/cloud/kubernetes/mode/statefulsetstatus.pm index 3b4622917..4bdbaa5eb 100644 --- a/src/cloud/kubernetes/mode/statefulsetstatus.pm +++ b/src/cloud/kubernetes/mode/statefulsetstatus.pm @@ -166,13 +166,13 @@ Filter StatefulSet namespace (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{up_to_date} < %{desired}') -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{up_to_date}, %{ready}. =item B<--critical-status> Set critical threshold for status (Default: '%{ready} < %{desired}'). -Can used special variables like: %{name}, %{namespace}, %{desired}, %{current}, +You can use the following variables: %{name}, %{namespace}, %{desired}, %{current}, %{up_to_date}, %{ready}. =back diff --git a/src/cloud/microsoft/office365/custom/graphapi.pm b/src/cloud/microsoft/office365/custom/graphapi.pm index b22f8fbac..b67e698a9 100644 --- a/src/cloud/microsoft/office365/custom/graphapi.pm +++ b/src/cloud/microsoft/office365/custom/graphapi.pm @@ -509,7 +509,7 @@ Microsoft Office 365 Graph API To connect to the Office 365 Graph API, you must register an application. -Follow the 'How-to guide' in https://docs.microsoft.com/en-us/graph/auth-register-app-v2?view=graph-rest-1.0 +Follow the 'How-to guide' at https://docs.microsoft.com/en-us/graph/auth-register-app-v2?view=graph-rest-1.0 This custom mode is using the 'OAuth 2.0 Client Credentials Grant Flow'. diff --git a/src/cloud/microsoft/office365/custom/managementapi.pm b/src/cloud/microsoft/office365/custom/managementapi.pm index 5d7d7c5cf..ea77e7b6e 100644 --- a/src/cloud/microsoft/office365/custom/managementapi.pm +++ b/src/cloud/microsoft/office365/custom/managementapi.pm @@ -251,7 +251,7 @@ Microsoft Office 365 Management API To connect to the Office 365 Management API, you must register an application. -Follow the 'How-to guide' in https://docs.microsoft.com/en-us/office/office-365-management-api/get-started-with-office-365-management-apis#register-your-application-in-azure-ad +Follow the 'How-to guide' at https://docs.microsoft.com/en-us/office/office-365-management-api/get-started-with-office-365-management-apis#register-your-application-in-azure-ad This custom mode is using the 'OAuth 2.0 Client Credentials Grant Flow'. diff --git a/src/cloud/microsoft/office365/exchange/mode/mailboxusage.pm b/src/cloud/microsoft/office365/exchange/mode/mailboxusage.pm index c6c8417c6..f98aeedc2 100644 --- a/src/cloud/microsoft/office365/exchange/mode/mailboxusage.pm +++ b/src/cloud/microsoft/office365/exchange/mode/mailboxusage.pm @@ -304,13 +304,13 @@ Can be: 'active-mailboxes', 'total-usage-active' (count), =item B<--warning-status> Set warning threshold for status (Default: '%{used} > %{issue_warning_quota}'). -Can used special variables like: %{used}, %{issue_warning_quota}, +You can use the following variables: %{used}, %{issue_warning_quota}, %{prohibit_send_quota}, %{prohibit_send_receive_quota} =item B<--critical-status> Set critical threshold for status (Default: '%{used} > %{prohibit_send_quota}'). -Can used special variables like: %{used}, %{issue_warning_quota}, +You can use the following variables: %{used}, %{issue_warning_quota}, %{prohibit_send_quota}, %{prohibit_send_receive_quota} =item B<--filter-counters> diff --git a/src/cloud/microsoft/office365/management/mode/appcredentials.pm b/src/cloud/microsoft/office365/management/mode/appcredentials.pm index e64cad2a2..344662d5e 100644 --- a/src/cloud/microsoft/office365/management/mode/appcredentials.pm +++ b/src/cloud/microsoft/office365/management/mode/appcredentials.pm @@ -239,22 +239,22 @@ Filter applications (can be a regexp). =item B<--warning-key-status> Set warning threshold for status. -Can used special variables like: %{status}, %{id}, %{app_name}. +You can use the following variables: %{status}, %{id}, %{app_name}. =item B<--critical-key-status> Set critical threshold for status (Default: '%{status} =~ /expired/i'). -Can used special variables like: %{status}, %{id}, %{app_name}. +You can use the following variables: %{status}, %{id}, %{app_name}. =item B<--warning-password-status> Set warning threshold for status. -Can used special variables like: %{status}, %{id}, %{app_name}. +You can use the following variables: %{status}, %{id}, %{app_name}. =item B<--critical-password-status> Set critical threshold for status (Default: '%{status} =~ /expired/i'). -Can used special variables like: %{status}, %{id}, %{app_name}. +You can use the following variables: %{status}, %{id}, %{app_name}. =item B<--unit> diff --git a/src/cloud/microsoft/office365/management/mode/servicestatus.pm b/src/cloud/microsoft/office365/management/mode/servicestatus.pm index 817838007..b656f1e58 100644 --- a/src/cloud/microsoft/office365/management/mode/servicestatus.pm +++ b/src/cloud/microsoft/office365/management/mode/servicestatus.pm @@ -136,12 +136,12 @@ Filter services (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{service_name}, %{status}, %{classification} +You can use the following variables: %{service_name}, %{status}, %{classification} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /serviceOperational|serviceRestored/i'). -Can used special variables like: %{service_name}, %{status}, %{classification} +You can use the following variables: %{service_name}, %{status}, %{classification} =back diff --git a/src/cloud/microsoft/office365/management/mode/subscriptions.pm b/src/cloud/microsoft/office365/management/mode/subscriptions.pm index 258355f57..80ab644f8 100644 --- a/src/cloud/microsoft/office365/management/mode/subscriptions.pm +++ b/src/cloud/microsoft/office365/management/mode/subscriptions.pm @@ -167,12 +167,12 @@ Filter subscriptions by SKU part number (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{capabilityStatus}, %{skuPartNumber} +You can use the following variables: %{capabilityStatus}, %{skuPartNumber} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{capabilityStatus}, %{skuPartNumber} +You can use the following variables: %{capabilityStatus}, %{skuPartNumber} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/nutanix/snmp/mode/clusterusage.pm b/src/cloud/nutanix/snmp/mode/clusterusage.pm index 059c2c2a1..9ef652817 100644 --- a/src/cloud/nutanix/snmp/mode/clusterusage.pm +++ b/src/cloud/nutanix/snmp/mode/clusterusage.pm @@ -237,12 +237,12 @@ Example: --filter-counters='^usage$' =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/cloud/nutanix/snmp/mode/diskusage.pm b/src/cloud/nutanix/snmp/mode/diskusage.pm index 82e674d14..9ddd7806c 100644 --- a/src/cloud/nutanix/snmp/mode/diskusage.pm +++ b/src/cloud/nutanix/snmp/mode/diskusage.pm @@ -354,12 +354,12 @@ Filter controllervm name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{crtName}, %{diskId} +You can use the following variables: %{state}, %{crtName}, %{diskId} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{crtName}, %{diskId} +You can use the following variables: %{state}, %{crtName}, %{diskId} =item B<--warning-*> diff --git a/src/cloud/nutanix/snmp/mode/vmusage.pm b/src/cloud/nutanix/snmp/mode/vmusage.pm index 4d54fc54c..560dd15fc 100644 --- a/src/cloud/nutanix/snmp/mode/vmusage.pm +++ b/src/cloud/nutanix/snmp/mode/vmusage.pm @@ -271,12 +271,12 @@ Filter virtual machine name (can be a regexp). =item B<--warning-vm-power-state> Set warning threshold for the virtual machine power state. -Can used special variables like: %{vmPowerState}. +You can use the following variables: %{vmPowerState}. =item B<--critical-vm-power-state> Set critical threshold for the virtual machine power state. -Can used special variables like: %{vmPowerState}. +You can use the following variables: %{vmPowerState}. =item B<--warning-*> diff --git a/src/cloud/outscale/mode/clientgateways.pm b/src/cloud/outscale/mode/clientgateways.pm index 6652e5891..77b15619f 100644 --- a/src/cloud/outscale/mode/clientgateways.pm +++ b/src/cloud/outscale/mode/clientgateways.pm @@ -175,17 +175,17 @@ Client gateway tags to be used for the name (Default: 'name'). =item B<--unknown-cg-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{cgName} +You can use the following variables: %{state}, %{cgName} =item B<--warning-cg-status> Set warning threshold for status. -Can used special variables like: %{state}, %{cgName} +You can use the following variables: %{state}, %{cgName} =item B<--critical-cg-status> Set critical threshold for status. -Can used special variables like: %{state}, %{cgName} +You can use the following variables: %{state}, %{cgName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/internetservices.pm b/src/cloud/outscale/mode/internetservices.pm index 9f2a50e8c..661ea1373 100644 --- a/src/cloud/outscale/mode/internetservices.pm +++ b/src/cloud/outscale/mode/internetservices.pm @@ -152,17 +152,17 @@ Internet service tag to be used for the name (Default: 'name'). =item B<--unknown-internet-service-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{internetServiceName} +You can use the following variables: %{state}, %{internetServiceName} =item B<--warning-internet-service-status> Set warning threshold for status. -Can used special variables like: %{state}, %{internetServiceName} +You can use the following variables: %{state}, %{internetServiceName} =item B<--critical-internet-service-status> Set critical threshold for status. -Can used special variables like: %{state}, %{internetServiceName} +You can use the following variables: %{state}, %{internetServiceName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/loadbalancers.pm b/src/cloud/outscale/mode/loadbalancers.pm index 2db9d662d..2c78ebcea 100644 --- a/src/cloud/outscale/mode/loadbalancers.pm +++ b/src/cloud/outscale/mode/loadbalancers.pm @@ -203,17 +203,17 @@ Virtual machine tags to used for the name (Default: 'name'). =item B<--unknown-vm-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{vmName} +You can use the following variables: %{state}, %{vmName} =item B<--warning-vm-status> Set warning threshold for status. -Can used special variables like: %{state}, %{vmName} +You can use the following variables: %{state}, %{vmName} =item B<--critical-vm-status> Set critical threshold for status. -Can used special variables like: %{state}, %{vmName} +You can use the following variables: %{state}, %{vmName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/natservices.pm b/src/cloud/outscale/mode/natservices.pm index e8b6a8ffe..c925fbf7b 100644 --- a/src/cloud/outscale/mode/natservices.pm +++ b/src/cloud/outscale/mode/natservices.pm @@ -152,17 +152,17 @@ Nat service tag to be used for the name (Default: 'name'). =item B<--unknown-nat-service-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{natName} +You can use the following variables: %{state}, %{natName} =item B<--warning-nat-service-status> Set warning threshold for status. -Can used special variables like: %{state}, %{natName} +You can use the following variables: %{state}, %{natName} =item B<--critical-nat-service-status> Set critical threshold for status. -Can used special variables like: %{state}, %{natName} +You can use the following variables: %{state}, %{natName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/nets.pm b/src/cloud/outscale/mode/nets.pm index ec15197d2..a27a062f5 100644 --- a/src/cloud/outscale/mode/nets.pm +++ b/src/cloud/outscale/mode/nets.pm @@ -145,17 +145,17 @@ Nets tag to be used for the name (Default: 'name'). =item B<--unknown-net-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{netName} +You can use the following variables: %{state}, %{netName} =item B<--warning-net-status> Set warning threshold for status. -Can used special variables like: %{state}, %{netName} +You can use the following variables: %{state}, %{netName} =item B<--critical-net-status> Set critical threshold for status. -Can used special variables like: %{state}, %{netName} +You can use the following variables: %{state}, %{netName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/quotas.pm b/src/cloud/outscale/mode/quotas.pm index 268c01151..e7afac10e 100644 --- a/src/cloud/outscale/mode/quotas.pm +++ b/src/cloud/outscale/mode/quotas.pm @@ -177,17 +177,17 @@ Nets tag to be used for the name (Default: 'name'). =item B<--unknown-net-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{netName} +You can use the following variables: %{state}, %{netName} =item B<--warning-net-status> Set warning threshold for status. -Can used special variables like: %{state}, %{netName} +You can use the following variables: %{state}, %{netName} =item B<--critical-net-status> Set critical threshold for status. -Can used special variables like: %{state}, %{netName} +You can use the following variables: %{state}, %{netName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/subnets.pm b/src/cloud/outscale/mode/subnets.pm index b840b9c01..8df7d2b70 100644 --- a/src/cloud/outscale/mode/subnets.pm +++ b/src/cloud/outscale/mode/subnets.pm @@ -190,17 +190,17 @@ Subnet tags to be used for the name (Default: 'name'). =item B<--unknown-subnet-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{subnetName} +You can use the following variables: %{state}, %{subnetName} =item B<--warning-subnet-status> Set warning threshold for status. -Can used special variables like: %{state}, %{subnetName} +You can use the following variables: %{state}, %{subnetName} =item B<--critical-subnet-status> Set critical threshold for status. -Can used special variables like: %{state}, %{subnetName} +You can use the following variables: %{state}, %{subnetName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/virtualgateways.pm b/src/cloud/outscale/mode/virtualgateways.pm index bc3c4ad0b..20c72f2ef 100644 --- a/src/cloud/outscale/mode/virtualgateways.pm +++ b/src/cloud/outscale/mode/virtualgateways.pm @@ -175,17 +175,17 @@ Virtual gateway tag to be used for the name (Default: 'name'). =item B<--unknown-vg-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{vgName} +You can use the following variables: %{state}, %{vgName} =item B<--warning-vg-status> Set warning threshold for status. -Can used special variables like: %{state}, %{vgName} +You can use the following variables: %{state}, %{vgName} =item B<--critical-vg-status> Set critical threshold for status. -Can used special variables like: %{state}, %{vgName} +You can use the following variables: %{state}, %{vgName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/vms.pm b/src/cloud/outscale/mode/vms.pm index cfe8060ca..864138057 100644 --- a/src/cloud/outscale/mode/vms.pm +++ b/src/cloud/outscale/mode/vms.pm @@ -152,17 +152,17 @@ Virtual machine tag to be used for the name (Default: 'name'). =item B<--unknown-vm-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{vmName} +You can use the following variables: %{state}, %{vmName} =item B<--warning-vm-status> Set warning threshold for status. -Can used special variables like: %{state}, %{vmName} +You can use the following variables: %{state}, %{vmName} =item B<--critical-vm-status> Set critical threshold for status. -Can used special variables like: %{state}, %{vmName} +You can use the following variables: %{state}, %{vmName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/volumes.pm b/src/cloud/outscale/mode/volumes.pm index b32e86e54..8c06d7233 100644 --- a/src/cloud/outscale/mode/volumes.pm +++ b/src/cloud/outscale/mode/volumes.pm @@ -195,17 +195,17 @@ Virtual machine tags to used for the name (Default: 'name'). =item B<--unknown-volume-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{volumeId} +You can use the following variables: %{state}, %{volumeId} =item B<--warning-volume-status> Set warning threshold for status. -Can used special variables like: %{state}, %{volumeId} +You can use the following variables: %{state}, %{volumeId} =item B<--critical-volume-status> Set critical threshold for status. -Can used special variables like: %{state}, %{volumeId} +You can use the following variables: %{state}, %{volumeId} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/outscale/mode/vpnconnections.pm b/src/cloud/outscale/mode/vpnconnections.pm index a2d822dc7..41c292d15 100644 --- a/src/cloud/outscale/mode/vpnconnections.pm +++ b/src/cloud/outscale/mode/vpnconnections.pm @@ -192,17 +192,17 @@ Vpn connection tag to be used for the name (Default: 'name'). =item B<--unknown-vpn-connection-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{vpnName} +You can use the following variables: %{state}, %{vpnName} =item B<--warning-vpn-connection-status> Set warning threshold for status. -Can used special variables like: %{state}, %{vpnName} +You can use the following variables: %{state}, %{vpnName} =item B<--critical-vpn-connection-status> Set critical threshold for status. -Can used special variables like: %{state}, %{vpnName} +You can use the following variables: %{state}, %{vpnName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/prometheus/direct/kubernetes/mode/containerstatus.pm b/src/cloud/prometheus/direct/kubernetes/mode/containerstatus.pm index a682a756a..2f6e05784 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/containerstatus.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/containerstatus.pm @@ -216,12 +216,12 @@ Filter on a specific pod (Must be a PromQL filter, Default: 'pod=~".*"') =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{status}, %{state}, %{reason} +You can use the following variables: %{status}, %{state}, %{reason} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /running/ || %{state} !~ /ready/'). -Can used special variables like: %{status}, %{state}, %{reason} +You can use the following variables: %{status}, %{state}, %{reason} =item B<--warning-restarts-count> @@ -233,13 +233,13 @@ Threshold critical for container restarts count. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/daemonsetstatus.pm b/src/cloud/prometheus/direct/kubernetes/mode/daemonsetstatus.pm index d4ca8abba..541adc54d 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/daemonsetstatus.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/daemonsetstatus.pm @@ -240,24 +240,24 @@ Filter on a specific daemonset (Must be a PromQL filter, Default: 'daemonset=~". =item B<--warning-status> Set warning threshold for status (Default: '%{up_to_date} < %{desired}') -Can used special variables like: %{display}, %{desired}, %{current}, +You can use the following variables: %{display}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date}, %{ready}, %{misscheduled} =item B<--critical-status> Set critical threshold for status (Default: '%{available} < %{desired}'). -Can used special variables like: %{display}, %{desired}, %{current}, +You can use the following variables: %{display}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date}, %{ready}, %{misscheduled} =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/deploymentstatus.pm b/src/cloud/prometheus/direct/kubernetes/mode/deploymentstatus.pm index 63f3dfd4a..66a1660b1 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/deploymentstatus.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/deploymentstatus.pm @@ -215,24 +215,24 @@ Filter on a specific deployment (Must be a PromQL filter, Default: 'deployment=~ =item B<--warning-status> Set warning threshold for status (Default: '%{up_to_date} < %{desired}') -Can used special variables like: %{display}, %{desired}, %{current}, +You can use the following variables: %{display}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date} =item B<--critical-status> Set critical threshold for status (Default: '%{available} < %{desired}'). -Can used special variables like: %{display}, %{desired}, %{current}, +You can use the following variables: %{display}, %{desired}, %{current}, %{available}, %{unavailable}, %{up_to_date} =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/listcontainers.pm b/src/cloud/prometheus/direct/kubernetes/mode/listcontainers.pm index 615f368d1..81d1f1723 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/listcontainers.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/listcontainers.pm @@ -144,13 +144,13 @@ Filter on a specific image (Must be a PromQL filter, Default: 'image=~".*"') =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple, metric can be 'info') +Overload default metrics name (can be defined multiple times, metric can be 'info') Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/listdaemonsets.pm b/src/cloud/prometheus/direct/kubernetes/mode/listdaemonsets.pm index f961e1f61..79ce1cd9e 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/listdaemonsets.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/listdaemonsets.pm @@ -130,13 +130,13 @@ Filter on a specific namespace (Must be a PromQL filter, Default: 'namespace=~". =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple, metric can be 'created') +Overload default metrics name (can be defined multiple times, metric can be 'created') Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/listdeployments.pm b/src/cloud/prometheus/direct/kubernetes/mode/listdeployments.pm index c80f2bf73..a94064cd3 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/listdeployments.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/listdeployments.pm @@ -123,13 +123,13 @@ Filter on a specific deployment (Must be a PromQL filter, Default: 'deployment=~ =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple, metric can be 'labels') +Overload default metrics name (can be defined multiple times, metric can be 'labels') Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/listnamespaces.pm b/src/cloud/prometheus/direct/kubernetes/mode/listnamespaces.pm index 4250b305a..39e27126b 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/listnamespaces.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/listnamespaces.pm @@ -123,13 +123,13 @@ Filter on a specific namespace (Must be a PromQL filter, Default: 'namespace=~". =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple, metric can be 'labels') +Overload default metrics name (can be defined multiple times, metric can be 'labels') Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/listnodes.pm b/src/cloud/prometheus/direct/kubernetes/mode/listnodes.pm index aa2d9cdf5..2a9351e99 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/listnodes.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/listnodes.pm @@ -162,13 +162,13 @@ Filter on a specific container runtime version (Must be a PromQL filter, Default =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple, metric can be 'info') +Overload default metrics name (can be defined multiple times, metric can be 'info') Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/listservices.pm b/src/cloud/prometheus/direct/kubernetes/mode/listservices.pm index c2147ca68..d3501ca8a 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/listservices.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/listservices.pm @@ -130,13 +130,13 @@ Filter on a specific cluster ip (Must be a PromQL filter, Default: 'cluster_ip=~ =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple, metric can be 'info') +Overload default metrics name (can be defined multiple times, metric can be 'info') Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/namespacestatus.pm b/src/cloud/prometheus/direct/kubernetes/mode/namespacestatus.pm index 85cc05f96..7f345647c 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/namespacestatus.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/namespacestatus.pm @@ -193,22 +193,22 @@ Filter on a specific phase (Must be a PromQL filter, Default: 'phase=~".*"') =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{display}, %{phase}. +You can use the following variables: %{display}, %{phase}. =item B<--critical-status> Set critical threshold for status (Default: '%{phase} !~ /Active/'). -Can used special variables like: %{display}, %{phase} +You can use the following variables: %{display}, %{phase} =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/kubernetes/mode/nodestatus.pm b/src/cloud/prometheus/direct/kubernetes/mode/nodestatus.pm index 8075d7c22..c5c1d204a 100644 --- a/src/cloud/prometheus/direct/kubernetes/mode/nodestatus.pm +++ b/src/cloud/prometheus/direct/kubernetes/mode/nodestatus.pm @@ -252,12 +252,12 @@ Filter on a specific node (Must be a PromQL filter, Default: 'node=~".*"') =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{display}, %{status}, %{schedulable} +You can use the following variables: %{display}, %{status}, %{schedulable} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Ready/ || %{schedulable} != /false/'). -Can used special variables like: %{display}, %{status}, %{schedulable} +You can use the following variables: %{display}, %{status}, %{schedulable} =item B<--warning-allocated-pods> @@ -273,13 +273,13 @@ Units of thresholds (Default: '') (Can be '%'). =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/nginxingresscontroller/mode/connections.pm b/src/cloud/prometheus/direct/nginxingresscontroller/mode/connections.pm index bfe34aa02..ef4a66a83 100644 --- a/src/cloud/prometheus/direct/nginxingresscontroller/mode/connections.pm +++ b/src/cloud/prometheus/direct/nginxingresscontroller/mode/connections.pm @@ -169,13 +169,13 @@ Can be: 'reading', 'waiting', 'writing', 'active', =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/direct/nginxingresscontroller/mode/requests.pm b/src/cloud/prometheus/direct/nginxingresscontroller/mode/requests.pm index d7b72a4f2..a4b08f68f 100644 --- a/src/cloud/prometheus/direct/nginxingresscontroller/mode/requests.pm +++ b/src/cloud/prometheus/direct/nginxingresscontroller/mode/requests.pm @@ -177,13 +177,13 @@ Can be: 'requests', 'requests-2xx', 'requests-3xx', =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/cadvisor/mode/cpu.pm b/src/cloud/prometheus/exporters/cadvisor/mode/cpu.pm index 067547209..c5ae662c2 100644 --- a/src/cloud/prometheus/exporters/cadvisor/mode/cpu.pm +++ b/src/cloud/prometheus/exporters/cadvisor/mode/cpu.pm @@ -180,13 +180,13 @@ Can be: 'usage', 'throttled'. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/cadvisor/mode/listcontainers.pm b/src/cloud/prometheus/exporters/cadvisor/mode/listcontainers.pm index 78fb18955..b0bc826b8 100644 --- a/src/cloud/prometheus/exporters/cadvisor/mode/listcontainers.pm +++ b/src/cloud/prometheus/exporters/cadvisor/mode/listcontainers.pm @@ -139,13 +139,13 @@ Filter on a specific namespace (Must be a PromQL filter, Default: 'namespace=~". =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple, metric can be 'last_seen') +Overload default metrics name (can be defined multiple times, metric can be 'last_seen') Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/cadvisor/mode/load.pm b/src/cloud/prometheus/exporters/cadvisor/mode/load.pm index b4dddf710..df9799850 100644 --- a/src/cloud/prometheus/exporters/cadvisor/mode/load.pm +++ b/src/cloud/prometheus/exporters/cadvisor/mode/load.pm @@ -157,13 +157,13 @@ Threshold critical. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/cadvisor/mode/memory.pm b/src/cloud/prometheus/exporters/cadvisor/mode/memory.pm index 2c5efc4c6..57bc259c5 100644 --- a/src/cloud/prometheus/exporters/cadvisor/mode/memory.pm +++ b/src/cloud/prometheus/exporters/cadvisor/mode/memory.pm @@ -302,13 +302,13 @@ Units of thresholds (Default: '%') ('%', 'B'). =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/cadvisor/mode/storage.pm b/src/cloud/prometheus/exporters/cadvisor/mode/storage.pm index dde363eb5..8a525d217 100644 --- a/src/cloud/prometheus/exporters/cadvisor/mode/storage.pm +++ b/src/cloud/prometheus/exporters/cadvisor/mode/storage.pm @@ -267,13 +267,13 @@ Threshold critical. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/cadvisor/mode/taskstate.pm b/src/cloud/prometheus/exporters/cadvisor/mode/taskstate.pm index 988d33d26..47c963d46 100644 --- a/src/cloud/prometheus/exporters/cadvisor/mode/taskstate.pm +++ b/src/cloud/prometheus/exporters/cadvisor/mode/taskstate.pm @@ -199,13 +199,13 @@ Can be: 'sleeping', 'running', 'stopped', 'uninterruptible', 'iowaiting'. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/nodeexporter/mode/cpu.pm b/src/cloud/prometheus/exporters/nodeexporter/mode/cpu.pm index 63e5d2396..98c742c48 100644 --- a/src/cloud/prometheus/exporters/nodeexporter/mode/cpu.pm +++ b/src/cloud/prometheus/exporters/nodeexporter/mode/cpu.pm @@ -196,13 +196,13 @@ Can be: 'node-usage', 'cpu-usage'. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm b/src/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm index 33fc163c6..ca0e77b78 100644 --- a/src/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm +++ b/src/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm @@ -336,13 +336,13 @@ Can be: 'node-idle', 'node-wait', 'node-interrupt', 'node-nice', =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/nodeexporter/mode/load.pm b/src/cloud/prometheus/exporters/nodeexporter/mode/load.pm index 8cb100916..471dddefe 100644 --- a/src/cloud/prometheus/exporters/nodeexporter/mode/load.pm +++ b/src/cloud/prometheus/exporters/nodeexporter/mode/load.pm @@ -171,13 +171,13 @@ Can be: 'load1', 'load5', 'load15'. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/nodeexporter/mode/memory.pm b/src/cloud/prometheus/exporters/nodeexporter/mode/memory.pm index 0fb3f2585..18072587c 100644 --- a/src/cloud/prometheus/exporters/nodeexporter/mode/memory.pm +++ b/src/cloud/prometheus/exporters/nodeexporter/mode/memory.pm @@ -241,13 +241,13 @@ Units of thresholds (Default: '%') ('%', 'B'). =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/exporters/nodeexporter/mode/storage.pm b/src/cloud/prometheus/exporters/nodeexporter/mode/storage.pm index 7cfbc1fc8..a37a16480 100644 --- a/src/cloud/prometheus/exporters/nodeexporter/mode/storage.pm +++ b/src/cloud/prometheus/exporters/nodeexporter/mode/storage.pm @@ -277,13 +277,13 @@ Threshold critical. =item B<--extra-filter> -Add a PromQL filter (Can be multiple) +Add a PromQL filter (can be defined multiple times) Example : --extra-filter='name=~".*pretty.*"' =item B<--metric-overload> -Overload default metrics name (Can be multiple) +Overload default metrics name (can be defined multiple times) Example : --metric-overload='metric,^my_metric_name$' diff --git a/src/cloud/prometheus/restapi/mode/targetstatus.pm b/src/cloud/prometheus/restapi/mode/targetstatus.pm index dbc3a9161..d8c920ff4 100644 --- a/src/cloud/prometheus/restapi/mode/targetstatus.pm +++ b/src/cloud/prometheus/restapi/mode/targetstatus.pm @@ -202,17 +202,17 @@ Check targets status. =item B<--filter-label> -Set filter on label (Regexp, Can be multiple) (Example: --filter-label='job,kube.*'). +Set filter on label (Regexp, can be defined multiple times) (Example: --filter-label='job,kube.*'). =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{display}, %{health}. +You can use the following variables: %{display}, %{health}. =item B<--critical-status> Set critical threshold for status (Default: '%{health} !~ /up/'). -Can used special variables like: %{display}, %{health} +You can use the following variables: %{display}, %{health} =item B<--warning-*> diff --git a/src/cloud/talend/tmc/mode/plans.pm b/src/cloud/talend/tmc/mode/plans.pm index d58ba59fe..4c58cf678 100644 --- a/src/cloud/talend/tmc/mode/plans.pm +++ b/src/cloud/talend/tmc/mode/plans.pm @@ -365,17 +365,17 @@ Select the unit for last execution time threshold. May be 's' for seconds, 'm' f =item B<--unknown-execution-status> Set unknown threshold for last plan execution status. -Can used special variables like: %{status}, %{planName} +You can use the following variables: %{status}, %{planName} =item B<--warning-execution-status> Set warning threshold for last plan execution status. -Can used special variables like: %{status}, %{planName} +You can use the following variables: %{status}, %{planName} =item B<--critical-execution-status> Set critical threshold for last plan execution status (Default: '{status} =~ /execution_failed/i'). -Can used special variables like: %{status}, %{planName} +You can use the following variables: %{status}, %{planName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/talend/tmc/mode/remoteengines.pm b/src/cloud/talend/tmc/mode/remoteengines.pm index 927c106cf..cdb152a63 100644 --- a/src/cloud/talend/tmc/mode/remoteengines.pm +++ b/src/cloud/talend/tmc/mode/remoteengines.pm @@ -156,17 +156,17 @@ Environment filter (Can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{availability}, %{name} +You can use the following variables: %{status}, %{availability}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{availability}, %{name} +You can use the following variables: %{status}, %{availability}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{availability} !~ /retired/ and %{status} =~ /unpaired/i'). -Can used special variables like: %{status}, %{availability}, %{name} +You can use the following variables: %{status}, %{availability}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/talend/tmc/mode/tasks.pm b/src/cloud/talend/tmc/mode/tasks.pm index 2f8ae6c5b..48148903f 100644 --- a/src/cloud/talend/tmc/mode/tasks.pm +++ b/src/cloud/talend/tmc/mode/tasks.pm @@ -365,17 +365,17 @@ Select the unit for last execution time threshold. May be 's' for seconds, 'm' f =item B<--unknown-execution-status> Set unknown threshold for last task execution status. -Can used special variables like: %{status}, %{taskName} +You can use the following variables: %{status}, %{taskName} =item B<--warning-execution-status> Set warning threshold for last task execution status. -Can used special variables like: %{status}, %{taskName} +You can use the following variables: %{status}, %{taskName} =item B<--critical-execution-status> Set critical threshold for last task execution status (Default: %{status} =~ /deploy_failed|execution_rejected|execution_failed|terminated_timeout/i). -Can used special variables like: %{status}, %{taskName} +You can use the following variables: %{status}, %{taskName} =item B<--warning-*> B<--critical-*> diff --git a/src/cloud/vmware/velocloud/restapi/mode/edgestatus.pm b/src/cloud/vmware/velocloud/restapi/mode/edgestatus.pm index 82d3ee67d..bcc8c6cf6 100644 --- a/src/cloud/vmware/velocloud/restapi/mode/edgestatus.pm +++ b/src/cloud/vmware/velocloud/restapi/mode/edgestatus.pm @@ -128,19 +128,19 @@ Filter edge by name (Can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{edge_state} =~ /NEVER_ACTIVATED/'). -Can used special variables like: %{edge_state}, %{service_state}, +You can use the following variables: %{edge_state}, %{service_state}, %{ha_state}, %{activation_state}. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{edge_state}, %{service_state}, +You can use the following variables: %{edge_state}, %{service_state}, %{ha_state}, %{activation_state}. =item B<--critical-status> Set critical threshold for status (Default: '%{edge_state} !~ /CONNECTED/ && %{edge_state} !~ /NEVER_ACTIVATED/'). -Can used special variables like: %{edge_state}, %{service_state}, +You can use the following variables: %{edge_state}, %{service_state}, %{ha_state}, %{activation_state}. =back diff --git a/src/cloud/vmware/velocloud/restapi/mode/linkstatus.pm b/src/cloud/vmware/velocloud/restapi/mode/linkstatus.pm index 80966e52f..cd5b9193e 100644 --- a/src/cloud/vmware/velocloud/restapi/mode/linkstatus.pm +++ b/src/cloud/vmware/velocloud/restapi/mode/linkstatus.pm @@ -182,7 +182,7 @@ Filter link by name (Can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{vpn_state}, %{backup_state}. +You can use the following variables: %{state}, %{vpn_state}, %{backup_state}. =item B<--warning-*> B<--critical-*> diff --git a/src/database/couchdb/restapi/mode/server.pm b/src/database/couchdb/restapi/mode/server.pm index 8200b73d9..ff1235c7c 100644 --- a/src/database/couchdb/restapi/mode/server.pm +++ b/src/database/couchdb/restapi/mode/server.pm @@ -210,32 +210,32 @@ Filter database name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^ok/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-compaction-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{compaction_status}, %{display} +You can use the following variables: %{compaction_status}, %{display} =item B<--warning-compaction-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{compaction_status}, %{display} +You can use the following variables: %{compaction_status}, %{display} =item B<--critical-compaction-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{compaction_status}, %{display} +You can use the following variables: %{compaction_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/database/db2/mode/hadr.pm b/src/database/db2/mode/hadr.pm index a110677d7..d367846ea 100644 --- a/src/database/db2/mode/hadr.pm +++ b/src/database/db2/mode/hadr.pm @@ -216,47 +216,47 @@ Check high availability disaster recovery. =item B<--unknown-connection-status> Set unknown threshold for connection status. -Can used special variables like: %{status}, %{primaryMember}, %{standbyMember}, %{standbyId} +You can use the following variables: %{status}, %{primaryMember}, %{standbyMember}, %{standbyId} =item B<--warning-connection-status> Set warning threshold for connection status (Default: '%{status} eq "congested"'). -Can used special variables like: %{status}, %{primaryMember}, %{standbyMember}, %{standbyId} +You can use the following variables: %{status}, %{primaryMember}, %{standbyMember}, %{standbyId} =item B<--critical-connection-status> Set critical threshold for connection status (Default: '%{status} eq "disconnected"'). -Can used special variables like: %{status}, %{primaryMember}, %{standbyMember}, %{standbyId} +You can use the following variables: %{status}, %{primaryMember}, %{standbyMember}, %{standbyId} =item B<--unknown-state> Set unknown threshold for state. -Can used special variables like: %{state}, %{primaryMember}, %{standbyMember}, %{standbyId} +You can use the following variables: %{state}, %{primaryMember}, %{standbyMember}, %{standbyId} =item B<--warning-state> Set warning threshold for state. -Can used special variables like: %{state}, %{primaryMember}, %{standbyMember}, %{standbyId} +You can use the following variables: %{state}, %{primaryMember}, %{standbyMember}, %{standbyId} =item B<--critical-state> Set critical threshold for state (Default: '%{state} ne "peer"'). -Can used special variables like: %{state}, %{primaryMember}, %{standbyMember}, %{standbyId} +You can use the following variables: %{state}, %{primaryMember}, %{standbyMember}, %{standbyId} =item B<--unknown-role> Set unknown threshold for role status. -Can used special variables like: %{role}, %{roleLast}, %{primaryMember}, %{primaryMemberLast}, %{standbyMember}, %{standbyMemberLast}, %{standbyId} +You can use the following variables: %{role}, %{roleLast}, %{primaryMember}, %{primaryMemberLast}, %{standbyMember}, %{standbyMemberLast}, %{standbyId} =item B<--warning-role> Set warning threshold for role status. -Can used special variables like: %{role}, %{roleLast}, %{primaryMember}, %{primaryMemberLast}, %{standbyMember}, %{standbyMemberLast}, %{standbyId} +You can use the following variables: %{role}, %{roleLast}, %{primaryMember}, %{primaryMemberLast}, %{standbyMember}, %{standbyMemberLast}, %{standbyId} =item B<--critical-role> Set critical threshold for role status. -Can used special variables like: %{role}, %{roleLast}, %{primaryMember}, %{primaryMemberLast}, %{standbyMember}, %{standbyMemberLast}, %{standbyId} +You can use the following variables: %{role}, %{roleLast}, %{primaryMember}, %{primaryMemberLast}, %{standbyMember}, %{standbyMemberLast}, %{standbyId} =item B<--warning-*> B<--critical-*> diff --git a/src/database/db2/mode/tablespaces.pm b/src/database/db2/mode/tablespaces.pm index 5177911fa..eafa55045 100644 --- a/src/database/db2/mode/tablespaces.pm +++ b/src/database/db2/mode/tablespaces.pm @@ -291,17 +291,17 @@ Filter tablespaces by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{tbsname}, %{type}, %{state} +You can use the following variables: %{tbsname}, %{type}, %{state} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{tbsname}, %{type}, %{state} +You can use the following variables: %{tbsname}, %{type}, %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /normal/i'). -Can used special variables like: %{tbsname}, %{type}, %{state} +You can use the following variables: %{tbsname}, %{type}, %{state} =item B<--warning-*> B<--critical-*> diff --git a/src/database/elasticsearch/restapi/mode/clusterstatistics.pm b/src/database/elasticsearch/restapi/mode/clusterstatistics.pm index a2b5f55e9..8d4d2e164 100644 --- a/src/database/elasticsearch/restapi/mode/clusterstatistics.pm +++ b/src/database/elasticsearch/restapi/mode/clusterstatistics.pm @@ -279,12 +279,12 @@ Can be: 'nodes-total', 'nodes-data', 'nodes-coordinating', =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /yellow/i') -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /red/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =back diff --git a/src/database/elasticsearch/restapi/mode/indicestatistics.pm b/src/database/elasticsearch/restapi/mode/indicestatistics.pm index 53e1d7be8..7e0f301d7 100644 --- a/src/database/elasticsearch/restapi/mode/indicestatistics.pm +++ b/src/database/elasticsearch/restapi/mode/indicestatistics.pm @@ -199,12 +199,12 @@ Can be: 'documents-total', 'data-size-primaries', =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /yellow/i') -Can used special variables like: %{display}, %{status}. +You can use the following variables: %{display}, %{status}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /red/i'). -Can used special variables like: %{display}, %{status}. +You can use the following variables: %{display}, %{status}. =back diff --git a/src/database/elasticsearch/restapi/mode/license.pm b/src/database/elasticsearch/restapi/mode/license.pm index 1aa9b224c..83aaccac1 100644 --- a/src/database/elasticsearch/restapi/mode/license.pm +++ b/src/database/elasticsearch/restapi/mode/license.pm @@ -97,12 +97,12 @@ Check license. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{type}, %{issued_to}, %{expiry_date_in_seconds}. +You can use the following variables: %{status}, %{type}, %{issued_to}, %{expiry_date_in_seconds}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /active/i'). -Can used special variables like: %{status}, %{type}, %{issued_to}, %{expiry_date_in_seconds}. +You can use the following variables: %{status}, %{type}, %{issued_to}, %{expiry_date_in_seconds}. =back diff --git a/src/database/informix/snmp/mode/chunkstatus.pm b/src/database/informix/snmp/mode/chunkstatus.pm index 39440a730..1d4104c30 100644 --- a/src/database/informix/snmp/mode/chunkstatus.pm +++ b/src/database/informix/snmp/mode/chunkstatus.pm @@ -158,17 +158,17 @@ Filter chunk name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /inconsistent/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/database/mongodb/mode/replicationstatus.pm b/src/database/mongodb/mode/replicationstatus.pm index 7937fe106..fbebdb1f2 100644 --- a/src/database/mongodb/mode/replicationstatus.pm +++ b/src/database/mongodb/mode/replicationstatus.pm @@ -216,23 +216,23 @@ Check replication status =item B<--warning-status> Set warning threshold for checked instance status (Default: ''). -Can used special variables like: %{state}, %{sync_host}. +You can use the following variables: %{state}, %{sync_host}. =item B<--critical-status> Set critical threshold for checked instance status (Default: ''). -Can used special variables like: %{state}, %{sync_host}. +You can use the following variables: %{state}, %{sync_host}. =item B<--warning-member-status> Set warning threshold for members status (Default: '%{state} !~ /PRIMARY|SECONDARY/'). -Can used special variables like: %{name}, %{state}, %{health}, +You can use the following variables: %{name}, %{state}, %{health}, %{slave_delay}, %{priority}. =item B<--critical-member-status> Set critical threshold for members status (Default: '%{health} !~ /up/'). -Can used special variables like: %{name}, %{state}, %{health}, +You can use the following variables: %{name}, %{state}, %{health}, %{slave_delay}, %{priority}. =item B<--warning-instance-replication-lag-seconds> diff --git a/src/database/mssql/mode/failedjobs.pm b/src/database/mssql/mode/failedjobs.pm index 9ef5bb840..95004611a 100644 --- a/src/database/mssql/mode/failedjobs.pm +++ b/src/database/mssql/mode/failedjobs.pm @@ -230,12 +230,12 @@ Display job duration time. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{status}, %{duration} +You can use the following variables: %{name}, %{status}, %{duration} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{name}, %{status}, %{duration} +You can use the following variables: %{name}, %{status}, %{duration} =item B<--warning-*> B<--critical-*> diff --git a/src/database/mysql/mode/backup.pm b/src/database/mysql/mode/backup.pm index a109cbc97..2c3d05c45 100644 --- a/src/database/mysql/mode/backup.pm +++ b/src/database/mysql/mode/backup.pm @@ -158,17 +158,17 @@ Filter backups by type (regexp can be used). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{has_backup}, %{last_error}, %{exit_state}, %{type} +You can use the following variables: %{has_backup}, %{last_error}, %{exit_state}, %{type} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{has_backup}, %{last_error}, %{exit_state}, %{type} +You can use the following variables: %{has_backup}, %{last_error}, %{exit_state}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{has_backup} eq "yes" and %{exit_state} ne "SUCCESS" and %{last_error} ne "NO_ERROR"'). -Can used special variables like: %{has_backup}, %{last_error}, %{exit_state}, %{type} +You can use the following variables: %{has_backup}, %{last_error}, %{exit_state}, %{type} =item B<--warning-*> B<--critical-*> diff --git a/src/database/mysql/mode/passwordexpiration.pm b/src/database/mysql/mode/passwordexpiration.pm index e30952b1f..64a896ce1 100644 --- a/src/database/mysql/mode/passwordexpiration.pm +++ b/src/database/mysql/mode/passwordexpiration.pm @@ -211,12 +211,12 @@ Check user password expiration. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{user}, %{expire}, %{expire_time} +You can use the following variables: %{user}, %{expire}, %{expire_time} =item B<--critical-status> Set critical threshold for status (Default: '%{expire} ne "never" and %{expire_time} == 0'). -Can used special variables like: %{user}, %{expire}, %{expire_time} +You can use the following variables: %{user}, %{expire}, %{expire_time} =back diff --git a/src/database/mysql/mode/replication.pm b/src/database/mysql/mode/replication.pm index 07463bc84..70eed291e 100644 --- a/src/database/mysql/mode/replication.pm +++ b/src/database/mysql/mode/replication.pm @@ -368,32 +368,32 @@ Check MySQL replication (need to use --multiple). =item B<--unknown-connection-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{error_message}, %{display} +You can use the following variables: %{status}, %{error_message}, %{display} =item B<--warning-connection-status> Set warning threshold for status. -Can used special variables like: %{status}, %{error_message}, %{display} +You can use the following variables: %{status}, %{error_message}, %{display} =item B<--critical-connection-status> Set critical threshold for status (Default: '%{status} ne "ok"'). -Can used special variables like: %{status}, %{error_message}, %{display} +You can use the following variables: %{status}, %{error_message}, %{display} =item B<--unknown-replication-status> Set unknown threshold for status (Default: '%{replication_status} =~ /configurationIssue/i'). -Can used special variables like: %{replication_status}, %{display} +You can use the following variables: %{replication_status}, %{display} =item B<--warning-replication-status> Set warning threshold for status (Default: '%{replication_status} =~ /inProgress/i'). -Can used special variables like: %{replication_status}, %{display} +You can use the following variables: %{replication_status}, %{display} =item B<--critical-replication-status> Set critical threshold for status (Default: '%{replication_status} =~ /connectIssueToMaster/i'). -Can used special variables like: %{replication_status}, %{display} +You can use the following variables: %{replication_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/database/oracle/mode/asmdiskgroupusage.pm b/src/database/oracle/mode/asmdiskgroupusage.pm index 87089141b..cf4c65b73 100644 --- a/src/database/oracle/mode/asmdiskgroupusage.pm +++ b/src/database/oracle/mode/asmdiskgroupusage.pm @@ -266,27 +266,27 @@ Threshold critical. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-offline-disks> Set warning threshold for offline disks (Default: '(%{offline_disks} > 0 && %{type} eq "extern") || (%{offline_disks} > 1 && %{type} eq "high")'). -Can used special variables like: %{offline_disks}, %{type}, %{display} +You can use the following variables: %{offline_disks}, %{type}, %{display} =item B<--critical-offline-disks> Set critical threshold for offline disks (Default: '%{offline_disks} > 0 && %{type} =~ /^normal|high$/'). -Can used special variables like: %{offline_disks}, %{type}, %{display} +You can use the following variables: %{offline_disks}, %{type}, %{display} =item B<--units> diff --git a/src/database/oracle/mode/datafilesstatus.pm b/src/database/oracle/mode/datafilesstatus.pm index 71f686576..c2ed0b71d 100644 --- a/src/database/oracle/mode/datafilesstatus.pm +++ b/src/database/oracle/mode/datafilesstatus.pm @@ -246,22 +246,22 @@ Filter data file name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: none). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /offline|invalid/i'). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--warning-online-status> Set warning threshold for online status (Default: '%{online_status} =~ /sysoff/i'). -Can used special variables like: %{display}, %{online_status} +You can use the following variables: %{display}, %{online_status} =item B<--critical-online-status> Set critical threshold for online status (Default: '%{online_status} =~ /offline|recover/i'). -Can used special variables like: %{display}, %{online_status} +You can use the following variables: %{display}, %{online_status} =item B<--warning-*> B<--critical-*> diff --git a/src/database/oracle/mode/dataguard.pm b/src/database/oracle/mode/dataguard.pm index 1c2d1c748..433d7bd94 100644 --- a/src/database/oracle/mode/dataguard.pm +++ b/src/database/oracle/mode/dataguard.pm @@ -193,17 +193,17 @@ Check oracle dataguard. =item B<--unknown-status> Set unknown threshold for status (Default: '%{mrp_status} =~ /undefined/ || %{log_transport} =~ /undefined/'). -Can used special variables like: %{roleLast}, %{role}, %{open_mode}, %{mrp_status}, %{mrp_process}, %{log_transport} +You can use the following variables: %{roleLast}, %{role}, %{open_mode}, %{mrp_status}, %{mrp_process}, %{log_transport} =item B<--warning-status> Set warning threshold for status (Default: '%{mrp_status} =~ /WAIT_FOR_LOG/i and %{log_transport} =~ /LGWR/i'). -Can used special variables like: %{roleLast}, %{role}, %{open_mode}, %{mrp_status}, %{mrp_process}, %{log_transport} +You can use the following variables: %{roleLast}, %{role}, %{open_mode}, %{mrp_status}, %{mrp_process}, %{log_transport} =item B<--critical-status> Set critical threshold for status (Default: '%{roleLast} ne %{role} || %{mrp_status} !~ /undefined|APPLYING_LOG|WAIT_FOR_LOG/i'). -Can used special variables like: %{roleLast}, %{role}, %{open_mode}, %{mrp_status}, %{mrp_process}, %{log_transport} +You can use the following variables: %{roleLast}, %{role}, %{open_mode}, %{mrp_status}, %{mrp_process}, %{log_transport} =item B<--warning-*> B<--critical-*> diff --git a/src/database/oracle/mode/longqueries.pm b/src/database/oracle/mode/longqueries.pm index c495699c9..1e31fbeaf 100644 --- a/src/database/oracle/mode/longqueries.pm +++ b/src/database/oracle/mode/longqueries.pm @@ -182,12 +182,12 @@ Check long sql queries. =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{username}, %{sql_text}, %{since}, %{status} +You can use the following variables: %{username}, %{sql_text}, %{since}, %{status} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{username}, %{sql_text}, %{since}, %{status} +You can use the following variables: %{username}, %{sql_text}, %{since}, %{status} =item B<--timezone> diff --git a/src/database/oracle/mode/passwordexpiration.pm b/src/database/oracle/mode/passwordexpiration.pm index 6f11b694c..16ffad410 100644 --- a/src/database/oracle/mode/passwordexpiration.pm +++ b/src/database/oracle/mode/passwordexpiration.pm @@ -149,12 +149,12 @@ Check user password expiration. =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{username}, %{account_status}, %{expire} +You can use the following variables: %{username}, %{account_status}, %{expire} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{username}, %{account_status}, %{expire} +You can use the following variables: %{username}, %{account_status}, %{expire} =item B<--timezone> diff --git a/src/database/redis/mode/persistence.pm b/src/database/redis/mode/persistence.pm index ca67a3215..ed3c92965 100644 --- a/src/database/redis/mode/persistence.pm +++ b/src/database/redis/mode/persistence.pm @@ -140,12 +140,12 @@ Check RDB persistence status. =item B<--warning-status> Set warning threshold for status (Default: '%{progress_status} =~ /in progress/i'). -Can used special variables like: %{progress_status}, %{status} +You can use the following variables: %{progress_status}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /fail/i'). -Can used special variables like: %{progress_status}, %{status} +You can use the following variables: %{progress_status}, %{status} =item B<--warning-*> diff --git a/src/database/redis/mode/replication.pm b/src/database/redis/mode/replication.pm index ff5add049..c953d76b5 100644 --- a/src/database/redis/mode/replication.pm +++ b/src/database/redis/mode/replication.pm @@ -172,12 +172,12 @@ Check replication status. =item B<--warning-status> Set warning threshold for status (Default: '%{sync_status} =~ /in progress/i'). -Can used special variables like: %{sync_status}, %{link_status}, %{cluster_state} +You can use the following variables: %{sync_status}, %{link_status}, %{cluster_state} =item B<--critical-status> Set critical threshold for status (Default: '%{link_status} =~ /down/i'). -Can used special variables like: %{sync_status}, %{link_status}, %{cluster_state} +You can use the following variables: %{sync_status}, %{link_status}, %{cluster_state} =item B<--warning-*> diff --git a/src/hardware/ats/apc/snmp/mode/outputlines.pm b/src/hardware/ats/apc/snmp/mode/outputlines.pm index 92dbaa7ba..5162c5078 100644 --- a/src/hardware/ats/apc/snmp/mode/outputlines.pm +++ b/src/hardware/ats/apc/snmp/mode/outputlines.pm @@ -199,12 +199,12 @@ Can be: 'voltage', 'current', 'power', 'load', 'load-capacity'. =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /nearoverload/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^(lowload|overload)$/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/hardware/ats/eaton/snmp/mode/system.pm b/src/hardware/ats/eaton/snmp/mode/system.pm index ca9b7af72..c5a5a53d1 100644 --- a/src/hardware/ats/eaton/snmp/mode/system.pm +++ b/src/hardware/ats/eaton/snmp/mode/system.pm @@ -165,17 +165,17 @@ Example: --filter-counters='^status$' =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: operation_mode +You can use the following variables: operation_mode =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: operation_mode +You can use the following variables: operation_mode =item B<--critical-status> Set critical threshold for status (Default: '%{operation_mode} !~ /source1|source2/i'). -Can used special variables like: %{operation_mode} +You can use the following variables: %{operation_mode} =item B<--warning-*> diff --git a/src/hardware/devices/aeg/acm/snmp/mode/acstatus.pm b/src/hardware/devices/aeg/acm/snmp/mode/acstatus.pm index ec61e7818..8f3153b1e 100644 --- a/src/hardware/devices/aeg/acm/snmp/mode/acstatus.pm +++ b/src/hardware/devices/aeg/acm/snmp/mode/acstatus.pm @@ -133,12 +133,12 @@ Check AC plant status. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /true/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/hardware/devices/aeg/acm/snmp/mode/batterystatus.pm b/src/hardware/devices/aeg/acm/snmp/mode/batterystatus.pm index 91da295c1..e49440b75 100644 --- a/src/hardware/devices/aeg/acm/snmp/mode/batterystatus.pm +++ b/src/hardware/devices/aeg/acm/snmp/mode/batterystatus.pm @@ -238,12 +238,12 @@ Example: --filter-counters='^status|current$' =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /onBattery/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /disconnected/i || %{status} =~ /shutdown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/hardware/devices/aeg/acm/snmp/mode/rectifierstatus.pm b/src/hardware/devices/aeg/acm/snmp/mode/rectifierstatus.pm index 3459941d4..ccc1c7f36 100644 --- a/src/hardware/devices/aeg/acm/snmp/mode/rectifierstatus.pm +++ b/src/hardware/devices/aeg/acm/snmp/mode/rectifierstatus.pm @@ -194,12 +194,12 @@ Example: --filter-counters='^status|current$' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /ok|notInstalled/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/hardware/devices/barco/cs/restapi/mode/device.pm b/src/hardware/devices/barco/cs/restapi/mode/device.pm index 6e60800ce..f1d15e64d 100644 --- a/src/hardware/devices/barco/cs/restapi/mode/device.pm +++ b/src/hardware/devices/barco/cs/restapi/mode/device.pm @@ -254,22 +254,22 @@ Example: --filter-counters='status' =item B<--warning-device-status> Set warning threshold (Default: '%{status} =~ /warning/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-device-status> Set critical threshold (Default: '%{status} =~ /error/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-process-status> Set warning threshold. -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--critical-process-status> Set critical threshold. -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm b/src/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm index 3e311b0e4..fc5b67348 100644 --- a/src/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm +++ b/src/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm @@ -151,12 +151,12 @@ Use old legacy command. =item B<--warning-status> Set warning threshold for status (Default: '%{level} =~ /warning|minor/i') -Can used special variables like: %{description}, %{level}, %{type} +You can use the following variables: %{description}, %{level}, %{type} =item B<--critical-status> Set critical threshold for status (Default: '%{level} =~ /critical|major/i'). -Can used special variables like: %{description}, %{level}, %{type} +You can use the following variables: %{description}, %{level}, %{type} =back diff --git a/src/hardware/devices/cisco/cts/snmp/mode/peripherals.pm b/src/hardware/devices/cisco/cts/snmp/mode/peripherals.pm index af98ae90a..689966895 100644 --- a/src/hardware/devices/cisco/cts/snmp/mode/peripherals.pm +++ b/src/hardware/devices/cisco/cts/snmp/mode/peripherals.pm @@ -145,12 +145,12 @@ Filter peripheral by description (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{description} +You can use the following variables: %{status}, %{description} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^registered/'). -Can used special variables like: %{status}, %{description} +You can use the following variables: %{status}, %{description} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/eltek/enexus/snmp/mode/alarms.pm b/src/hardware/devices/eltek/enexus/snmp/mode/alarms.pm index 7a2881360..08d24729c 100644 --- a/src/hardware/devices/eltek/enexus/snmp/mode/alarms.pm +++ b/src/hardware/devices/eltek/enexus/snmp/mode/alarms.pm @@ -153,17 +153,17 @@ Filter name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{lastOpError}, %{display} +You can use the following variables: %{state}, %{status}, %{lastOpError}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "alarm"). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/eltek/enexus/snmp/mode/battery.pm b/src/hardware/devices/eltek/enexus/snmp/mode/battery.pm index 23f5afe0d..74a81b648 100644 --- a/src/hardware/devices/eltek/enexus/snmp/mode/battery.pm +++ b/src/hardware/devices/eltek/enexus/snmp/mode/battery.pm @@ -301,17 +301,17 @@ Check battery. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /minor|warning/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error|major|critical/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/eltek/enexus/snmp/mode/load.pm b/src/hardware/devices/eltek/enexus/snmp/mode/load.pm index 6f77ccd96..9d47fc6c8 100644 --- a/src/hardware/devices/eltek/enexus/snmp/mode/load.pm +++ b/src/hardware/devices/eltek/enexus/snmp/mode/load.pm @@ -198,17 +198,17 @@ Check load. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /minor|warning/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error|major|critical/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/eltek/enexus/snmp/mode/outputs.pm b/src/hardware/devices/eltek/enexus/snmp/mode/outputs.pm index 7f01c1940..80504f621 100644 --- a/src/hardware/devices/eltek/enexus/snmp/mode/outputs.pm +++ b/src/hardware/devices/eltek/enexus/snmp/mode/outputs.pm @@ -176,17 +176,17 @@ Filter name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /notenergized|disconnected/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/gorgy/ntpserver/snmp/mode/globalstatus.pm b/src/hardware/devices/gorgy/ntpserver/snmp/mode/globalstatus.pm index 900015c60..23e965dad 100644 --- a/src/hardware/devices/gorgy/ntpserver/snmp/mode/globalstatus.pm +++ b/src/hardware/devices/gorgy/ntpserver/snmp/mode/globalstatus.pm @@ -176,22 +176,22 @@ Example: --filter-counters='^sync-status$' =item B<--warning-sync-status> Set warning threshold for status (Default: '%{sync_status} =~ /Running with autonomy|Free running/i'). -Can used special variables like: %{sync_status} +You can use the following variables: %{sync_status} =item B<--critical-sync-status> Set critical threshold for status (Default: '%{sync_status} =~ /Server locked|Never synchronized|Server not synchronized/i'). -Can used special variables like: %{sync_status} +You can use the following variables: %{sync_status} =item B<--warning-timebase-status> Set warning threshold for status (Default: '%{timebase_status} =~ /^(?!(XO|XO OK|TCXO Precision < 2usec|OCXO Precision < 1usec)$)/i'). -Can used special variables like: %{timebase_status} +You can use the following variables: %{timebase_status} =item B<--critical-timebase-status> Set critical threshold for status (Default: '%{timebase_status} =~ /^XO$/i'). -Can used special variables like: %{timebase_status} +You can use the following variables: %{timebase_status} =item B<--warning-*> diff --git a/src/hardware/devices/hikvision/nvr/isapi/mode/disks.pm b/src/hardware/devices/hikvision/nvr/isapi/mode/disks.pm index 90e75b34c..3d73e6035 100644 --- a/src/hardware/devices/hikvision/nvr/isapi/mode/disks.pm +++ b/src/hardware/devices/hikvision/nvr/isapi/mode/disks.pm @@ -191,17 +191,17 @@ Filter disks by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /reparing/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error|smartFailed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/hikvision/nvr/isapi/mode/protocols.pm b/src/hardware/devices/hikvision/nvr/isapi/mode/protocols.pm index 0b700a6d5..52b0635a3 100644 --- a/src/hardware/devices/hikvision/nvr/isapi/mode/protocols.pm +++ b/src/hardware/devices/hikvision/nvr/isapi/mode/protocols.pm @@ -109,17 +109,17 @@ Filter protocols by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{enabled}, %{name} +You can use the following variables: %{enabled}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{enabled}, %{name} +You can use the following variables: %{enabled}, %{name} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{enabled}, %{name} +You can use the following variables: %{enabled}, %{name} =back =cut diff --git a/src/hardware/devices/hikvision/nvr/snmp/mode/disks.pm b/src/hardware/devices/hikvision/nvr/snmp/mode/disks.pm index b79c24058..df02f5477 100644 --- a/src/hardware/devices/hikvision/nvr/snmp/mode/disks.pm +++ b/src/hardware/devices/hikvision/nvr/snmp/mode/disks.pm @@ -208,17 +208,17 @@ Filter disks by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning--status> Set warning threshold for status (Default: '%{status} =~ /reparing|formatting/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /abnormal|smartfailed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/hms/ewon/snmp/mode/tags.pm b/src/hardware/devices/hms/ewon/snmp/mode/tags.pm index 7e94b82b6..b3ada4026 100644 --- a/src/hardware/devices/hms/ewon/snmp/mode/tags.pm +++ b/src/hardware/devices/hms/ewon/snmp/mode/tags.pm @@ -301,12 +301,12 @@ E.g: --tag-threshold-warning='tagNameMatch,50' --tag-threshold-critical='tagName =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /alarm/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/masterclock/ntp100gps/snmp/mode/gpsstatus.pm b/src/hardware/devices/masterclock/ntp100gps/snmp/mode/gpsstatus.pm index 1760add95..619ce93f5 100644 --- a/src/hardware/devices/masterclock/ntp100gps/snmp/mode/gpsstatus.pm +++ b/src/hardware/devices/masterclock/ntp100gps/snmp/mode/gpsstatus.pm @@ -120,12 +120,12 @@ Check GPS status =item B<--warning-status> Set warning threshold for status (Default: '%{satellites} =~ /No satellites in view/') -Can used special variables like: %{health}, %{satellites}, %{latitude}, %{longitude} +You can use the following variables: %{health}, %{satellites}, %{latitude}, %{longitude} =item B<--critical-status> Set critical threshold for status (Default: '') -Can used special variables like: %{health}, %{satellites}, %{latitude}, %{longitude} +You can use the following variables: %{health}, %{satellites}, %{latitude}, %{longitude} =back diff --git a/src/hardware/devices/masterclock/ntp100gps/snmp/mode/ntpperformance.pm b/src/hardware/devices/masterclock/ntp100gps/snmp/mode/ntpperformance.pm index be762d67c..583bce197 100644 --- a/src/hardware/devices/masterclock/ntp100gps/snmp/mode/ntpperformance.pm +++ b/src/hardware/devices/masterclock/ntp100gps/snmp/mode/ntpperformance.pm @@ -141,12 +141,12 @@ Check NTP performances =item B<--warning-status> Set warning threshold for status (Default: '%{health} !~ /No leap second today/') -Can used special variables like: %{leap} +You can use the following variables: %{leap} =item B<--critical-status> Set critical threshold for status (Default: '') -Can used special variables like: %{health} +You can use the following variables: %{health} =item B<--warning-*> diff --git a/src/hardware/devices/pexip/infinity/managementapi/mode/alarms.pm b/src/hardware/devices/pexip/infinity/managementapi/mode/alarms.pm index c26277872..ea707784d 100644 --- a/src/hardware/devices/pexip/infinity/managementapi/mode/alarms.pm +++ b/src/hardware/devices/pexip/infinity/managementapi/mode/alarms.pm @@ -155,12 +155,12 @@ Filter by alert name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{level} =~ /warning|minor/i') -Can used special variables like: %{level}, %{details}, %{name} +You can use the following variables: %{level}, %{details}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{level} =~ /critical|major|error/i'). -Can used special variables like: %{level}, %{details}, %{name} +You can use the following variables: %{level}, %{details}, %{name} =item B<--memory> diff --git a/src/hardware/devices/polycom/trio/restapi/mode/device.pm b/src/hardware/devices/polycom/trio/restapi/mode/device.pm index d7fefa9d6..162f7a65b 100644 --- a/src/hardware/devices/polycom/trio/restapi/mode/device.pm +++ b/src/hardware/devices/polycom/trio/restapi/mode/device.pm @@ -149,12 +149,12 @@ Check device cpu, memory and state. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/devices/polycom/trio/restapi/mode/registration.pm b/src/hardware/devices/polycom/trio/restapi/mode/registration.pm index b736f418b..b68241bb9 100644 --- a/src/hardware/devices/polycom/trio/restapi/mode/registration.pm +++ b/src/hardware/devices/polycom/trio/restapi/mode/registration.pm @@ -91,12 +91,12 @@ Check SIP registration. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /registred/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/antenna.pm b/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/antenna.pm index 786fd1346..b02dc5875 100644 --- a/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/antenna.pm +++ b/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/antenna.pm @@ -103,17 +103,17 @@ Check antenna. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /shorted/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /notConnected/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/gnss.pm b/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/gnss.pm index d762e6c4c..6a447dabc 100644 --- a/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/gnss.pm +++ b/src/hardware/devices/timelinkmicro/tms6001/snmp/mode/gnss.pm @@ -97,17 +97,17 @@ Check GNSS. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /nominal/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/hardware/devices/video/appeartv/snmp/mode/alarms.pm b/src/hardware/devices/video/appeartv/snmp/mode/alarms.pm index 7a72bed4d..385847daf 100644 --- a/src/hardware/devices/video/appeartv/snmp/mode/alarms.pm +++ b/src/hardware/devices/video/appeartv/snmp/mode/alarms.pm @@ -173,12 +173,12 @@ Filter by message (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor|warning/i') -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical|major/i'). -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--memory> diff --git a/src/hardware/kvm/adder/aim/snmp/mode/deviceusage.pm b/src/hardware/kvm/adder/aim/snmp/mode/deviceusage.pm index 5e8d653cb..b97a54c63 100644 --- a/src/hardware/kvm/adder/aim/snmp/mode/deviceusage.pm +++ b/src/hardware/kvm/adder/aim/snmp/mode/deviceusage.pm @@ -173,12 +173,12 @@ Filter by device name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: 'not %{status} =~ /online|rebooting|upgrading/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/hardware/kvm/avocent/acs/8000/snmp/mode/serialports.pm b/src/hardware/kvm/avocent/acs/8000/snmp/mode/serialports.pm index b5745789b..99daeadc4 100644 --- a/src/hardware/kvm/avocent/acs/8000/snmp/mode/serialports.pm +++ b/src/hardware/kvm/avocent/acs/8000/snmp/mode/serialports.pm @@ -172,17 +172,17 @@ Filter by serial device name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/pdu/apc/snmp/mode/load.pm b/src/hardware/pdu/apc/snmp/mode/load.pm index 03c056ef1..be9181c76 100644 --- a/src/hardware/pdu/apc/snmp/mode/load.pm +++ b/src/hardware/pdu/apc/snmp/mode/load.pm @@ -290,32 +290,32 @@ Check phase/bank load. =item B<--unknown-bank-status> Set warning threshold for status. -Can used special variables like: %{type}, %{status}, %{display} +You can use the following variables: %{type}, %{status}, %{display} =item B<--warning-bank-status> Set warning threshold for status (Default: '%{status} =~ /low|nearOverload/i'). -Can used special variables like: %{type}, %{status}, %{display} +You can use the following variables: %{type}, %{status}, %{display} =item B<--critical-bank-status> Set critical threshold for status (Default: '%{status} =~ /^overload/'). -Can used special variables like: %{type}, %{status}, %{display} +You can use the following variables: %{type}, %{status}, %{display} =item B<--unknown-phase-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-phase-status> Set warning threshold for status (Default: '%{status} =~ /low|nearOverload/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-phase-status> Set critical threshold for status (Default: '%{status} =~ /^overload/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/pdu/apc/snmp/mode/outlet.pm b/src/hardware/pdu/apc/snmp/mode/outlet.pm index bb4b88c1b..b1ba1e898 100644 --- a/src/hardware/pdu/apc/snmp/mode/outlet.pm +++ b/src/hardware/pdu/apc/snmp/mode/outlet.pm @@ -245,17 +245,17 @@ Check outlet. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{phase}, %{bank}, %{display} +You can use the following variables: %{status}, %{phase}, %{bank}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /off/'). -Can used special variables like: %{status}, %{phase}, %{bank}, %{display} +You can use the following variables: %{status}, %{phase}, %{bank}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/pdu/cyberpower/snmp/mode/load.pm b/src/hardware/pdu/cyberpower/snmp/mode/load.pm index 6702b800b..8ee80e52f 100644 --- a/src/hardware/pdu/cyberpower/snmp/mode/load.pm +++ b/src/hardware/pdu/cyberpower/snmp/mode/load.pm @@ -287,32 +287,32 @@ Check phase/bank load. =item B<--unknown-bank-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-bank-status> Set warning threshold for status (Default: '%{state} =~ /low|nearOverload/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-bank-status> Set critical threshold for status (Default: '%{state} =~ /^overload/'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--unknown-phase-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-phase-status> Set warning threshold for status (Default: '%{state} =~ /low|nearOverload/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-phase-status> Set critical threshold for status (Default: '%{state} =~ /^overload/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/pdu/cyberpower/snmp/mode/outlets.pm b/src/hardware/pdu/cyberpower/snmp/mode/outlets.pm index 43ced5bc1..cce57f30f 100644 --- a/src/hardware/pdu/cyberpower/snmp/mode/outlets.pm +++ b/src/hardware/pdu/cyberpower/snmp/mode/outlets.pm @@ -285,17 +285,17 @@ Check outlets. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %%{state}, %{phase}, %{bank}, %{display} +You can use the following variables: %%{state}, %{phase}, %{bank}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{phase}, %{bank}, %{display} +You can use the following variables: %{state}, %{phase}, %{bank}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /off/'). -Can used special variables like: %{state}, %{phase}, %{bank}, %{display} +You can use the following variables: %{state}, %{phase}, %{bank}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/pdu/eaton/snmp/mode/environment.pm b/src/hardware/pdu/eaton/snmp/mode/environment.pm index d1217d5b1..678f1a1bf 100644 --- a/src/hardware/pdu/eaton/snmp/mode/environment.pm +++ b/src/hardware/pdu/eaton/snmp/mode/environment.pm @@ -233,32 +233,32 @@ Check pdu environmental sensors. =item B<--unknown-temperature-status> Set unknon threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-temperature-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-temperature-status> Set critical threshold for status (Default: '%{status} eq "bad"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--unknown-humidity-status> Set unknon threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-humidity-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-humidity-status> Set critical threshold for status (Default: '%{status} eq "bad"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/pdu/emerson/snmp/mode/globalstatus.pm b/src/hardware/pdu/emerson/snmp/mode/globalstatus.pm index 381528c2a..4db44b194 100644 --- a/src/hardware/pdu/emerson/snmp/mode/globalstatus.pm +++ b/src/hardware/pdu/emerson/snmp/mode/globalstatus.pm @@ -136,7 +136,7 @@ sub manage_selection { } if (scalar(keys %{$self->{pdu}}) <= 0) { - $self->{output}->add_option_msg(short_msg => "Cannot found pdu."); + $self->{output}->add_option_msg(short_msg => "Cannot find pdu."); $self->{output}->option_exit(); } } @@ -158,12 +158,12 @@ Filter PDU name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /normalWithWarning/i'). -Can used special variables like: %{status}, %{display}. +You can use the following variables: %{status}, %{display}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /normalWithAlarm|abnormalOperation/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/hardware/pdu/emerson/snmp/mode/psusage.pm b/src/hardware/pdu/emerson/snmp/mode/psusage.pm index dedd3e510..2be6f63e1 100644 --- a/src/hardware/pdu/emerson/snmp/mode/psusage.pm +++ b/src/hardware/pdu/emerson/snmp/mode/psusage.pm @@ -197,7 +197,7 @@ sub manage_selection { } if (scalar(keys %{$self->{ps}}) <= 0) { - $self->{output}->add_option_msg(short_msg => "Cannot found power sources."); + $self->{output}->add_option_msg(short_msg => "Cannot find power sources."); $self->{output}->option_exit(); } } diff --git a/src/hardware/pdu/emerson/snmp/mode/receptacles.pm b/src/hardware/pdu/emerson/snmp/mode/receptacles.pm index 63fd0b6f2..83aadf183 100644 --- a/src/hardware/pdu/emerson/snmp/mode/receptacles.pm +++ b/src/hardware/pdu/emerson/snmp/mode/receptacles.pm @@ -255,17 +255,17 @@ Filter receptable branch name (can be a regexp). =item B<--unknown-rcp-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{oper_state}, %{power_state}, %{display} +You can use the following variables: %{oper_state}, %{power_state}, %{display} =item B<--warning-rcp-status> Set warning threshold for status (Default: '%{oper_state} =~ /warning|alarm/'). -Can used special variables like: %{oper_state}, %{power_state}, %{display} +You can use the following variables: %{oper_state}, %{power_state}, %{display} =item B<--critical-rcp-status> Set critical threshold for status (Default: '%{oper_state} =~ /abnormal/'). -Can used special variables like: %{oper_state}, %{power_state}, %{display} +You can use the following variables: %{oper_state}, %{power_state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/printers/standard/rfc3805/mode/coverstatus.pm b/src/hardware/printers/standard/rfc3805/mode/coverstatus.pm index 7e66cfb1a..18c59293f 100644 --- a/src/hardware/printers/standard/rfc3805/mode/coverstatus.pm +++ b/src/hardware/printers/standard/rfc3805/mode/coverstatus.pm @@ -111,17 +111,17 @@ Check covers of the printer. =item B<--unknown-status> Set unknown threshold for status (Default: '%%{status} =~ /other|unknown/'). -Can used special variables like: %{status}, %{description} +You can use the following variables: %{status}, %{description} =item B<--warning-status> Set warning threshold for status (Default: '%%{status} =~ /coverOpen|interlockOpen/'). -Can used special variables like: %{status}, %{description} +You can use the following variables: %{status}, %{description} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{description} +You can use the following variables: %{status}, %{description} =back diff --git a/src/hardware/sensors/apc/snmp/mode/components/humidity.pm b/src/hardware/sensors/apc/snmp/mode/components/humidity.pm index fa955c468..b1c48ccc2 100644 --- a/src/hardware/sensors/apc/snmp/mode/components/humidity.pm +++ b/src/hardware/sensors/apc/snmp/mode/components/humidity.pm @@ -95,7 +95,7 @@ sub check_module_humidity { ); } - my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'humidity', instance => $instance, value => $result->{temp}); + my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'humidity', instance => $instance, value => $result->{humidity}); if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { $self->{output}->output_add( severity => $exit2, diff --git a/src/hardware/server/cisco/ucs/snmp/mode/auditlogs.pm b/src/hardware/server/cisco/ucs/snmp/mode/auditlogs.pm index 83013477a..2447eb772 100644 --- a/src/hardware/server/cisco/ucs/snmp/mode/auditlogs.pm +++ b/src/hardware/server/cisco/ucs/snmp/mode/auditlogs.pm @@ -210,12 +210,12 @@ Check audit logs. =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor|warning/') -Can used special variables like: %{severity}, %{description}, %{dn} +You can use the following variables: %{severity}, %{description}, %{dn} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /major|critical/'). -Can used special variables like: %{severity}, %{description}, %{dn} +You can use the following variables: %{severity}, %{description}, %{dn} =item B<--memory> diff --git a/src/hardware/server/cisco/ucs/snmp/mode/faults.pm b/src/hardware/server/cisco/ucs/snmp/mode/faults.pm index 779076b9c..3c8659dc7 100644 --- a/src/hardware/server/cisco/ucs/snmp/mode/faults.pm +++ b/src/hardware/server/cisco/ucs/snmp/mode/faults.pm @@ -216,12 +216,12 @@ Check faults. =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor|warning/') -Can used special variables like: %{severity}, %{description}, %{dn} +You can use the following variables: %{severity}, %{description}, %{dn} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /major|critical/'). -Can used special variables like: %{severity}, %{description}, %{dn} +You can use the following variables: %{severity}, %{description}, %{dn} =item B<--memory> diff --git a/src/hardware/server/cisco/ucs/snmp/mode/mgmtentities.pm b/src/hardware/server/cisco/ucs/snmp/mode/mgmtentities.pm index 298189da6..83fd1f32e 100644 --- a/src/hardware/server/cisco/ucs/snmp/mode/mgmtentities.pm +++ b/src/hardware/server/cisco/ucs/snmp/mode/mgmtentities.pm @@ -151,17 +151,17 @@ Check management entities. =item B<--unknown-status> Set unknown threshold for status (Default: '%{role} =~ /unknown/ or %{status} eq "unknown" or %{services_status} eq "unknown"') -Can used special variables like: %{dn}, %{role}, %{services_status}, %{status} +You can use the following variables: %{dn}, %{role}, %{services_status}, %{status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{dn}, %{role}, %{services_status}, %{status} +You can use the following variables: %{dn}, %{role}, %{services_status}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{role} =~ /electionFailed|inapplicable/ or %{status} eq "down" or %{services_status} eq "down"'). -Can used special variables like: %{dn}, %{role}, %{services_status}, %{status} +You can use the following variables: %{dn}, %{role}, %{services_status}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/server/cisco/ucs/snmp/mode/serviceprofile.pm b/src/hardware/server/cisco/ucs/snmp/mode/serviceprofile.pm index 2ea17a6ed..38b72d785 100644 --- a/src/hardware/server/cisco/ucs/snmp/mode/serviceprofile.pm +++ b/src/hardware/server/cisco/ucs/snmp/mode/serviceprofile.pm @@ -152,12 +152,12 @@ Check service profiles. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{dn}, %{status} +You can use the following variables: %{dn}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "offline"'). -Can used special variables like: %{dn}, %{status} +You can use the following variables: %{dn}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/server/dell/idrac/snmp/mode/globalstatus.pm b/src/hardware/server/dell/idrac/snmp/mode/globalstatus.pm index bc87ee19d..669d5cdec 100644 --- a/src/hardware/server/dell/idrac/snmp/mode/globalstatus.pm +++ b/src/hardware/server/dell/idrac/snmp/mode/globalstatus.pm @@ -172,32 +172,32 @@ Check the overall status of iDrac card. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /nonCritical|other/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /critical|nonRecoverable/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-storage-status> Set warning threshold for status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-storage-status> Set warning threshold for status (Default: '%{status} =~ /nonCritical|other/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-storage-status> Set critical threshold for status (Default: '%{status} =~ /critical|nonRecoverable/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/hardware/server/dell/vxm/restapi/mode/chassis.pm b/src/hardware/server/dell/vxm/restapi/mode/chassis.pm index 8d64d2cb5..8df042435 100644 --- a/src/hardware/server/dell/vxm/restapi/mode/chassis.pm +++ b/src/hardware/server/dell/vxm/restapi/mode/chassis.pm @@ -171,32 +171,32 @@ Filter clusters by serial number (Can be a regexp). =item B<--unknown-chassis-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{chassisSn} +You can use the following variables: %{status}, %{chassisSn} =item B<--warning-chassis-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{status}, %{chassisSn} +You can use the following variables: %{status}, %{chassisSn} =item B<--critical-chassis-status> Set critical threshold for status (Default: '%{status} =~ /critical|error/i'). -Can used special variables like: %{status}, %{chassisSn} +You can use the following variables: %{status}, %{chassisSn} =item B<--unknown-psu-status> Set unknown threshold for power supply status. -Can used special variables like: %{status}, %{chassisSn}, %{psuName} +You can use the following variables: %{status}, %{chassisSn}, %{psuName} =item B<--warning-psu-status> Set warning threshold for power supply status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{status}, %{chassisSn}, %{psuName} +You can use the following variables: %{status}, %{chassisSn}, %{psuName} =item B<--critical-psu-status> Set critical threshold for power supply status (Default: '%{status} =~ /critical|error/i'). -Can used special variables like: %{status}, %{chassisSn}, %{psuName} +You can use the following variables: %{status}, %{chassisSn}, %{psuName} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/server/dell/vxm/restapi/mode/hosts.pm b/src/hardware/server/dell/vxm/restapi/mode/hosts.pm index 1fc446aa6..073a82a04 100644 --- a/src/hardware/server/dell/vxm/restapi/mode/hosts.pm +++ b/src/hardware/server/dell/vxm/restapi/mode/hosts.pm @@ -226,47 +226,47 @@ Filter hosts by name (Can be a regexp). =item B<--unknown-host-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name}, %{sn} +You can use the following variables: %{status}, %{name}, %{sn} =item B<--warning-host-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{status}, %{name}, %{sn} +You can use the following variables: %{status}, %{name}, %{sn} =item B<--critical-host-status> Set critical threshold for status (Default: '%{status} =~ /critical|error/i'). -Can used special variables like: %{status}, %{name}, %{sn} +You can use the following variables: %{status}, %{name}, %{sn} =item B<--unknown-nic-status> Set unknown threshold for nic status. -Can used special variables like: %{status}, %{mac}, %{slot} +You can use the following variables: %{status}, %{mac}, %{slot} =item B<--warning-nic-status> Set warning threshold for nic status. -Can used special variables like: %{status}, %{mac}, %{slot} +You can use the following variables: %{status}, %{mac}, %{slot} =item B<--critical-nic-status> Set critical threshold for nic status -Can used special variables like: %{status}, %{mac}, %{slot} +You can use the following variables: %{status}, %{mac}, %{slot} =item B<--unknown-disk-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{sn}, %{bay}, %{slot} +You can use the following variables: %{status}, %{sn}, %{bay}, %{slot} =item B<--warning-disk-status> Set warning threshold for status. -Can used special variables like: %{status}, %{sn}, %{bay}, %{slot} +You can use the following variables: %{status}, %{sn}, %{bay}, %{slot} =item B<--critical-disk-status> Set critical threshold for status (Default: '%{status} !~ /OK/i'). -Can used special variables like: %{status}, %{sn}, %{bay}, %{slot} +You can use the following variables: %{status}, %{sn}, %{bay}, %{slot} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/server/hp/oneview/restapi/mode/storagepools.pm b/src/hardware/server/hp/oneview/restapi/mode/storagepools.pm index 1e9961ce3..3dc3108d8 100644 --- a/src/hardware/server/hp/oneview/restapi/mode/storagepools.pm +++ b/src/hardware/server/hp/oneview/restapi/mode/storagepools.pm @@ -173,17 +173,17 @@ Filter pool name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /critical/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/server/ibm/hmc/ssh/mode/ledstatus.pm b/src/hardware/server/ibm/hmc/ssh/mode/ledstatus.pm index 7508679d7..0917e5971 100644 --- a/src/hardware/server/ibm/hmc/ssh/mode/ledstatus.pm +++ b/src/hardware/server/ibm/hmc/ssh/mode/ledstatus.pm @@ -153,22 +153,22 @@ Format of names: systemname[:lparname] =item B<--warning-physical-status> Set warning threshold (Default: ''). -Can used special variables like: %{ledstate}, %{display} +You can use the following variables: %{ledstate}, %{display} =item B<--critical-physical-status> Set critical threshold (Default: '%{ledstate} =~ /on/'). -Can used special variables like: %{ledstate}, %{display} +You can use the following variables: %{ledstate}, %{display} =item B<--warning-virtuallpar-status> Set warning threshold (Default: ''). -Can used special variables like: %{ledstate}, %{display} +You can use the following variables: %{ledstate}, %{display} =item B<--critical-virtuallpar-status> Set critical threshold (Default: '%{ledstate} =~ /on/'). -Can used special variables like: %{ledstate}, %{display} +You can use the following variables: %{ledstate}, %{display} =back diff --git a/src/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm b/src/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm index 87e1c7527..9fed566df 100644 --- a/src/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm +++ b/src/hardware/server/ibm/mgmt_cards/imm/snmp/mode/eventlog.pm @@ -159,12 +159,12 @@ Check alarms. =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /warning/i') -Can used special variables like: %{severity}, %{text}, %{since} +You can use the following variables: %{severity}, %{text}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /error/i'). -Can used special variables like: %{severity}, %{text}, %{since} +You can use the following variables: %{severity}, %{text}, %{since} =item B<--timezone> diff --git a/src/hardware/telephony/avaya/aes/snmp/mode/services.pm b/src/hardware/telephony/avaya/aes/snmp/mode/services.pm index b349f163f..8843b4bea 100644 --- a/src/hardware/telephony/avaya/aes/snmp/mode/services.pm +++ b/src/hardware/telephony/avaya/aes/snmp/mode/services.pm @@ -293,32 +293,32 @@ Filter service name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{state}, %{license_error}, %{display} +You can use the following variables: %{status}, %{state}, %{license_error}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{state}, %{license_error}, %{display} +You can use the following variables: %{status}, %{state}, %{license_error}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} ne "running" or %{status} ne "online"'). -Can used special variables like: %{status}, %{state}, %{license_error}, %{display} +You can use the following variables: %{status}, %{state}, %{license_error}, %{display} =item B<--unknown-aep-status> Set unknown threshold for status. -Can used special variables like: %{link_state}, %{session_state}, %{display} +You can use the following variables: %{link_state}, %{session_state}, %{display} =item B<--warning-aep-status> Set warning threshold for status. -Can used special variables like: %{link_state}, %{session_state}, %{display} +You can use the following variables: %{link_state}, %{session_state}, %{display} =item B<--critical-aep-status> Set critical threshold for status (Default: '%{link_state} ne "online" or %{session_state} ne "online"'). -Can used special variables like: %{link_state}, %{session_state}, %{display} +You can use the following variables: %{link_state}, %{session_state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/telephony/avaya/cm/snmp/mode/trunks.pm b/src/hardware/telephony/avaya/cm/snmp/mode/trunks.pm index eeaeba713..022adcb1a 100644 --- a/src/hardware/telephony/avaya/cm/snmp/mode/trunks.pm +++ b/src/hardware/telephony/avaya/cm/snmp/mode/trunks.pm @@ -140,17 +140,17 @@ Filter signaling group instance (can be a regexp). =item B<--unknown-sig-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{far_node}, %{display} +You can use the following variables: %{state}, %{far_node}, %{display} =item B<--warning-sig-status> Set warning threshold for status. -Can used special variables like: %{state}, %{far_node}, %{display} +You can use the following variables: %{state}, %{far_node}, %{display} =item B<--critical-sig-status> Set critical threshold for status (Default: '%{state} =~ /out-of-service/'). -Can used special variables like: %{state}, %{far_node}, %{display} +You can use the following variables: %{state}, %{far_node}, %{display} =back diff --git a/src/hardware/telephony/avaya/mediagateway/snmp/mode/controllerstatus.pm b/src/hardware/telephony/avaya/mediagateway/snmp/mode/controllerstatus.pm index 2119e3627..0e7114cf5 100644 --- a/src/hardware/telephony/avaya/mediagateway/snmp/mode/controllerstatus.pm +++ b/src/hardware/telephony/avaya/mediagateway/snmp/mode/controllerstatus.pm @@ -121,17 +121,17 @@ Check controller status. =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{h248_link_status}, %{registration_state} +You can use the following variables: %{h248_link_status}, %{registration_state} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{h248_link_status}, %{registration_state} +You can use the following variables: %{h248_link_status}, %{registration_state} =item B<--critical-status> Set critical threshold for status (Default: '%{h248_link_status} =~ /down/i || %{registration_state} =~ /notRegistred/i'). -Can used special variables like: %{h248_link_status}, %{registration_state} +You can use the following variables: %{h248_link_status}, %{registration_state} =back diff --git a/src/hardware/ups/alpha/snmp/mode/batterystatus.pm b/src/hardware/ups/alpha/snmp/mode/batterystatus.pm index 566e2bc39..7ee13b2c9 100644 --- a/src/hardware/ups/alpha/snmp/mode/batterystatus.pm +++ b/src/hardware/ups/alpha/snmp/mode/batterystatus.pm @@ -161,17 +161,17 @@ Example: --filter-counters='^status|load$' =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /batteryLow/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /batteryDepleted/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/hardware/ups/apc/snmp/mode/batterystatus.pm b/src/hardware/ups/apc/snmp/mode/batterystatus.pm index cf69138d4..352d0b0bf 100644 --- a/src/hardware/ups/apc/snmp/mode/batterystatus.pm +++ b/src/hardware/ups/apc/snmp/mode/batterystatus.pm @@ -341,47 +341,47 @@ Example: --filter-counters='^status|load$' =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{replace} +You can use the following variables: %{status}, %{replace} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /batteryLow/i'). -Can used special variables like: %{status}, %{replace} +You can use the following variables: %{status}, %{replace} =item B<--critical-status> Set critical threshold for status (Default: '%{replace} =~ /yes/i'). -Can used special variables like: %{status}, %{replace} +You can use the following variables: %{status}, %{replace} =item B<--unknown-battery-pack-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-battery-pack-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-battery-pack-status> Set critical threshold for status (Default: '%{status} ne "OK"'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-cartridge-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-cartridge-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-cartridge-status> Set critical threshold for status (Default: '%{status} ne "OK"'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/apc/snmp/mode/inputlines.pm b/src/hardware/ups/apc/snmp/mode/inputlines.pm index f1761aea7..d6490f5d6 100644 --- a/src/hardware/ups/apc/snmp/mode/inputlines.pm +++ b/src/hardware/ups/apc/snmp/mode/inputlines.pm @@ -150,12 +150,12 @@ Example: --filter-counters='^frequence|voltage$' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{last_cause} +You can use the following variables: %{last_cause} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{last_cause} +You can use the following variables: %{last_cause} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/apc/snmp/mode/outputlines.pm b/src/hardware/ups/apc/snmp/mode/outputlines.pm index 6575dceec..bdb59bf12 100644 --- a/src/hardware/ups/apc/snmp/mode/outputlines.pm +++ b/src/hardware/ups/apc/snmp/mode/outputlines.pm @@ -167,17 +167,17 @@ Example: --filter-counters='^status|load$' =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /onLine|rebooting/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/hp/snmp/mode/batterystatus.pm b/src/hardware/ups/hp/snmp/mode/batterystatus.pm index fb96dd58c..d966d4451 100644 --- a/src/hardware/ups/hp/snmp/mode/batterystatus.pm +++ b/src/hardware/ups/hp/snmp/mode/batterystatus.pm @@ -153,17 +153,17 @@ Example: --filter-counters='status|current' =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/hp/snmp/mode/outputlines.pm b/src/hardware/ups/hp/snmp/mode/outputlines.pm index efb9214d6..96403c71c 100644 --- a/src/hardware/ups/hp/snmp/mode/outputlines.pm +++ b/src/hardware/ups/hp/snmp/mode/outputlines.pm @@ -191,17 +191,17 @@ Check output lines metrics. =item B<--unknown-source> Set unknown threshold for status (Default: ''). -Can used special variables like: %{source}. +You can use the following variables: %{source}. =item B<--warning-source> Set warning threshold for status (Default: ''). -Can used special variables like: %{source}. +You can use the following variables: %{source}. =item B<--critical-source> Set critical threshold for status (Default: '%{source} !~ /normal/i'). -Can used special variables like: %{source}. +You can use the following variables: %{source}. =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/mge/snmp/mode/inputlines.pm b/src/hardware/ups/mge/snmp/mode/inputlines.pm index 312b32414..b595d5be6 100644 --- a/src/hardware/ups/mge/snmp/mode/inputlines.pm +++ b/src/hardware/ups/mge/snmp/mode/inputlines.pm @@ -199,12 +199,12 @@ Can be: 'frequence', 'voltage', 'current'. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{badstatus}, %{failcause} +You can use the following variables: %{badstatus}, %{failcause} =item B<--critical-status> Set critical threshold for status (Default: '%{badstatus} =~ /yes/'). -Can used special variables like: %{badstatus}, %{failcause} +You can use the following variables: %{badstatus}, %{failcause} =back diff --git a/src/hardware/ups/powerware/snmp/mode/batterystatus.pm b/src/hardware/ups/powerware/snmp/mode/batterystatus.pm index 5abf20e07..358a7e101 100644 --- a/src/hardware/ups/powerware/snmp/mode/batterystatus.pm +++ b/src/hardware/ups/powerware/snmp/mode/batterystatus.pm @@ -153,17 +153,17 @@ Example: --filter-counters='status|current' =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /batteryDischarging/i'). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}. +You can use the following variables: %{status}. =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/riello/snmp/mode/battery.pm b/src/hardware/ups/riello/snmp/mode/battery.pm index 061d60482..bd21cf342 100644 --- a/src/hardware/ups/riello/snmp/mode/battery.pm +++ b/src/hardware/ups/riello/snmp/mode/battery.pm @@ -160,17 +160,17 @@ Check battery status and charge remaining. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /low/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /depleted/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/riello/snmp/mode/outputlines.pm b/src/hardware/ups/riello/snmp/mode/outputlines.pm index 0e1239d24..f24670482 100644 --- a/src/hardware/ups/riello/snmp/mode/outputlines.pm +++ b/src/hardware/ups/riello/snmp/mode/outputlines.pm @@ -166,17 +166,17 @@ Ignore counters equals to 0. =item B<--unknown-source-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-source-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-source-status> Set critical threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/socomec/netvision/snmp/mode/battery.pm b/src/hardware/ups/socomec/netvision/snmp/mode/battery.pm index c249a737c..fb2c06db5 100644 --- a/src/hardware/ups/socomec/netvision/snmp/mode/battery.pm +++ b/src/hardware/ups/socomec/netvision/snmp/mode/battery.pm @@ -184,17 +184,17 @@ Check battery status and charge remaining. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /low/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /depleted|failure/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/socomec/netvision/snmp/mode/outputlines.pm b/src/hardware/ups/socomec/netvision/snmp/mode/outputlines.pm index d32328ad2..92af18345 100644 --- a/src/hardware/ups/socomec/netvision/snmp/mode/outputlines.pm +++ b/src/hardware/ups/socomec/netvision/snmp/mode/outputlines.pm @@ -194,17 +194,17 @@ Ignore counters equals to 0. =item B<--unknown-source-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-source-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-source-status> Set critical threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm b/src/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm index 227b178a2..ed784045a 100644 --- a/src/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm +++ b/src/hardware/ups/standard/rfc1628/snmp/mode/batterystatus.pm @@ -163,17 +163,17 @@ Check battery status and charge remaining. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /low/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /depleted/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm b/src/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm index ba26ae07f..7699d2f96 100644 --- a/src/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm +++ b/src/hardware/ups/standard/rfc1628/snmp/mode/outputsource.pm @@ -94,17 +94,17 @@ Check output source status. =item B<--unknown-source-status> Set unknown threshold for status (Default: '%{status} =~ /other/') -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-source-status> Set warning threshold for status (Default: '%{status} =~ /bypass|battery|booster|reducer/') -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-source-status> Set critical threshold for status (Default: '%{status} =~ /none/') -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/network/a10/ax/snmp/mode/vserverusage.pm b/src/network/a10/ax/snmp/mode/vserverusage.pm index 47fb03ed8..697f376dc 100644 --- a/src/network/a10/ax/snmp/mode/vserverusage.pm +++ b/src/network/a10/ax/snmp/mode/vserverusage.pm @@ -203,12 +203,12 @@ Check virtual server usage. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/acmepacket/snmp/mode/sipusage.pm b/src/network/acmepacket/snmp/mode/sipusage.pm index 613f9b7d4..06ebea235 100644 --- a/src/network/acmepacket/snmp/mode/sipusage.pm +++ b/src/network/acmepacket/snmp/mode/sipusage.pm @@ -170,12 +170,12 @@ Check SIP usage. =item B<--warning-status> Set warning threshold for status (Default: -). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /outOfService|constraintsViolation|inServiceTimedOut/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/network/acmepacket/snmp/mode/systemusage.pm b/src/network/acmepacket/snmp/mode/systemusage.pm index f6a371766..0b896f781 100644 --- a/src/network/acmepacket/snmp/mode/systemusage.pm +++ b/src/network/acmepacket/snmp/mode/systemusage.pm @@ -200,12 +200,12 @@ Example: --filter-counters='^memory-usage$' =item B<--warning-replication-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{replication_state} +You can use the following variables: %{replication_state} =item B<--critical-replication-status> Set critical threshold for status (Default: '%{replication_state} =~ /outOfService/i'). -Can used special variables like: %{replication_state} +You can use the following variables: %{replication_state} =item B<--warning-*> diff --git a/src/network/adva/fsp150/snmp/mode/alarms.pm b/src/network/adva/fsp150/snmp/mode/alarms.pm index 90ebd3b7e..2de5d3770 100644 --- a/src/network/adva/fsp150/snmp/mode/alarms.pm +++ b/src/network/adva/fsp150/snmp/mode/alarms.pm @@ -277,12 +277,12 @@ Check alarms. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{description}, %{object}, %{severity}, %{type}, %{label}, %{since} +You can use the following variables: %{description}, %{object}, %{severity}, %{type}, %{label}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} eq "serviceAffecting"'). -Can used special variables like: {description}, %{object}, %{severity}, %{type}, %{label}, %{since} +You can use the following variables: {description}, %{object}, %{severity}, %{type}, %{label}, %{since} =item B<--timezone> diff --git a/src/network/adva/fsp3000/snmp/mode/alarms.pm b/src/network/adva/fsp3000/snmp/mode/alarms.pm index 1733959e9..5fbf342cb 100644 --- a/src/network/adva/fsp3000/snmp/mode/alarms.pm +++ b/src/network/adva/fsp3000/snmp/mode/alarms.pm @@ -301,12 +301,12 @@ Check alarms. =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /warning|minor/i') -Can used special variables like: %{severity}, %{type}, %{label}, %{since} +You can use the following variables: %{severity}, %{type}, %{label}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical|major/i'). -Can used special variables like: %{severity}, %{type}, %{label}, %{since} +You can use the following variables: %{severity}, %{type}, %{label}, %{since} =item B<--timezone> diff --git a/src/network/adva/fsp3000/snmp/mode/interfaces.pm b/src/network/adva/fsp3000/snmp/mode/interfaces.pm index 3e5d63225..fecc74c92 100644 --- a/src/network/adva/fsp3000/snmp/mode/interfaces.pm +++ b/src/network/adva/fsp3000/snmp/mode/interfaces.pm @@ -323,12 +323,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/alcatel/isam/snmp/mode/hubsapusage.pm b/src/network/alcatel/isam/snmp/mode/hubsapusage.pm index 7ca67bc63..20b634f6f 100644 --- a/src/network/alcatel/isam/snmp/mode/hubsapusage.pm +++ b/src/network/alcatel/isam/snmp/mode/hubsapusage.pm @@ -451,12 +451,12 @@ Units of thresholds for the traffic (Default: '%') ('%', 'b/s'). =item B<--warning-status> Set warning threshold for ib status. -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =item B<--critical-status> Set critical threshold for ib status (Default: '%{admin} =~ /up/i and %{status} !~ /up/i'). -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =item B<--warning-*> diff --git a/src/network/alcatel/omniswitch/snmp/mode/virtualchassis.pm b/src/network/alcatel/omniswitch/snmp/mode/virtualchassis.pm index 2db8a5b50..017da89ca 100644 --- a/src/network/alcatel/omniswitch/snmp/mode/virtualchassis.pm +++ b/src/network/alcatel/omniswitch/snmp/mode/virtualchassis.pm @@ -133,17 +133,17 @@ Check virtual chassis. =item B<--unknown-chassis-status> Set unknown threshold for status. -Can used special variables like: %{role}, %{status}, %{mac} +You can use the following variables: %{role}, %{status}, %{mac} =item B<--warning-chassis-status> Set warning threshold for status. -Can used special variables like: %{role}, %{status}, %{mac} +You can use the following variables: %{role}, %{status}, %{mac} =item B<--critical-chassis-status> Set critical threshold for status (Default: %{status} !~ /init|running/) -Can used special variables like: %{role}, %{status}, %{mac} +You can use the following variables: %{role}, %{status}, %{mac} =item B<--warning-*> B<--critical-*> diff --git a/src/network/alcatel/oxe/snmp/mode/trunks.pm b/src/network/alcatel/oxe/snmp/mode/trunks.pm index ec906e4d1..6a0f468bd 100644 --- a/src/network/alcatel/oxe/snmp/mode/trunks.pm +++ b/src/network/alcatel/oxe/snmp/mode/trunks.pm @@ -199,12 +199,12 @@ Filter by trunk name (regexp can be used). =item B<--warning-trunk-status> Set warning threshold for status -Can used special variables like: %{trunkstatus} +You can use the following variables: %{trunkstatus} =item B<--critical-trunk-status> Set critical threshold for status (Default: '%{trunkstatus} =~ /oos/i'). -Can used special variables like: %{trunkstatus} +You can use the following variables: %{trunkstatus} =item B<--warning-*> diff --git a/src/network/alcatel/pss/1830/snmp/mode/sapqosstats.pm b/src/network/alcatel/pss/1830/snmp/mode/sapqosstats.pm index b57102ee9..1296f414d 100644 --- a/src/network/alcatel/pss/1830/snmp/mode/sapqosstats.pm +++ b/src/network/alcatel/pss/1830/snmp/mode/sapqosstats.pm @@ -263,12 +263,12 @@ Filter by SAP name (can be a regexp). =item B<--warning-status> Set warning threshold for ib status. -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =item B<--critical-status> Set critical threshold for ib status (Default: '%{admin} =~ /up/i and %{status} !~ /up/i'). -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =item B<--warning-*> diff --git a/src/network/aruba/aoscx/restapi/mode/vsx.pm b/src/network/aruba/aoscx/restapi/mode/vsx.pm index 1bc3b20ab..8b2e978b5 100644 --- a/src/network/aruba/aoscx/restapi/mode/vsx.pm +++ b/src/network/aruba/aoscx/restapi/mode/vsx.pm @@ -226,47 +226,47 @@ Check virtual switching extension. =item B<--unknown-device-status> Set unknown threshold for status. -Can used special variables like: %{role}, %{config_sync} +You can use the following variables: %{role}, %{config_sync} =item B<--warning-device-status> Set warning threshold for status. -Can used special variables like: %{role}, %{config_sync} +You can use the following variables: %{role}, %{config_sync} =item B<--critical-device-status> Set critical threshold for status. -Can used special variables like: %{role}, %{config_sync} +You can use the following variables: %{role}, %{config_sync} =item B<--unknown-isl-status> Set unknown threshold for status. -Can used special variables like: %{isl_status} +You can use the following variables: %{isl_status} =item B<--warning-isl-status> Set warning threshold for status. -Can used special variables like: %{isl_status} +You can use the following variables: %{isl_status} =item B<--critical-isl-status> Set critical threshold for status (Default: '%{isl_status} =~ /out_sync/'). -Can used special variables like: %{isl_status} +You can use the following variables: %{isl_status} =item B<--unknown-keepalive-status> Set unknown threshold for status. -Can used special variables like: %{keepalive_status} +You can use the following variables: %{keepalive_status} =item B<--warning-keepalive-status> Set warning threshold for status. -Can used special variables like: %{keepalive_status} +You can use the following variables: %{keepalive_status} =item B<--critical-keepalive-status> Set critical threshold for status (Default: '%{keepalive_status} =~ /out_of_sync_established|failed/'). -Can used special variables like: %{keepalive_status} +You can use the following variables: %{keepalive_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/aruba/aoscx/snmp/mode/vsf.pm b/src/network/aruba/aoscx/snmp/mode/vsf.pm index 106f24f0c..6c58b0560 100644 --- a/src/network/aruba/aoscx/snmp/mode/vsf.pm +++ b/src/network/aruba/aoscx/snmp/mode/vsf.pm @@ -236,32 +236,32 @@ Check vsf virtual chassis. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /no_split/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-member-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{role}, %{roleLast}, %{id} +You can use the following variables: %{status}, %{role}, %{roleLast}, %{id} =item B<--warning-member-status> Set warning threshold for status. -Can used special variables like: %{status}, %{role}, %{roleLast}, %{id} +You can use the following variables: %{status}, %{role}, %{roleLast}, %{id} =item B<--critical-member-status> Set critical threshold for status (Default: '%{role} ne %{roleLast} || %{status} !~ /ready|booting/i'). -Can used special variables like: %{status}, %{role}, %{roleLast}, %{id} +You can use the following variables: %{status}, %{role}, %{roleLast}, %{id} =item B<--warning-*> B<--critical-*> diff --git a/src/network/aruba/aoscx/snmp/mode/vsx.pm b/src/network/aruba/aoscx/snmp/mode/vsx.pm index 5ba35b16a..e3b7e1d02 100644 --- a/src/network/aruba/aoscx/snmp/mode/vsx.pm +++ b/src/network/aruba/aoscx/snmp/mode/vsx.pm @@ -253,47 +253,47 @@ Check virtual switching extension. =item B<--unknown-device-status> Set unknown threshold for status. -Can used special variables like: %{role}, %{config_sync} +You can use the following variables: %{role}, %{config_sync} =item B<--warning-device-status> Set warning threshold for status. -Can used special variables like: %{role}, %{config_sync} +You can use the following variables: %{role}, %{config_sync} =item B<--critical-device-status> Set critical threshold for status. -Can used special variables like: %{role}, %{config_sync} +You can use the following variables: %{role}, %{config_sync} =item B<--unknown-isl-status> Set unknown threshold for status. -Can used special variables like: %{isl_status} +You can use the following variables: %{isl_status} =item B<--warning-isl-status> Set warning threshold for status. -Can used special variables like: %{isl_status} +You can use the following variables: %{isl_status} =item B<--critical-isl-status> Set critical threshold for status (Default: '%{isl_status} =~ /outSync/'). -Can used special variables like: %{isl_status} +You can use the following variables: %{isl_status} =item B<--unknown-keepalive-status> Set unknown threshold for status. -Can used special variables like: %{keepalive_status} +You can use the following variables: %{keepalive_status} =item B<--warning-keepalive-status> Set warning threshold for status. -Can used special variables like: %{keepalive_status} +You can use the following variables: %{keepalive_status} =item B<--critical-keepalive-status> Set critical threshold for status (Default: '%{keepalive_status} =~ /outofSyncEstablished|failed/'). -Can used special variables like: %{keepalive_status} +You can use the following variables: %{keepalive_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/aruba/cppm/snmp/mode/interfaces.pm b/src/network/aruba/cppm/snmp/mode/interfaces.pm index 3e3e91643..57afcd56b 100644 --- a/src/network/aruba/cppm/snmp/mode/interfaces.pm +++ b/src/network/aruba/cppm/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/aruba/instant/snmp/mode/apusage.pm b/src/network/aruba/instant/snmp/mode/apusage.pm index a2a5a6f08..89d6e6668 100644 --- a/src/network/aruba/instant/snmp/mode/apusage.pm +++ b/src/network/aruba/instant/snmp/mode/apusage.pm @@ -231,12 +231,12 @@ Filter access point name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /up/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/aruba/instant/snmp/mode/ssidstatus.pm b/src/network/aruba/instant/snmp/mode/ssidstatus.pm index cd4e421b9..08beff166 100644 --- a/src/network/aruba/instant/snmp/mode/ssidstatus.pm +++ b/src/network/aruba/instant/snmp/mode/ssidstatus.pm @@ -136,12 +136,12 @@ Filter SSID name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /enable/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/network/aruba/orchestrator/restapi/mode/alarms.pm b/src/network/aruba/orchestrator/restapi/mode/alarms.pm index 11bf9b529..4d0e59229 100644 --- a/src/network/aruba/orchestrator/restapi/mode/alarms.pm +++ b/src/network/aruba/orchestrator/restapi/mode/alarms.pm @@ -174,12 +174,12 @@ Set timezone for creation time (Default is 'UTC'). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor|warning/i') -Can used special variables like: %{severity}, %{hostname}, %{name}, %{timeraised} +You can use the following variables: %{severity}, %{hostname}, %{name}, %{timeraised} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /major|critical/i'). -Can used special variables like: %{severity}, %{hostname}, %{name}, %{timeraised} +You can use the following variables: %{severity}, %{hostname}, %{name}, %{timeraised} =item B<--warning-*> B<--critical-*> diff --git a/src/network/aruba/orchestrator/restapi/mode/appliances.pm b/src/network/aruba/orchestrator/restapi/mode/appliances.pm index ccc7aed92..ee24c8dab 100644 --- a/src/network/aruba/orchestrator/restapi/mode/appliances.pm +++ b/src/network/aruba/orchestrator/restapi/mode/appliances.pm @@ -169,17 +169,17 @@ Filter appliances by group. =item B<--unknown-status> Set unknown threshold for status (Default: '%{state} =~ /unknown|unreachable/i'). -Can used special variables like: %{state}, %{hostname} +You can use the following variables: %{state}, %{hostname} =item B<--warning-status> Set warning threshold for status (Default: '%{state} =~ /unsupportedVersion|outOfSynchronization/i'). -Can used special variables like: %{state}, %{hostname} +You can use the following variables: %{state}, %{hostname} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{hostname} +You can use the following variables: %{state}, %{hostname} =item B<--warning-*> B<--critical-*> diff --git a/src/network/athonet/epc/snmp/mode/interfacesdiameter.pm b/src/network/athonet/epc/snmp/mode/interfacesdiameter.pm index b27f08c37..c63357696 100644 --- a/src/network/athonet/epc/snmp/mode/interfacesdiameter.pm +++ b/src/network/athonet/epc/snmp/mode/interfacesdiameter.pm @@ -216,32 +216,32 @@ Filter interfaces by owner (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name}, %{owner} +You can use the following variables: %{status}, %{name}, %{owner} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name}, %{owner} +You can use the following variables: %{status}, %{name}, %{owner} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{name}, %{owner} +You can use the following variables: %{status}, %{name}, %{owner} =item B<--unknown-transport-status> Set unknown threshold for status. -Can used special variables like: %{transport_status}, %{transport_type}, %{name} +You can use the following variables: %{transport_status}, %{transport_type}, %{name} =item B<--warning-transport-status> Set warning threshold for status. -Can used special variables like: %{transport_status}, %{transport_type}, %{name} +You can use the following variables: %{transport_status}, %{transport_type}, %{name} =item B<--critical-transport-status> Set critical threshold for status (Default: '%{transport_status} =~ /down/i'). -Can used special variables like: %{transport_status}, %{transport_type}, %{name} +You can use the following variables: %{transport_status}, %{transport_type}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/athonet/epc/snmp/mode/interfacesga.pm b/src/network/athonet/epc/snmp/mode/interfacesga.pm index 1215c4bdf..84a48427b 100644 --- a/src/network/athonet/epc/snmp/mode/interfacesga.pm +++ b/src/network/athonet/epc/snmp/mode/interfacesga.pm @@ -168,17 +168,17 @@ Filter interfaces by peer address (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{local_address}, %{peer_address}, %{name} +You can use the following variables: %{status}, %{local_address}, %{peer_address}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{local_address}, %{peer_address}, %{name} +You can use the following variables: %{status}, %{local_address}, %{peer_address}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{local_address}, %{peer_address}, %{name} +You can use the following variables: %{status}, %{local_address}, %{peer_address}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/athonet/epc/snmp/mode/interfacesgtpc.pm b/src/network/athonet/epc/snmp/mode/interfacesgtpc.pm index 4fa956bd6..5e569cf4b 100644 --- a/src/network/athonet/epc/snmp/mode/interfacesgtpc.pm +++ b/src/network/athonet/epc/snmp/mode/interfacesgtpc.pm @@ -189,17 +189,17 @@ Filter interfaces by type (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{source_address}, %{destination_address} +You can use the following variables: %{status}, %{source_address}, %{destination_address} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{source_address}, %{destination_address} +You can use the following variables: %{status}, %{source_address}, %{destination_address} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{source_address}, %{destination_address} +You can use the following variables: %{status}, %{source_address}, %{destination_address} =item B<--warning-*> B<--critical-*> diff --git a/src/network/athonet/epc/snmp/mode/interfaceslte.pm b/src/network/athonet/epc/snmp/mode/interfaceslte.pm index 58b89752d..c9590e380 100644 --- a/src/network/athonet/epc/snmp/mode/interfaceslte.pm +++ b/src/network/athonet/epc/snmp/mode/interfaceslte.pm @@ -431,17 +431,17 @@ Filter interfaces by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{sctp_status}, %{s1ap_status}, %{name} +You can use the following variables: %{sctp_status}, %{s1ap_status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{sctp_status}, %{s1ap_status}, %{name} +You can use the following variables: %{sctp_status}, %{s1ap_status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{sctp_status} =~ /down/i || %{s1ap_status} =~ /down/i'). -Can used special variables like: %{sctp_status}, %{s1ap_status}, %{name} +You can use the following variables: %{sctp_status}, %{s1ap_status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/atrica/snmp/mode/connections.pm b/src/network/atrica/snmp/mode/connections.pm index 126155d1c..38f7c54e1 100644 --- a/src/network/atrica/snmp/mode/connections.pm +++ b/src/network/atrica/snmp/mode/connections.pm @@ -410,7 +410,7 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up" or =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--critical-status> @@ -418,7 +418,7 @@ Set critical threshold for status. Default (depends of the atrica release): '%{admstatus} eq "on" and %{opstatus} ne "inService"' '%{admstatus} eq "up" and %{opstatus} ne "up"' -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/atto/fibrebridge/snmp/mode/fcportusage.pm b/src/network/atto/fibrebridge/snmp/mode/fcportusage.pm index b8bdccf38..88303079a 100644 --- a/src/network/atto/fibrebridge/snmp/mode/fcportusage.pm +++ b/src/network/atto/fibrebridge/snmp/mode/fcportusage.pm @@ -206,12 +206,12 @@ Filter name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admin} =~ /enabled/ and %{status} !~ /online/'). -Can used special variables like: %{admin}, %{status}, %{display} +You can use the following variables: %{admin}, %{status}, %{display} =back diff --git a/src/network/audiocodes/snmp/mode/trunkstatus.pm b/src/network/audiocodes/snmp/mode/trunkstatus.pm index d062200df..3ea737ed1 100644 --- a/src/network/audiocodes/snmp/mode/trunkstatus.pm +++ b/src/network/audiocodes/snmp/mode/trunkstatus.pm @@ -203,12 +203,12 @@ Filter by name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{alarm}, %{dchannel}, %{state} +You can use the following variables: %{display}, %{alarm}, %{dchannel}, %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /activated/ and %{alarm} !~ /greenActive/i'). -Can used special variables like: %{display}, %{alarm}, %{dchannel}, %{state} +You can use the following variables: %{display}, %{alarm}, %{dchannel}, %{state} =item B<--warning-*> diff --git a/src/network/barracuda/cloudgen/snmp/mode/boxservice.pm b/src/network/barracuda/cloudgen/snmp/mode/boxservice.pm index cd3861feb..7429f44be 100644 --- a/src/network/barracuda/cloudgen/snmp/mode/boxservice.pm +++ b/src/network/barracuda/cloudgen/snmp/mode/boxservice.pm @@ -153,12 +153,12 @@ Check box services status. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^started$/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--filter-name> diff --git a/src/network/barracuda/cloudgen/snmp/mode/serverservice.pm b/src/network/barracuda/cloudgen/snmp/mode/serverservice.pm index c0db10a3b..26907ce21 100644 --- a/src/network/barracuda/cloudgen/snmp/mode/serverservice.pm +++ b/src/network/barracuda/cloudgen/snmp/mode/serverservice.pm @@ -153,12 +153,12 @@ Check server services status. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^started$/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--filter-name> diff --git a/src/network/barracuda/cloudgen/snmp/mode/vpnstatus.pm b/src/network/barracuda/cloudgen/snmp/mode/vpnstatus.pm index bd8a121f7..632572ae0 100644 --- a/src/network/barracuda/cloudgen/snmp/mode/vpnstatus.pm +++ b/src/network/barracuda/cloudgen/snmp/mode/vpnstatus.pm @@ -151,12 +151,12 @@ Check VPNs status. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^down$/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--filter-name> diff --git a/src/network/beeware/snmp/mode/reverseproxyusage.pm b/src/network/beeware/snmp/mode/reverseproxyusage.pm index 7e78721c5..6306d631a 100644 --- a/src/network/beeware/snmp/mode/reverseproxyusage.pm +++ b/src/network/beeware/snmp/mode/reverseproxyusage.pm @@ -182,12 +182,12 @@ Filter reverse proxy (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /running/i'). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--warning-*> diff --git a/src/network/brocade/snmp/mode/interfaces.pm b/src/network/brocade/snmp/mode/interfaces.pm index 1705ec81d..5d74f4563 100644 --- a/src/network/brocade/snmp/mode/interfaces.pm +++ b/src/network/brocade/snmp/mode/interfaces.pm @@ -298,12 +298,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cambium/cnpilot/snmp/mode/connectionstatus.pm b/src/network/cambium/cnpilot/snmp/mode/connectionstatus.pm new file mode 100644 index 000000000..4bc496c3f --- /dev/null +++ b/src/network/cambium/cnpilot/snmp/mode/connectionstatus.pm @@ -0,0 +1,142 @@ +# +# Copyright 2023 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::cambium::cnpilot::snmp::mode::connectionstatus; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng); + +sub prefix_connection_output { + my ($self, %options) = @_; + + return "Access point '" . $options{instance_value}->{name} . "' "; +} + +sub custom_connection_output { + my ($self, %options) = @_; + + return sprintf( + 'connection status: %s', + $self->{result_values}->{connection_status} + ); +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'connection', type => 1, cb_prefix_output => 'prefix_connection_output', message_multiple => 'All connection status are ok' } + ]; + + $self->{maps_counters}->{connection} = [ + { label => 'connection-status', type => 2, + set => { + key_values => [ { name => 'connection_status' }, { name => 'name' } ], + closure_custom_output => $self->can('custom_connection_output'), + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => \&catalog_status_threshold_ng + } + }, + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'filter-ap:s' => { name => 'filter_ap' } + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + my $mapping = { + cambiumAPName => { oid => '.1.3.6.1.4.1.17713.22.1.1.1.2' }, + cambiumAPCnmConstaus => { oid => '.1.3.6.1.4.1.17713.22.1.1.1.12' } + }; + + # Point at the begining of the table + my $oid_cambiumAccessPointEntry = '.1.3.6.1.4.1.17713.22.1.1.1'; + + my $connectionstatus_result = $options{snmp}->get_table( + oid => $oid_cambiumAccessPointEntry, + nothing_quit => 1 + ); + + $self->{connection} = {}; + foreach my $oid (keys %{$connectionstatus_result}) { + next if ($oid !~ /^$mapping->{cambiumAPName}->{oid}\.(.*)$/); + # Catch instance in table + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $connectionstatus_result, instance => $instance); + + if (defined($self->{option_results}->{filter_ap}) && $self->{option_results}->{filter_ap} ne '' && + $result->{cambiumAPName} !~ /$self->{option_results}->{filter_ap}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{cambiumAPName} . "': no matching filter.", debug => 1); + next; + } + + $self->{connection}->{$instance} = { + name => $result->{cambiumAPName}, + connection_status => $result->{cambiumAPCnmConstaus} + }; + + } + + if (scalar(keys %{$self->{connection}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No AP matching with filter found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check Connection status. + +=over 8 + +=item B<--filter-ap> + +Filter on one or several AP. + +=item B<--warning-connection-status> + +Set warning threshold for status. +Can used special variables like: %{status}, %{name} + +=item B<--critical-connection-status> + +Set critical threshold for status. +Can used special variables like: %{status}, %{name} + +=back + +=cut diff --git a/src/network/cambium/cnpilot/snmp/mode/cpu.pm b/src/network/cambium/cnpilot/snmp/mode/cpu.pm new file mode 100644 index 000000000..d9b01f2ba --- /dev/null +++ b/src/network/cambium/cnpilot/snmp/mode/cpu.pm @@ -0,0 +1,129 @@ +# +# Copyright 2023 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::cambium::cnpilot::snmp::mode::cpu; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub prefix_cpu_output { + my ($self, %options) = @_; + + return "CPU '" . $options{instance_value}->{name} . "' usage: "; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'cpu', type => 1, cb_prefix_output => 'prefix_cpu_output', message_multiple => 'All CPUs are ok' } + ]; + + $self->{maps_counters}->{cpu} = [ + { label => 'cpu-usage-prct', nlabel => 'cpu.usage.percentage', set => { + key_values => [ { name => 'cpu_usage' }, { name => 'name' } ], + output_template => '%.2f %%', + perfdatas => [ + { label => 'cpu', template => '%.2f', min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'name' } + ] + } + } + ]; +} + +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-ap:s' => { name => 'filter_ap' } + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + # Select relevant oids for CPU monitoring + my $mapping = { + cambiumAPName => { oid => '.1.3.6.1.4.1.17713.22.1.1.1.2' }, + cambiumAPCPUUtilization => { oid => '.1.3.6.1.4.1.17713.22.1.1.1.6' } + }; + + # Point at the begining of the table + my $oid_cambiumAccessPointEntry = '.1.3.6.1.4.1.17713.22.1.1.1'; + + my $cpu_result = $options{snmp}->get_table( + oid => $oid_cambiumAccessPointEntry, + nothing_quit => 1 + ); + + foreach my $oid (keys %{$cpu_result}) { + next if ($oid !~ /^$mapping->{cambiumAPName}->{oid}\.(.*)$/); + # Catch instance in table + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $cpu_result, instance => $instance); + + if (defined($self->{option_results}->{filter_ap}) && $self->{option_results}->{filter_ap} ne '' && + $result->{cambiumAPName} !~ /$self->{option_results}->{filter_ap}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{cambiumAPName} . "': no matching filter.", debug => 1); + next; + } + + $self->{cpu}->{$instance} = { + name => $result->{cambiumAPName}, + cpu_usage => $result->{cambiumAPCPUUtilization} + }; + } + + if (scalar(keys %{$self->{cpu}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No AP matching with filter found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check CPU usage. + +=over 8 + +=item B<--filter-ap> + +Filter on one AP name. + +=item B<--warning> + +Warning threshold for CPU. + +=item B<--critical> + +Critical threshold for CPU. + +=back + +=cut diff --git a/src/network/cambium/cnpilot/snmp/mode/interfaces.pm b/src/network/cambium/cnpilot/snmp/mode/interfaces.pm new file mode 100644 index 000000000..377c78007 --- /dev/null +++ b/src/network/cambium/cnpilot/snmp/mode/interfaces.pm @@ -0,0 +1,182 @@ +# +# Copyright 2023 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::cambium::cnpilot::snmp::mode::interfaces; + +use base qw(snmp_standard::mode::interfaces); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); + bless $self, $class; + + return $self; +} + +1; + +__END__ + +=head1 MODE + +Check interfaces. + +=over 8 + +=item B<--add-global> + +Check global port statistics (By default if no --add-* option is set). + +=item B<--add-status> + +Check interface status. + +=item B<--add-duplex-status> + +Check duplex status (with --warning-status and --critical-status). + +=item B<--add-traffic> + +Check interface traffic. + +=item B<--add-errors> + +Check interface errors. + +=item B<--add-cast> + +Check interface cast. + +=item B<--add-speed> + +Check interface speed. + +=item B<--add-volume> + +Check interface data volume between two checks (not supposed to be graphed, useful for BI reporting). + +=item B<--check-metrics> + +If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). +Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} + +=item B<--warning-*> B<--critical-*> + +Thresholds. +Can be: 'total-port', 'total-admin-up', 'total-admin-down', 'total-oper-up', 'total-oper-down', +'in-traffic', 'out-traffic', 'in-error', 'in-discard', 'out-error', 'out-discard', +'in-ucast', 'in-bcast', 'in-mcast', 'out-ucast', 'out-bcast', 'out-mcast', +'speed' (b/s). + +=item B<--units-traffic> + +Units of thresholds for the traffic (Default: 'percent_delta') ('percent_delta', 'bps', 'counter'). + +=item B<--units-errors> + +Units of thresholds for errors/discards (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'counter'). + +=item B<--units-cast> + +Units of thresholds for communication types (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'counter'). + +=item B<--nagvis-perfdata> + +Display traffic perfdata to be compatible with nagvis widget. + +=item B<--interface> + +Set the interface (number expected) ex: 1,2,... (empty means 'check all interface'). + +=item B<--name> + +Allows to use interface name with option --interface instead of interface oid index (Can be a regexp) + +=item B<--speed> + +Set interface speed for incoming/outgoing traffic (in Mb). + +=item B<--speed-in> + +Set interface speed for incoming traffic (in Mb). + +=item B<--speed-out> + +Set interface speed for outgoing traffic (in Mb). + +=item B<--map-speed-dsl> + +Get interface speed configuration for interface type 'adsl' and 'vdsl2'. + +Syntax: --map-speed-dsl=interface-src-name,interface-dsl-name + +E.g: --map-speed-dsl=Et0.835,Et0-vdsl2 + +=item B<--force-counters64> + +Force to use 64 bits counters only. Can be used to improve performance. + +=item B<--force-counters32> + +Force to use 32 bits counters (even in snmp v2c and v3). Should be used when 64 bits counters are buggy. + +=item B<--reload-cache-time> + +Time in minutes before reloading cache file (default: 180). + +=item B<--oid-filter> + +Choose OID used to filter interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr). + +=item B<--oid-display> + +Choose OID used to display interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr). + +=item B<--oid-extra-display> + +Add an OID to display. + +=item B<--display-transform-src> + +Regexp src to transform display value. + +=item B<--display-transform-dst> + +Regexp dst to transform display value. + +=item B<--show-cache> + +Display cache interface datas. + +=back + +=cut diff --git a/src/network/cambium/cnpilot/snmp/mode/listradios.pm b/src/network/cambium/cnpilot/snmp/mode/listradios.pm new file mode 100644 index 000000000..23042cf7d --- /dev/null +++ b/src/network/cambium/cnpilot/snmp/mode/listradios.pm @@ -0,0 +1,140 @@ +# +# Copyright 2023 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::cambium::cnpilot::snmp::mode::listradios; + +use base qw(centreon::plugins::mode); + +use strict; +use warnings; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $options{options}->add_options(arguments => { + }); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +sub manage_selection { + my ($self, %options) = @_; + + # Select relevant oids for discovery function for Radio CnPilot + my $mapping = { + cambiumRadioIndex => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.1' }, + cambiumRadioMACAddress => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.2' }, + cambiumBandType => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.3' }, + cambiumRadioState => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.13' }, + cambiumRadioChannel => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.6' } + }; + + # Point at the begining of the table + my $oid_cambiumRadioEntry = '.1.3.6.1.4.1.17713.22.1.2.1'; + + my $snmp_result = $options{snmp}->get_table( + oid => $oid_cambiumRadioEntry, + nothing_quit => 1 + ); + + my $results = {}; + foreach my $oid (keys %{$snmp_result}) { + next if ($oid !~ /^$mapping->{cambiumRadioMACAddress}->{oid}\.(.*)$/); + # Catch instance in table + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); + + $results->{$result->{cambiumRadioMACAddress}} = { + id => $result->{cambiumRadioIndex}, + name => $result->{cambiumRadioMACAddress}, + band_type => $result->{cambiumBandType}, + transmit_power => $result->{cambiumRadioState}, + radio_channel => $result->{cambiumRadioChannel} + }; + } + + return $results; +} + +sub run { + my ($self, %options) = @_; + + my $results = $self->manage_selection(snmp => $options{snmp}); + foreach my $oid_path (sort keys %$results) { + $self->{output}->output_add( + long_msg => sprintf( + '[id: %s][name: %s][radio channel: %s][transmit power: %s][band type: %s]', + $results->{$oid_path}->{id}, + $results->{$oid_path}->{name}, + $results->{$oid_path}->{radio_channel}, + $results->{$oid_path}->{transmit_power}, + $results->{$oid_path}->{band_type} + ) + ); + } + + $self->{output}->output_add( + severity => 'OK', + short_msg => 'List Radio' + ); + $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); + $self->{output}->exit(); +} + +sub disco_format { + my ($self, %options) = @_; + + $self->{output}->add_disco_format(elements => ['id', 'name', 'radio_channel', 'transmit_power', 'band_type']); +} + +sub disco_show { + my ($self, %options) = @_; + + my $results = $self->manage_selection(snmp => $options{snmp}); + foreach my $oid_path (sort keys %$results) { + $self->{output}->add_disco_entry( + id => $results->{$oid_path}->{id}, + name => $results->{$oid_path}->{name}, + radio_channel => $results->{$oid_path}->{radio_channel}, + transmit_power => $results->{$oid_path}->{transmit_power}, + band_type => $results->{$oid_path}->{band_type} + ); + } +} + +1; + +__END__ + +=head1 MODE + +List radio interfaces. + +=over 8 + +=back + +=cut diff --git a/src/network/cambium/cnpilot/snmp/mode/memory.pm b/src/network/cambium/cnpilot/snmp/mode/memory.pm new file mode 100644 index 000000000..9bcb7bd4e --- /dev/null +++ b/src/network/cambium/cnpilot/snmp/mode/memory.pm @@ -0,0 +1,139 @@ +# +# Copyright 2023 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::cambium::cnpilot::snmp::mode::memory; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; + +sub prefix_memory_output { + my ($self, %options) = @_; + + return "Memory '" . $options{instance_value}->{name} . "' "; +} + +sub custom_usage_output { + my ($self, %options) = @_; + + return sprintf( + 'used: %.2f %%', + $self->{result_values}->{used} + ); +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'memory', type => 1, cb_prefix_output => 'prefix_memory_output', message_multiple => 'All memories are ok' } + ]; + + $self->{maps_counters}->{memory} = [ + { label => 'memory-usage-prct', nlabel => 'memory.usage.percentage', set => { + key_values => [ { name => 'used' }, { name => 'free' }, { name => 'name' } ], + closure_custom_output => $self->can('custom_usage_output'), + perfdatas => [ + { template => '%s', min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'name'} + ] + } + } + ]; +} + +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-ap:s' => { name => 'filter_ap' } + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + # Select relevant oids for Memory monitoring + my $mapping = { + cambiumAPName => { oid => '.1.3.6.1.4.1.17713.22.1.1.1.2' }, + cambiumAPMemoryFree => { oid => '.1.3.6.1.4.1.17713.22.1.1.1.7' } + }; + + # Point at the begining of the table + my $oid_cambiumAccessPointEntry = '.1.3.6.1.4.1.17713.22.1.1.1'; + + my $memory_result = $options{snmp}->get_table( + oid => $oid_cambiumAccessPointEntry, + nothing_quit => 1 + ); + + foreach my $oid (keys %{$memory_result}) { + next if ($oid !~ /^$mapping->{cambiumAPName}->{oid}\.(.*)$/); + # Catch instance in table + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $memory_result, instance => $instance); + + if (defined($self->{option_results}->{filter_ap}) && $self->{option_results}->{filter_ap} ne '' && + $result->{cambiumAPName} !~ /$self->{option_results}->{filter_ap}/) { + $self->{output}->output_add(long_msg => "skipping '" . $result->{cambiumAPName} . "': no matching filter.", debug => 1); + next; + } + + $self->{memory}->{$instance} = { + name => $result->{cambiumAPName}, + free => $result->{cambiumAPMemoryFree}, + used => 100 - $result->{cambiumAPMemoryFree} + }; + } + + if (scalar(keys %{$self->{memory}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No AP matching with filter found."); + $self->{output}->option_exit(); + } +} + +1; + +__END__ + +=head1 MODE + +Check memory usage. + +=over 8 + +=item B<--filter-ap> + +Filter on one or several AP. + +=item B<--warning> + +Warning threshold for Memory. + +=item B<--critical> + +Critical threshold for Memory. + +=back + +=cut diff --git a/src/network/cambium/cnpilot/snmp/mode/radios.pm b/src/network/cambium/cnpilot/snmp/mode/radios.pm new file mode 100644 index 000000000..ffea2e933 --- /dev/null +++ b/src/network/cambium/cnpilot/snmp/mode/radios.pm @@ -0,0 +1,198 @@ +# +# Copyright 2023 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::cambium::cnpilot::snmp::mode::radios; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng); +use Digest::MD5 qw(md5_hex); + +sub prefix_radio_output { + my ($self, %options) = @_; + + return "radio interface '" . $options{instance_value}->{name} . "' "; +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { name => 'radios', type => 1, cb_prefix_output => 'prefix_radio_output', message_multiple => 'All raadio interfaces are ok' } + ]; + + $self->{maps_counters}->{radios} = [ + { label => 'clients-connected', nlabel => 'radio.clients.connected.count', set => { + key_values => [ { name => 'num_clients' }, { name => 'name' } ], + output_template => 'clients connected: %s', + perfdatas => [ + { template => '%s', min => 0, label_extra_instance => 1, instance_use => 'name' } + ] + } + }, + { label => 'status', type => 2, critical_default => '%{state} eq "off"', + set => { + key_values => [ { name => 'state' }, { name => 'name' } ], + output_template => 'state: %s', + closure_custom_perfdata => sub { return 0; }, + closure_custom_threshold_check => \&catalog_status_threshold_ng + } + }, + { label => 'noise-floor', nlabel => 'radio.interface.noise.floor.dbm', set => { + key_values => [ { name => 'noise_floor' } ], + output_template => 'noise floor: %s dBm', + perfdatas => [ + { template => '%s', min => 0, unit => 'dBm', label_extra_instance => 1, instance_use => 'name' } + ] + } + }, + { label => 'interference', nlabel => 'radio.interface.interference.dbm', set => { + key_values => [ { name => 'interference' } ], + output_template => 'interference: %s dBm', + perfdatas => [ + { template => '%s', min => 0, unit => 'dBm', label_extra_instance => 1, instance_use => 'name' } + ] + } + }, + { label => 'traffic-in', nlabel => 'radio.interface.traffic.in.bitspersecond', set => { + key_values => [ { name => 'traffic_in', per_second => 1 } ], + output_template => 'in: %s %s/s', + output_change_bytes => 2, + perfdatas => [ + { template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'name' } + ] + } + }, + { label => 'traffic-out', nlabel => 'radio.interface.traffic.out.bitspersecond', set => { + key_values => [ { name => 'traffic_out', per_second => 1 } ], + output_template => 'out: %s %s/s', + output_change_bytes => 2, + perfdatas => [ + { template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'name' } + ] + } + } + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1, force_new_perfdata => 1); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + # Select relevant oids for radio monitoring + my $mapping = { + cambiumRadioMACAddress => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.2' }, + cambiumRadioNumClients => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.5' }, + cambiumRadioTxDataBytes => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.9' }, + cambiumRadioRxDataBytes => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.10' }, + cambiumRadioState => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.13' }, + cambiumRadioNoiseFloor => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.16' }, + cambiumRadioInterference => { oid => '.1.3.6.1.4.1.17713.22.1.2.1.17' } + }; + + # Point at the begining of the table + my $oid_cambiumRadioPointEntry = '.1.3.6.1.4.1.17713.22.1.2.1'; + + my $radio_result = $options{snmp}->get_table( + oid => $oid_cambiumRadioPointEntry, + nothing_quit => 1 + ); + + foreach my $oid (keys %{$radio_result}) { + next if ($oid !~ /^$mapping->{cambiumRadioMACAddress}->{oid}\.(.*)$/); + # Catch instance in table + my $instance = $1; + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $radio_result, instance => $instance); + + next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $result->{cambiumRadioMACAddress} !~ /$self->{option_results}->{filter_name}/); + + $self->{radios}->{$instance} = { + name => $result->{cambiumRadioMACAddress}, + num_clients => $result->{cambiumRadioNumClients}, + state => lc($result->{cambiumRadioState}), + traffic_out => $result->{cambiumRadioTxDataBytes} * 8, + traffic_in => $result->{cambiumRadioRxDataBytes} * 8, + noise_floor => $result->{cambiumRadioNoiseFloor}, + interference => $result->{cambiumRadioInterference} + }; + } + + if (scalar(keys %{$self->{radios}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No MACAddress matching with filter found."); + $self->{output}->option_exit(); + } + + $self->{cache_name} = 'cambium_cnpilot_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . + md5_hex( + (defined($self->{option_results}->{filter_counters}) ? $self->{option_results}->{filter_counters} : '') . '_' . + (defined($self->{option_results}->{filter_name}) ? $self->{option_results}->{filter_name} : '') + ); +} + +1; + +__END__ + +=head1 MODE + +Check radio interfaces. + +=over 8 + +=item B<--filter-counters> + +Only display some counters (regexp can be used). +Example: --filter-counters='status' + +=item B<--filter-name> + +Filter interface by MACAdress + +=item B<--warning-status> + +Set warning threshold for status. +Can used special variables like: %{status}, %{name} + +=item B<--critical-status> + +Set critical threshold for status (Default: '%{status} eq "expired"'). +Can used special variables like: %{status}, %{name} + +=item B<--warning-*> B<--critical-*> + +Thresholds. +Can be: 'clients-connected', 'noise-floor', 'interference', 'traffic-in', 'traffic-out'. + +=back + +=cut diff --git a/src/network/cambium/cnpilot/snmp/plugin.pm b/src/network/cambium/cnpilot/snmp/plugin.pm new file mode 100644 index 000000000..de6cf1264 --- /dev/null +++ b/src/network/cambium/cnpilot/snmp/plugin.pm @@ -0,0 +1,53 @@ +# +# Copyright 2023 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::cambium::cnpilot::snmp::plugin; + +use strict; +use warnings; +use base qw(centreon::plugins::script_snmp); + +sub new { + my ( $class, %options ) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $self->{modes} = { + 'connection-status' => 'network::cambium::cnpilot::snmp::mode::connectionstatus', + 'cpu' => 'network::cambium::cnpilot::snmp::mode::cpu', + 'interfaces' => 'network::cambium::cnpilot::snmp::mode::interfaces', + 'list-interfaces' => 'snmp_standard::mode::listinterfaces', + 'list-radios' => 'network::cambium::cnpilot::snmp::mode::listradios', + 'memory' => 'network::cambium::cnpilot::snmp::mode::memory', + 'radios' => 'network::cambium::cnpilot::snmp::mode::radios' + }; + + return $self; +} + +1; + +__END__ + +=head1 PLUGIN DESCRIPTION + +Check Cambium cnPilot equipments through SNMP. + +=cut diff --git a/src/network/cambium/epmp/snmp/mode/interfaces.pm b/src/network/cambium/epmp/snmp/mode/interfaces.pm index 95c86e839..2b5348161 100644 --- a/src/network/cambium/epmp/snmp/mode/interfaces.pm +++ b/src/network/cambium/epmp/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cambium/epmp/snmp/mode/license.pm b/src/network/cambium/epmp/snmp/mode/license.pm index f4ffd25e6..c57ae931e 100644 --- a/src/network/cambium/epmp/snmp/mode/license.pm +++ b/src/network/cambium/epmp/snmp/mode/license.pm @@ -108,17 +108,17 @@ Check Cambium license status. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /validation fail|not provided/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /not valid/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/network/checkpoint/snmp/mode/rausers.pm b/src/network/checkpoint/snmp/mode/rausers.pm index 4695ad45c..8708084b7 100644 --- a/src/network/checkpoint/snmp/mode/rausers.pm +++ b/src/network/checkpoint/snmp/mode/rausers.pm @@ -149,12 +149,12 @@ Filter on remote access users (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{display}, %{status} +You can use the following variables: %{display}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/checkpoint/snmp/mode/vpnstatus.pm b/src/network/checkpoint/snmp/mode/vpnstatus.pm index 7fee5b423..2f4cee651 100644 --- a/src/network/checkpoint/snmp/mode/vpnstatus.pm +++ b/src/network/checkpoint/snmp/mode/vpnstatus.pm @@ -166,12 +166,12 @@ Filter vpn name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{type}, %{status}, %{display} +You can use the following variables: %{type}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{type} eq "permanent" and %{status} =~ /down/i'). -Can used special variables like: %{type}, %{status}, %{display} +You can use the following variables: %{type}, %{status}, %{display} =item B<--buggy-snmp> diff --git a/src/network/cisco/aci/apic/restapi/mode/fabric.pm b/src/network/cisco/aci/apic/restapi/mode/fabric.pm index e616ba2c9..c44cd1d63 100644 --- a/src/network/cisco/aci/apic/restapi/mode/fabric.pm +++ b/src/network/cisco/aci/apic/restapi/mode/fabric.pm @@ -114,13 +114,13 @@ Check fabrics. =item B<--warning-health> Set warning for the health level -Can used special variables like: %{current}, %{previous}. +You can use the following variables: %{current}, %{previous}. example: --warning-health='%{previous} < %{current}' =item B<--critical-health> Set critical for the health level -Can used special variables like: %{current}, %{previous}. +You can use the following variables: %{current}, %{previous}. example: --critical-health='%{current} < 98' =back diff --git a/src/network/cisco/aci/apic/restapi/mode/tenant.pm b/src/network/cisco/aci/apic/restapi/mode/tenant.pm index 8a497e561..014240dc4 100644 --- a/src/network/cisco/aci/apic/restapi/mode/tenant.pm +++ b/src/network/cisco/aci/apic/restapi/mode/tenant.pm @@ -125,13 +125,13 @@ Regexp filter on the tenant name =item B<--warning-health> Set warning for the health level -Can used special variables like: %{current}, %{previous}. +You can use the following variables: %{current}, %{previous}. example: --warning-health='%{previous} < %{current}' =item B<--critical-health> Set critical for the health level -Can used special variables like: %{current}, %{previous}. +You can use the following variables: %{current}, %{previous}. example: --critical-health='%{current} < 98' =back diff --git a/src/network/cisco/asa/snmp/mode/failover.pm b/src/network/cisco/asa/snmp/mode/failover.pm index 498f05f15..3604fb351 100644 --- a/src/network/cisco/asa/snmp/mode/failover.pm +++ b/src/network/cisco/asa/snmp/mode/failover.pm @@ -154,12 +154,12 @@ Example: --filter-counters='^status$' =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{primaryStateLast}, %{secondaryStateLast}, %{primaryState}, %{secondaryState} +You can use the following variables: %{primaryStateLast}, %{secondaryStateLast}, %{primaryState}, %{secondaryState} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{primaryStateLast}, %{secondaryStateLast}, %{primaryState}, %{secondaryState} +You can use the following variables: %{primaryStateLast}, %{secondaryStateLast}, %{primaryState}, %{secondaryState} =item B<--warning-*> diff --git a/src/network/cisco/callmanager/snmp/mode/ccmusage.pm b/src/network/cisco/callmanager/snmp/mode/ccmusage.pm index e71bd69a1..2fa6ea75d 100644 --- a/src/network/cisco/callmanager/snmp/mode/ccmusage.pm +++ b/src/network/cisco/callmanager/snmp/mode/ccmusage.pm @@ -166,12 +166,12 @@ Example: --filter-counters='phone' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /up/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/callmanager/snmp/mode/ctiusage.pm b/src/network/cisco/callmanager/snmp/mode/ctiusage.pm index 3498ae4ed..d9f3f62da 100644 --- a/src/network/cisco/callmanager/snmp/mode/ctiusage.pm +++ b/src/network/cisco/callmanager/snmp/mode/ctiusage.pm @@ -157,12 +157,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^registered/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/callmanager/snmp/mode/gatewayusage.pm b/src/network/cisco/callmanager/snmp/mode/gatewayusage.pm index b4f9ebe9b..e9ba6d839 100644 --- a/src/network/cisco/callmanager/snmp/mode/gatewayusage.pm +++ b/src/network/cisco/callmanager/snmp/mode/gatewayusage.pm @@ -148,12 +148,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^registered/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/cisco/callmanager/snmp/mode/mediadeviceusage.pm b/src/network/cisco/callmanager/snmp/mode/mediadeviceusage.pm index 9d6bfc811..86db7788f 100644 --- a/src/network/cisco/callmanager/snmp/mode/mediadeviceusage.pm +++ b/src/network/cisco/callmanager/snmp/mode/mediadeviceusage.pm @@ -148,12 +148,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^registered/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/cisco/callmanager/snmp/mode/phoneusage.pm b/src/network/cisco/callmanager/snmp/mode/phoneusage.pm index 9bf91ee67..459b1fbd1 100644 --- a/src/network/cisco/callmanager/snmp/mode/phoneusage.pm +++ b/src/network/cisco/callmanager/snmp/mode/phoneusage.pm @@ -176,12 +176,12 @@ Filter phone by description (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name}, %{description} +You can use the following variables: %{status}, %{name}, %{description} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^registered/'). -Can used special variables like: %{status}, %{name}, %{description} +You can use the following variables: %{status}, %{name}, %{description} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/callmanager/snmp/mode/voicemailusage.pm b/src/network/cisco/callmanager/snmp/mode/voicemailusage.pm index 7cb8a02f5..e537975fc 100644 --- a/src/network/cisco/callmanager/snmp/mode/voicemailusage.pm +++ b/src/network/cisco/callmanager/snmp/mode/voicemailusage.pm @@ -148,12 +148,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /^registered/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/callmanager/sxml/mode/services.pm b/src/network/cisco/callmanager/sxml/mode/services.pm index 99eb83e2f..ac637e927 100644 --- a/src/network/cisco/callmanager/sxml/mode/services.pm +++ b/src/network/cisco/callmanager/sxml/mode/services.pm @@ -185,17 +185,17 @@ Filter services by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{reason}, %{name} +You can use the following variables: %{status}, %{reason}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{reason}, %{name} +You can use the following variables: %{status}, %{reason}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /starting|started/i and %{reason} !~ /service not activate/i'). -Can used special variables like: %{status}, %{reason}, %{name} +You can use the following variables: %{status}, %{reason}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/firepower/fmc/restapi/mode/devices.pm b/src/network/cisco/firepower/fmc/restapi/mode/devices.pm index 960f96f30..68fb90e4a 100644 --- a/src/network/cisco/firepower/fmc/restapi/mode/devices.pm +++ b/src/network/cisco/firepower/fmc/restapi/mode/devices.pm @@ -191,17 +191,17 @@ Filter devices by name (Can be a regexp). =item B<--unknown-device-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-device-status> Set warning threshold for status (Default: '%{status} =~ /yellow/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-device-status> Set critical threshold for status (Default: '%{status} =~ /red|black/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/firepower/fxos/snmp/mode/faults.pm b/src/network/cisco/firepower/fxos/snmp/mode/faults.pm index ef3e3cd2a..ee924eec3 100644 --- a/src/network/cisco/firepower/fxos/snmp/mode/faults.pm +++ b/src/network/cisco/firepower/fxos/snmp/mode/faults.pm @@ -225,12 +225,12 @@ Check faults. =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor|warning/). -Can used special variables like: %{description}, %{object}, %{severity}, %{type}, %{acknowledged}, %{since} +You can use the following variables: %{description}, %{object}, %{severity}, %{type}, %{acknowledged}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /major|critical/'). -Can used special variables like: %{description}, %{object}, %{severity}, %{type}, %{since} +You can use the following variables: %{description}, %{object}, %{severity}, %{type}, %{since} =item B<--timezone> diff --git a/src/network/cisco/meraki/cloudcontroller/restapi/mode/devices.pm b/src/network/cisco/meraki/cloudcontroller/restapi/mode/devices.pm index 8cd8777a9..03402da5a 100644 --- a/src/network/cisco/meraki/cloudcontroller/restapi/mode/devices.pm +++ b/src/network/cisco/meraki/cloudcontroller/restapi/mode/devices.pm @@ -608,47 +608,47 @@ Skip port traffic counters if port status is disconnected. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /alerting/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--unknown-link-status> Set unknown threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-link-status> Set warning threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--critical-link-status> Set critical threshold for status (Default: '%{link_status} =~ /failed/i'). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--unknown-port-status> Set unknown threshold for status. -Can used special variables like: %{port_status}, %{port_enabled}, %{display} +You can use the following variables: %{port_status}, %{port_enabled}, %{display} =item B<--warning-port-status> Set warning threshold for status. -Can used special variables like: %{port_status}, %{port_enabled}, %{display} +You can use the following variables: %{port_status}, %{port_enabled}, %{display} =item B<--critical-port-status> Set critical threshold for status (Default: '%{port_enabled} == 1 and %{port_status} !~ /^connected/i'). -Can used special variables like: %{port_status}, %{port_enabled}, %{display} +You can use the following variables: %{port_status}, %{port_enabled}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/meraki/cloudcontroller/snmp/mode/deviceusage.pm b/src/network/cisco/meraki/cloudcontroller/snmp/mode/deviceusage.pm index 88c41804f..19cf1424b 100644 --- a/src/network/cisco/meraki/cloudcontroller/snmp/mode/deviceusage.pm +++ b/src/network/cisco/meraki/cloudcontroller/snmp/mode/deviceusage.pm @@ -388,12 +388,12 @@ Units of thresholds for the traffic (Default: '%') ('%', 'b/s'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /offline/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/cisco/prime/restapi/mode/apusage.pm b/src/network/cisco/prime/restapi/mode/apusage.pm index 2a90aea2c..9415da0a9 100644 --- a/src/network/cisco/prime/restapi/mode/apusage.pm +++ b/src/network/cisco/prime/restapi/mode/apusage.pm @@ -236,12 +236,12 @@ Can be: 'ap-clients', 'ap-uptime', 'ap-lwappuptime', =item B<--warning-ap-status> Set warning threshold for status (Default: '%{admin_status} =~ /enable/i && %{status} =~ /minor|warning/i') -Can used special variables like: %{name}, %{status}, %{controller}, %{admin_status} +You can use the following variables: %{name}, %{status}, %{controller}, %{admin_status} =item B<--critical-ap-status> Set critical threshold for status (Default: '%{admin_status} =~ /enable/i && %{status} =~ /major|critical/i'). -Can used special variables like: %{name}, %{status}, %{controller}, %{admin_status} +You can use the following variables: %{name}, %{status}, %{controller}, %{admin_status} =item B<--reload-cache-time> diff --git a/src/network/cisco/standard/ssh/mode/voicedialpeer.pm b/src/network/cisco/standard/ssh/mode/voicedialpeer.pm index 48d2caea2..501d98a27 100644 --- a/src/network/cisco/standard/ssh/mode/voicedialpeer.pm +++ b/src/network/cisco/standard/ssh/mode/voicedialpeer.pm @@ -164,17 +164,17 @@ Filter name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{admin}, %{oper}, %{keepalive}, %{display} +You can use the following variables: %{admin}, %{oper}, %{keepalive}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{admin}, %{oper}, %{keepalive}, %{display} +You can use the following variables: %{admin}, %{oper}, %{keepalive}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admin} eq "up" and %{oper} eq "down"'). -Can used special variables like: %{admin}, %{oper}, %{keepalive}, %{display} +You can use the following variables: %{admin}, %{oper}, %{keepalive}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/cisco/umbrella/snmp/mode/appliance.pm b/src/network/cisco/umbrella/snmp/mode/appliance.pm index b5fac8f66..9dbd2ff68 100644 --- a/src/network/cisco/umbrella/snmp/mode/appliance.pm +++ b/src/network/cisco/umbrella/snmp/mode/appliance.pm @@ -95,12 +95,12 @@ Check VA health. =item B<--warning-status> Set warning threshold for status. (Default: '%{status} =~ /yellow/') -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status. (Default: '%{status} =~ /red/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/network/cisco/wap/snmp/mode/virtualaccesspoints.pm b/src/network/cisco/wap/snmp/mode/virtualaccesspoints.pm index 046ab3780..c1a66961f 100644 --- a/src/network/cisco/wap/snmp/mode/virtualaccesspoints.pm +++ b/src/network/cisco/wap/snmp/mode/virtualaccesspoints.pm @@ -165,17 +165,17 @@ Filter virtual access points by description (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{description}, %{admin_status}, %{operational_status} +You can use the following variables: %{description}, %{admin_status}, %{operational_status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{description}, %{admin_status}, %{operational_status} +You can use the following variables: %{description}, %{admin_status}, %{operational_status} =item B<--critical-status> Set critical threshold for status (Default: '%{admin_status} eq "up" and %{operational_status} eq "down"'). -Can used special variables like: %{description}, %{admin_status}, %{operational_status} +You can use the following variables: %{description}, %{admin_status}, %{operational_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/citrix/sdx/snmp/mode/srusage.pm b/src/network/citrix/sdx/snmp/mode/srusage.pm index dbedb2f09..bd9bad445 100644 --- a/src/network/citrix/sdx/snmp/mode/srusage.pm +++ b/src/network/citrix/sdx/snmp/mode/srusage.pm @@ -228,12 +228,12 @@ Filter storage repository name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /good/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/colubris/snmp/mode/apusage.pm b/src/network/colubris/snmp/mode/apusage.pm index 358ff6607..31af1a52c 100644 --- a/src/network/colubris/snmp/mode/apusage.pm +++ b/src/network/colubris/snmp/mode/apusage.pm @@ -231,12 +231,12 @@ Can be: 'total-ap', 'total-users', 'ap-users'. =item B<--warning-ap-status> Set warning threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-ap-status> Set critical threshold for status (Default: '%{state} eq "disconnected"'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =back diff --git a/src/network/dell/nseries/snmp/mode/interfaces.pm b/src/network/dell/nseries/snmp/mode/interfaces.pm index c25d95b51..212daf99f 100644 --- a/src/network/dell/nseries/snmp/mode/interfaces.pm +++ b/src/network/dell/nseries/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/denyall/snmp/mode/reverseproxy.pm b/src/network/denyall/snmp/mode/reverseproxy.pm index e6e16045f..a16849735 100644 --- a/src/network/denyall/snmp/mode/reverseproxy.pm +++ b/src/network/denyall/snmp/mode/reverseproxy.pm @@ -197,17 +197,17 @@ Filter reverse proxy by UID (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{uid} +You can use the following variables: %{status}, %{uid} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{uid} +You can use the following variables: %{status}, %{uid} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{uid} +You can use the following variables: %{status}, %{uid} =item B<--warning-*> B<--critical-*> diff --git a/src/network/digi/sarian/snmp/mode/gprs.pm b/src/network/digi/sarian/snmp/mode/gprs.pm index 1ede8f6cc..681f3ed27 100644 --- a/src/network/digi/sarian/snmp/mode/gprs.pm +++ b/src/network/digi/sarian/snmp/mode/gprs.pm @@ -181,12 +181,12 @@ Example: --filter-counters='signal|technology' =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{registered}, %{attachement} +You can use the following variables: %{registered}, %{attachement} =item B<--critical-status> Set critical threshold for status (Default: '%{attachement} eq "attached" and %{registered} !~ /registeredHostNetwork|registeredRoaming/' -Can used special variables like: %{registered}, %{attachement} +You can use the following variables: %{registered}, %{attachement} =item B<--warning-technology> diff --git a/src/network/dlink/standard/snmp/mode/interfaces.pm b/src/network/dlink/standard/snmp/mode/interfaces.pm index 903089e35..daead9302 100644 --- a/src/network/dlink/standard/snmp/mode/interfaces.pm +++ b/src/network/dlink/standard/snmp/mode/interfaces.pm @@ -169,12 +169,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{errdisable}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/dlink/standard/snmp/mode/stack.pm b/src/network/dlink/standard/snmp/mode/stack.pm index 50c69fda8..b9dcd9a5c 100644 --- a/src/network/dlink/standard/snmp/mode/stack.pm +++ b/src/network/dlink/standard/snmp/mode/stack.pm @@ -245,32 +245,32 @@ Check stack. =item B<--unknown-member-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{role}, %{roleLast}, %{status}, %{display} +You can use the following variables: %{role}, %{roleLast}, %{status}, %{display} =item B<--warning-member-status> Set warning threshold for status (Default: '%{status} =~ /codeUpdate/i'). -Can used special variables like: %{role}, %{roleLast}, %{status}, %{display} +You can use the following variables: %{role}, %{roleLast}, %{status}, %{display} =item B<--critical-member-status> Set critical threshold for status (Default: '%{role} ne %{roleLast} || %{status} =~ /unsupported|codeMismatch/i'). -Can used special variables like: %{role}, %{roleLast}, %{status}, %{display} +You can use the following variables: %{role}, %{roleLast}, %{status}, %{display} =item B<--unknown-link-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-link-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-link-status> Set critical threshold for status (Default: '%{status} eq "down"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/enterasys/snmp/mode/interfaces.pm b/src/network/enterasys/snmp/mode/interfaces.pm index b8df97746..605769b5d 100644 --- a/src/network/enterasys/snmp/mode/interfaces.pm +++ b/src/network/enterasys/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/evertz/AEA47721/snmp/mode/streamstatus.pm b/src/network/evertz/AEA47721/snmp/mode/streamstatus.pm index 10ce84a34..ae2bbdaf0 100644 --- a/src/network/evertz/AEA47721/snmp/mode/streamstatus.pm +++ b/src/network/evertz/AEA47721/snmp/mode/streamstatus.pm @@ -170,22 +170,22 @@ Check video/audio stream status. =item B<--warning-audio-status> Set warning threshold for device status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-audio-status> Set critical threshold for device status (Default: '%{status} =~ /loss/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-video-status> Set warning threshold for device connection status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-video-status> Set critical threshold for device connection status (Default: '%{status} =~ /loss|unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/network/evertz/DA6HDL7700/snmp/mode/videostatus.pm b/src/network/evertz/DA6HDL7700/snmp/mode/videostatus.pm index 132f4e1fe..2afcbafe4 100644 --- a/src/network/evertz/DA6HDL7700/snmp/mode/videostatus.pm +++ b/src/network/evertz/DA6HDL7700/snmp/mode/videostatus.pm @@ -130,12 +130,12 @@ Check video stream status. =item B<--warning-video-status> Set warning threshold for device connection status. -Can used special variables like: %{video_locked}, %{display} +You can use the following variables: %{video_locked}, %{display} =item B<--critical-video-status> Set critical threshold for device connection status (Default: '%{video_locked} =~ /notLocked/i'). -Can used special variables like: %{video_locked}, %{display} +You can use the following variables: %{video_locked}, %{display} =back diff --git a/src/network/extreme/snmp/mode/interfaces.pm b/src/network/extreme/snmp/mode/interfaces.pm index b18b1b229..d9631333f 100644 --- a/src/network/extreme/snmp/mode/interfaces.pm +++ b/src/network/extreme/snmp/mode/interfaces.pm @@ -122,12 +122,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/extreme/snmp/mode/stack.pm b/src/network/extreme/snmp/mode/stack.pm index 212c48c01..16a4432a3 100644 --- a/src/network/extreme/snmp/mode/stack.pm +++ b/src/network/extreme/snmp/mode/stack.pm @@ -244,32 +244,32 @@ Check stack status. =item B<--unknown-member-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{role}, %{roleLast} +You can use the following variables: %{role}, %{roleLast} =item B<--warning-member-status> Set warning threshold for status (Default: '%{status} eq "mismatch"'). -Can used special variables like: %{role}, %{roleLast} +You can use the following variables: %{role}, %{roleLast} =item B<--critical-member-status> Set critical threshold for status (Default: '%{role} ne %{roleLast} || %{status} eq "down"'). -Can used special variables like: %{role}, %{roleLast} +You can use the following variables: %{role}, %{roleLast} =item B<--unknown-port-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-port-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--critical-port-status> Set critical threshold for status (Default: '%{link_status} ne "up"'). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =back diff --git a/src/network/f5/bigip/snmp/mode/failover.pm b/src/network/f5/bigip/snmp/mode/failover.pm index 207e5e48b..2b67799ce 100644 --- a/src/network/f5/bigip/snmp/mode/failover.pm +++ b/src/network/f5/bigip/snmp/mode/failover.pm @@ -188,22 +188,22 @@ Only display some counters (regexp can be used). =item B<--warning-sync-status> Set warning threshold for sync status -Can used special variables like: %{syncstatus} +You can use the following variables: %{syncstatus} =item B<--critical-sync-status> Set critical threshold for sync status (Default: '%{syncstatus} =~ /unknown|syncFailed|syncDisconnected|incompatibleVersion/'). -Can used special variables like: %{syncstatus} +You can use the following variables: %{syncstatus} =item B<--warning-failover-status> Set warning threshold for failover status -Can used special variables like: %{failoverstatus} +You can use the following variables: %{failoverstatus} =item B<--critical-failover-status> Set critical threshold for failover status (Default: '%{failoverstatus} =~ /unknown/'). -Can used special variables like: %{failoverstatus} +You can use the following variables: %{failoverstatus} =back diff --git a/src/network/f5/bigip/snmp/mode/nodestatus.pm b/src/network/f5/bigip/snmp/mode/nodestatus.pm index 56449f323..9c962ed56 100644 --- a/src/network/f5/bigip/snmp/mode/nodestatus.pm +++ b/src/network/f5/bigip/snmp/mode/nodestatus.pm @@ -195,17 +195,17 @@ Filter by name (regexp can be used). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{state} eq "enabled" and %{status} eq "yellow"'). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} eq "enabled" and %{status} eq "red"'). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/f5/bigip/snmp/mode/poolstatus.pm b/src/network/f5/bigip/snmp/mode/poolstatus.pm index 8a0ff203c..dfd93fa39 100644 --- a/src/network/f5/bigip/snmp/mode/poolstatus.pm +++ b/src/network/f5/bigip/snmp/mode/poolstatus.pm @@ -329,32 +329,32 @@ Filter by name (regexp can be used). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{status}, %{membersAllDisabled}, %{display} +You can use the following variables: %{state}, %{status}, %{membersAllDisabled}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{membersAllDisabled} eq "no" and %{state} eq "enabled" and %{status} eq "yellow"'). -Can used special variables like: %{state}, %{status}, %{membersAllDisabled}, %{display} +You can use the following variables: %{state}, %{status}, %{membersAllDisabled}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{membersAllDisabled} eq "no" and %{state} eq "enabled" and %{status} eq "red"'). -Can used special variables like: %{state}, %{status}, %{membersAllDisabled}, %{display} +You can use the following variables: %{state}, %{status}, %{membersAllDisabled}, %{display} =item B<--unknown-member-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{status}, %{poolName}, %{nodeName} +You can use the following variables: %{state}, %{status}, %{poolName}, %{nodeName} =item B<--warning-member-status> Set warning threshold for status. -Can used special variables like: %{state}, %{status}, %{poolName}, %{nodeName} +You can use the following variables: %{state}, %{status}, %{poolName}, %{nodeName} =item B<--critical-member-status> Set critical threshold for status. -Can used special variables like: %{state}, %{status}, %{poolName}, %{nodeName} +You can use the following variables: %{state}, %{status}, %{poolName}, %{nodeName} =item B<--warning-*> B<--critical-*> diff --git a/src/network/f5/bigip/snmp/mode/trunks.pm b/src/network/f5/bigip/snmp/mode/trunks.pm index 64892a16b..a6eee131e 100644 --- a/src/network/f5/bigip/snmp/mode/trunks.pm +++ b/src/network/f5/bigip/snmp/mode/trunks.pm @@ -476,32 +476,32 @@ Monitor trunk interfaces. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /uninitialized|down/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--unknown-interface-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-interface-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-interface-status> Set critical threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/f5/bigip/snmp/mode/virtualserverstatus.pm b/src/network/f5/bigip/snmp/mode/virtualserverstatus.pm index 2bcc99c6d..c134ce176 100644 --- a/src/network/f5/bigip/snmp/mode/virtualserverstatus.pm +++ b/src/network/f5/bigip/snmp/mode/virtualserverstatus.pm @@ -185,17 +185,17 @@ Filter by name (regexp can be used). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{state} eq "enabled" and %{status} eq "yellow"'). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} eq "enabled" and %{status} eq "red"'). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/fortinet/fortiadc/snmp/mode/interfaces.pm b/src/network/fortinet/fortiadc/snmp/mode/interfaces.pm index a7de81f7c..1ab4e9b0e 100644 --- a/src/network/fortinet/fortiadc/snmp/mode/interfaces.pm +++ b/src/network/fortinet/fortiadc/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/fortinet/fortiadc/snmp/mode/security.pm b/src/network/fortinet/fortiadc/snmp/mode/security.pm index 6812ef02b..2a9633fe9 100644 --- a/src/network/fortinet/fortiadc/snmp/mode/security.pm +++ b/src/network/fortinet/fortiadc/snmp/mode/security.pm @@ -85,12 +85,12 @@ Check security. =item B<--warning-ddos-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-ddos-status> Set critical threshold for status (Default: '%{status} eq "attacking"'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/network/fortinet/fortiadc/snmp/mode/virtualservers.pm b/src/network/fortinet/fortiadc/snmp/mode/virtualservers.pm index 774ae4e2a..b4704a425 100644 --- a/src/network/fortinet/fortiadc/snmp/mode/virtualservers.pm +++ b/src/network/fortinet/fortiadc/snmp/mode/virtualservers.pm @@ -262,17 +262,17 @@ Filter virtual servers by vdom name. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{state}, %{name}, %{vdom} +You can use the following variables: %{status}, %{state}, %{name}, %{vdom} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{state}, %{name}, %{vdom} +You can use the following variables: %{status}, %{state}, %{name}, %{vdom} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "unhealthy"'). -Can used special variables like: %{status}, %{state}, %{name}, %{vdom} +You can use the following variables: %{status}, %{state}, %{name}, %{vdom} =item B<--warning-*> B<--critical-*> diff --git a/src/network/fortinet/fortiauthenticator/snmp/mode/ha.pm b/src/network/fortinet/fortiauthenticator/snmp/mode/ha.pm index b41a707a0..cdfbc4110 100644 --- a/src/network/fortinet/fortiauthenticator/snmp/mode/ha.pm +++ b/src/network/fortinet/fortiauthenticator/snmp/mode/ha.pm @@ -111,12 +111,12 @@ Check high-availability status. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{ha_status}, %{ha_status_last} +You can use the following variables: %{ha_status}, %{ha_status_last} =item B<--critical-status> Set critical threshold for status (Default: '%{ha_status} ne %{ha_status_last}'). -Can used special variables like: %{ha_status}, %{ha_status_last} +You can use the following variables: %{ha_status}, %{ha_status_last} =back diff --git a/src/network/fortinet/fortigate/restapi/mode/health.pm b/src/network/fortinet/fortigate/restapi/mode/health.pm index cf6e441a6..b698e0e56 100644 --- a/src/network/fortinet/fortigate/restapi/mode/health.pm +++ b/src/network/fortinet/fortigate/restapi/mode/health.pm @@ -108,17 +108,17 @@ Filter vdom by name. =item B<--unknown-health> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-health> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-health> Set critical threshold for status (Default: '%{status} !~ /success/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =back diff --git a/src/network/fortinet/fortigate/restapi/mode/licenses.pm b/src/network/fortinet/fortigate/restapi/mode/licenses.pm index 432d6780e..fc632919b 100644 --- a/src/network/fortinet/fortigate/restapi/mode/licenses.pm +++ b/src/network/fortinet/fortigate/restapi/mode/licenses.pm @@ -178,12 +178,12 @@ Filter licenses by name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{status}. +You can use the following variables: %{name}, %{status}. =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /expired/i'). -Can used special variables like: %{name}, %{status}. +You can use the following variables: %{name}, %{status}. =item B<--unit> diff --git a/src/network/fortinet/fortimanager/snmp/mode/devicestatus.pm b/src/network/fortinet/fortimanager/snmp/mode/devicestatus.pm index 6407e31b6..0eb4993be 100644 --- a/src/network/fortinet/fortimanager/snmp/mode/devicestatus.pm +++ b/src/network/fortinet/fortimanager/snmp/mode/devicestatus.pm @@ -226,52 +226,52 @@ Filter by device name (can be a regexp). =item B<--warning-device-status> Set warning threshold for device status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-device-status> Set critical threshold for device status -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-device-con-status> Set warning threshold for device connection status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-device-con-status> Set critical threshold for device connection status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-device-db-status> Set warning threshold for device DB status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-device-db-status> Set critical threshold for device DB status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-device-config-status> Set warning threshold for device configuration status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-device-config-status> Set critical threshold for device configuration status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-device-policy-package-status> Set warning threshold for device policy package status. -Can used special variables like: %{status}, %{package_name} +You can use the following variables: %{status}, %{package_name} =item B<--critical-device-policy-package-status> Set critical threshold for device policy package status. -Can used special variables like: %{status}, %{package_name} +You can use the following variables: %{status}, %{package_name} =back diff --git a/src/network/fortinet/fortiswitch/snmp/mode/interfaces.pm b/src/network/fortinet/fortiswitch/snmp/mode/interfaces.pm index a524cdeee..20e51b21c 100644 --- a/src/network/fortinet/fortiswitch/snmp/mode/interfaces.pm +++ b/src/network/fortinet/fortiswitch/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/fortinet/fortiweb/snmp/mode/system.pm b/src/network/fortinet/fortiweb/snmp/mode/system.pm index d7713daf2..b41817641 100644 --- a/src/network/fortinet/fortiweb/snmp/mode/system.pm +++ b/src/network/fortinet/fortiweb/snmp/mode/system.pm @@ -156,12 +156,12 @@ Example: --filter-counters='memory-usage' =item B<--warning-ha-status> Set warning threshold for status. -Can used special variables like: %{ha_mode} +You can use the following variables: %{ha_mode} =item B<--critical-ha-status> Set critical threshold for status. -Can used special variables like: %{ha_mode} +You can use the following variables: %{ha_mode} =item B<--warning-*> B<--critical-*> diff --git a/src/network/freebox/restapi/mode/system.pm b/src/network/freebox/restapi/mode/system.pm index 09ced9c98..9a8533949 100644 --- a/src/network/freebox/restapi/mode/system.pm +++ b/src/network/freebox/restapi/mode/system.pm @@ -183,22 +183,22 @@ Example: --filter-counters='^temperature-cpum$' =item B<--warning-wifi-status> Set warning threshold for wifi status (Default: '%{status} =~ /bad_param/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-wifi-status> Set critical threshold for wifi status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-disk-status> Set warning threshold for disk status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-disk-status> Set critical threshold for disk status (Default: '%{status} =~ /error/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/hirschmann/standard/snmp/mode/configuration.pm b/src/network/hirschmann/standard/snmp/mode/configuration.pm index e56b04ef8..768f1c218 100644 --- a/src/network/hirschmann/standard/snmp/mode/configuration.pm +++ b/src/network/hirschmann/standard/snmp/mode/configuration.pm @@ -114,12 +114,12 @@ Check configuration status. =item B<--warning-status> Set warning threshold for status (Default : '%{config_status} =~ /notInSync|outOfSync/'). -Can used special variables like: %{config_status} +You can use the following variables: %{config_status} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{config_status} +You can use the following variables: %{config_status} =back diff --git a/src/network/hp/moonshot/snmp/mode/interfaces.pm b/src/network/hp/moonshot/snmp/mode/interfaces.pm index 1d0cfb4c3..ede98bcaf 100644 --- a/src/network/hp/moonshot/snmp/mode/interfaces.pm +++ b/src/network/hp/moonshot/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/hp/procurve/snmp/mode/interfaces.pm b/src/network/hp/procurve/snmp/mode/interfaces.pm index 65d2efbc8..9d16af011 100644 --- a/src/network/hp/procurve/snmp/mode/interfaces.pm +++ b/src/network/hp/procurve/snmp/mode/interfaces.pm @@ -303,22 +303,22 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-poe-status> Set warning threshold for poe status. -Can used special variables like: %{admstatus}, %{opstatus}, %{poestatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{poestatus}, %{display} =item B<--critical-poe-status> Set critical threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{poestatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{poestatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/hp/procurve/snmp/mode/virtualchassis.pm b/src/network/hp/procurve/snmp/mode/virtualchassis.pm index a1964dec7..11595c4dd 100644 --- a/src/network/hp/procurve/snmp/mode/virtualchassis.pm +++ b/src/network/hp/procurve/snmp/mode/virtualchassis.pm @@ -324,47 +324,47 @@ Filter members by serial (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /active/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-member-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{stateLast} +You can use the following variables: %{state}, %{stateLast} =item B<--warning-member-status> Set warning threshold for status. -Can used special variables like: %{state}, %{stateLast} +You can use the following variables: %{state}, %{stateLast} =item B<--critical-member-status> Set critical threshold for status (Default: '%{state} ne %{stateLast} || %{state} =~ /communicationFailure|incompatibleOS/i'). -Can used special variables like: %{state}, %{stateLast} +You can use the following variables: %{state}, %{stateLast} =item B<--unknown-link-status> Set unknown threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-link-status> Set warning threshold for status. -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--critical-link-status> Set critical threshold for status (Default: '%{link_status} eq "down"'). -Can used special variables like: %{link_status}, %{display} +You can use the following variables: %{link_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/huawei/snmp/mode/interfaces.pm b/src/network/huawei/snmp/mode/interfaces.pm index 8729c9be0..2cdd2db30 100644 --- a/src/network/huawei/snmp/mode/interfaces.pm +++ b/src/network/huawei/snmp/mode/interfaces.pm @@ -214,12 +214,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-errors> diff --git a/src/network/infoblox/snmp/mode/system.pm b/src/network/infoblox/snmp/mode/system.pm index d33a0f2b8..e0ebfc8e6 100644 --- a/src/network/infoblox/snmp/mode/system.pm +++ b/src/network/infoblox/snmp/mode/system.pm @@ -186,12 +186,12 @@ Example: --filter-counters='^memory-usage$' =item B<--warning-ha-status> Set warning threshold for status. -Can used special variables like: %{ha_status} +You can use the following variables: %{ha_status} =item B<--critical-ha-status> Set critical threshold for status. -Can used special variables like: %{ha_status} +You can use the following variables: %{ha_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/juniper/common/junos/mode/interfaces.pm b/src/network/juniper/common/junos/mode/interfaces.pm index 1e0ecd9ba..58567110f 100644 --- a/src/network/juniper/common/junos/mode/interfaces.pm +++ b/src/network/juniper/common/junos/mode/interfaces.pm @@ -289,12 +289,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-errors> diff --git a/src/network/juniper/common/junos/mode/ipsectunnel.pm b/src/network/juniper/common/junos/mode/ipsectunnel.pm index 1faaab6c8..9676c3634 100644 --- a/src/network/juniper/common/junos/mode/ipsectunnel.pm +++ b/src/network/juniper/common/junos/mode/ipsectunnel.pm @@ -249,17 +249,17 @@ Example: --filter-counters='tunnels-total' =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{ike_state}, %{display} +You can use the following variables: %{ike_state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{ike_state}, %{display} +You can use the following variables: %{ike_state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{ike_state} eq "down"'). -Can used special variables like: %{ike_state}, %{display} +You can use the following variables: %{ike_state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/juniper/common/junos/mode/ldpsessionstatus.pm b/src/network/juniper/common/junos/mode/ldpsessionstatus.pm index bf5471da2..c19203c7d 100644 --- a/src/network/juniper/common/junos/mode/ldpsessionstatus.pm +++ b/src/network/juniper/common/junos/mode/ldpsessionstatus.pm @@ -176,12 +176,12 @@ Can be: 'entity', 'peer' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /operational/i'). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--warning-last-change> diff --git a/src/network/juniper/common/junos/mode/lspstatus.pm b/src/network/juniper/common/junos/mode/lspstatus.pm index 21bf1aff4..4de891083 100644 --- a/src/network/juniper/common/junos/mode/lspstatus.pm +++ b/src/network/juniper/common/junos/mode/lspstatus.pm @@ -197,12 +197,12 @@ Can be: 'name', 'from', 'to' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /up/i'). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--warning-*> diff --git a/src/network/juniper/common/junos/mode/rsvpsessionstatus.pm b/src/network/juniper/common/junos/mode/rsvpsessionstatus.pm index 1347cd464..4bde77f77 100644 --- a/src/network/juniper/common/junos/mode/rsvpsessionstatus.pm +++ b/src/network/juniper/common/junos/mode/rsvpsessionstatus.pm @@ -170,12 +170,12 @@ Can be: 'name', 'from', 'to' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /up/i'). -Can used special variables like: %{state} +You can use the following variables: %{state} =back diff --git a/src/network/juniper/common/junos/mode/stack.pm b/src/network/juniper/common/junos/mode/stack.pm index 86e355483..b2e4c8ad2 100644 --- a/src/network/juniper/common/junos/mode/stack.pm +++ b/src/network/juniper/common/junos/mode/stack.pm @@ -214,32 +214,32 @@ Check stack members. =item B<--unknown-member-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{role}, %{roleLast} +You can use the following variables: %{role}, %{roleLast} =item B<--warning-member-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{role}, %{roleLast} +You can use the following variables: %{role}, %{roleLast} =item B<--critical-member-status> Set critical threshold for status (Default: '%{role} ne %{roleLast}'). -Can used special variables like: %{role}, %{roleLast} +You can use the following variables: %{role}, %{roleLast} =item B<--unknown-port-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{admin_status}, %{oper_status}, %{display} +You can use the following variables: %{admin_status}, %{oper_status}, %{display} =item B<--warning-port-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{admin_status}, %{oper_status}, %{display} +You can use the following variables: %{admin_status}, %{oper_status}, %{display} =item B<--critical-port-status> Set critical threshold for status (Default: '%{admin_status} eq "up" and %{oper_status} ne "up"'). -Can used special variables like: %{admin_status}, %{oper_status}, %{display} +You can use the following variables: %{admin_status}, %{oper_status}, %{display} =back diff --git a/src/network/juniper/common/screenos/snmp/mode/nsrp.pm b/src/network/juniper/common/screenos/snmp/mode/nsrp.pm index 0edc4e20f..d99071f9a 100644 --- a/src/network/juniper/common/screenos/snmp/mode/nsrp.pm +++ b/src/network/juniper/common/screenos/snmp/mode/nsrp.pm @@ -186,17 +186,17 @@ Check nsrp groups. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /undefined/i'). -Can used special variables like: %{status}, %{statusLast} +You can use the following variables: %{status}, %{statusLast} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{statusLast} +You can use the following variables: %{status}, %{statusLast} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /ineligible|inoperable/i'). -Can used special variables like: %{status}, %{statusLast} +You can use the following variables: %{status}, %{statusLast} =item B<--warning-*> B<--critical-*> diff --git a/src/network/juniper/common/screenos/snmp/mode/vpnstatus.pm b/src/network/juniper/common/screenos/snmp/mode/vpnstatus.pm index 1969b2bb4..14fb53438 100644 --- a/src/network/juniper/common/screenos/snmp/mode/vpnstatus.pm +++ b/src/network/juniper/common/screenos/snmp/mode/vpnstatus.pm @@ -166,12 +166,12 @@ Filter VPN name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{p1state}, %{p2state} +You can use the following variables: %{p1state}, %{p2state} =item B<--critical-status> Set critical threshold for status (Default: '%{p1state} eq "inactive" || %{p2state} eq "inactive"'). -Can used special variables like: %{p1state}, %{p2state} +You can use the following variables: %{p1state}, %{p2state} =item B<--warning-update-time> diff --git a/src/network/juniper/trapeze/snmp/mode/apstatus.pm b/src/network/juniper/trapeze/snmp/mode/apstatus.pm index 378158ba4..6fd68494a 100644 --- a/src/network/juniper/trapeze/snmp/mode/apstatus.pm +++ b/src/network/juniper/trapeze/snmp/mode/apstatus.pm @@ -178,12 +178,12 @@ Filter AP name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{opstatus}, %{display} +You can use the following variables: %{opstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{opstatus} !~ /init|redundant|operationnal/'). -Can used special variables like: %{opstatus}, %{display} +You can use the following variables: %{opstatus}, %{display} =item B<--warning-total> diff --git a/src/network/kemp/snmp/mode/hastatus.pm b/src/network/kemp/snmp/mode/hastatus.pm index 9ac6584bb..8c0084710 100644 --- a/src/network/kemp/snmp/mode/hastatus.pm +++ b/src/network/kemp/snmp/mode/hastatus.pm @@ -151,22 +151,22 @@ Example: --filter-counters='^ha-status$' =item B<--warning-ha-status> Set warning threshold for status (Default: none). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-ha-status> Set critical threshold for status (Default: none). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-sync-status> Set warning threshold for status (Default: none). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-sync-status> Set critical threshold for status (Default: none). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/network/kemp/snmp/mode/rsstatus.pm b/src/network/kemp/snmp/mode/rsstatus.pm index 01a175859..eac863f29 100644 --- a/src/network/kemp/snmp/mode/rsstatus.pm +++ b/src/network/kemp/snmp/mode/rsstatus.pm @@ -191,12 +191,12 @@ Filter real server name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /inService|disabled/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/kemp/snmp/mode/vsstatus.pm b/src/network/kemp/snmp/mode/vsstatus.pm index 644ee15d9..616c1dfff 100644 --- a/src/network/kemp/snmp/mode/vsstatus.pm +++ b/src/network/kemp/snmp/mode/vsstatus.pm @@ -189,12 +189,12 @@ Filter virtual server name (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /inService|disabled|redirect/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/keysight/nvos/restapi/mode/hardware.pm b/src/network/keysight/nvos/restapi/mode/hardware.pm index a533c82ce..17e5e8237 100644 --- a/src/network/keysight/nvos/restapi/mode/hardware.pm +++ b/src/network/keysight/nvos/restapi/mode/hardware.pm @@ -163,32 +163,32 @@ Check hardware. =item B<--unknown-temperature-status> Set unknown threshold for status (Default : '%{status} eq "unknown"'). -Can used special variables like: %{status}, %{class} +You can use the following variables: %{status}, %{class} =item B<--warning-temperature-status> Set warning threshold for status (Default : '%{status} eq "warn"'). -Can used special variables like: %{status}, %{class} +You can use the following variables: %{status}, %{class} =item B<--critical-temperature-status> Set critical threshold for status (Default: '%{status} eq "hot"'); -Can used special variables like: %{status}, %{class} +You can use the following variables: %{status}, %{class} =item B<--unknown-psu-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-psu-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "bad"'); -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/keysight/nvos/restapi/mode/ports.pm b/src/network/keysight/nvos/restapi/mode/ports.pm index b85b3f691..cb294c16e 100644 --- a/src/network/keysight/nvos/restapi/mode/ports.pm +++ b/src/network/keysight/nvos/restapi/mode/ports.pm @@ -253,32 +253,32 @@ Filter ports by name (can be a regexp). =item B<--unknown-license-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-license-status> Set warning threshold for status (Default: '%{status} =~ /invalid_software_version/'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-license-status> Set critical threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-link-status> Set unknown threshold for status. -Can used special variables like: %{adminStatus}, %{operationalStatus}, %{name} +You can use the following variables: %{adminStatus}, %{operationalStatus}, %{name} =item B<--warning-link-status> Set warning threshold for status. -Can used special variables like: %{adminStatus}, %{operationalStatus}, %{name} +You can use the following variables: %{adminStatus}, %{operationalStatus}, %{name} =item B<--critical-link-status> Set critical threshold for status (Default: '%{adminStatus} eq "enabled" and %{operationalStatus} ne "up"'). -Can used special variables like: %{adminStatus}, %{operationalStatus}, %{name} +You can use the following variables: %{adminStatus}, %{operationalStatus}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/keysight/nvos/restapi/mode/time.pm b/src/network/keysight/nvos/restapi/mode/time.pm index 44c077e9e..6cd7e3d01 100644 --- a/src/network/keysight/nvos/restapi/mode/time.pm +++ b/src/network/keysight/nvos/restapi/mode/time.pm @@ -165,7 +165,7 @@ Check time offset of server with ntp server. Use local time if ntp-host option i Set thresholds for status (Default critical: '%{status} !~ /in_reach|in_sync/i') -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-offset> diff --git a/src/network/lenovo/rackswitch/snmp/mode/hardware.pm b/src/network/lenovo/rackswitch/snmp/mode/hardware.pm index 124ee99ed..0e327f6e8 100644 --- a/src/network/lenovo/rackswitch/snmp/mode/hardware.pm +++ b/src/network/lenovo/rackswitch/snmp/mode/hardware.pm @@ -137,17 +137,17 @@ Check hardware. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} eq "noncritical"'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "critical"'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/lenovo/rackswitch/snmp/mode/interfaces.pm b/src/network/lenovo/rackswitch/snmp/mode/interfaces.pm index 9c0c6ecef..f62f8373d 100644 --- a/src/network/lenovo/rackswitch/snmp/mode/interfaces.pm +++ b/src/network/lenovo/rackswitch/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/libraesva/snmp/mode/interfaces.pm b/src/network/libraesva/snmp/mode/interfaces.pm index 1cb34424d..c7050310a 100644 --- a/src/network/libraesva/snmp/mode/interfaces.pm +++ b/src/network/libraesva/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/libraesva/snmp/mode/system.pm b/src/network/libraesva/snmp/mode/system.pm index 24398552d..b3d801b66 100644 --- a/src/network/libraesva/snmp/mode/system.pm +++ b/src/network/libraesva/snmp/mode/system.pm @@ -172,17 +172,17 @@ Example: --filter-counters='^mail-sent$' =item B<--unknown-cluster-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{cluster_status} +You can use the following variables: %{cluster_status} =item B<--warning-cluster-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{cluster_status} +You can use the following variables: %{cluster_status} =item B<--critical-cluster-status> Set critical threshold for status (Default: '%{cluster_status} =~ /error/i'). -Can used special variables like: %{cluster_status} +You can use the following variables: %{cluster_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/microsens/g6/snmp/mode/interfaces.pm b/src/network/microsens/g6/snmp/mode/interfaces.pm index 1b9b7c82c..972c6aa36 100644 --- a/src/network/microsens/g6/snmp/mode/interfaces.pm +++ b/src/network/microsens/g6/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/microsens/g6/snmp/mode/sfp.pm b/src/network/microsens/g6/snmp/mode/sfp.pm index 188246f14..0bbc0c24c 100644 --- a/src/network/microsens/g6/snmp/mode/sfp.pm +++ b/src/network/microsens/g6/snmp/mode/sfp.pm @@ -198,12 +198,12 @@ Filter ports by index (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name}, %{location} +You can use the following variables: %{status}, %{name}, %{location} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /txFailure|lossOfSignal|readError/'). -Can used special variables like: %{status}, %{port}, %{location} +You can use the following variables: %{status}, %{port}, %{location} =item B<--warning-*> B<--critical-*> diff --git a/src/network/mikrotik/snmp/mode/firmware.pm b/src/network/mikrotik/snmp/mode/firmware.pm index 9f1831fc9..fa277e5c2 100644 --- a/src/network/mikrotik/snmp/mode/firmware.pm +++ b/src/network/mikrotik/snmp/mode/firmware.pm @@ -101,12 +101,12 @@ Check firmware status. =item B<--warning-status> Set warning threshold for status (Default : '%{firmware_version} ne %{software_version}'). -Can used special variables like: %{model}, %{software_version}, %{firmware_version}, %{firmware_version_update} +You can use the following variables: %{model}, %{software_version}, %{firmware_version}, %{firmware_version_update} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{model}, %{software_version}, %{firmware_version}, %{firmware_version_update} +You can use the following variables: %{model}, %{software_version}, %{firmware_version}, %{firmware_version_update} =back diff --git a/src/network/mikrotik/snmp/mode/interfaces.pm b/src/network/mikrotik/snmp/mode/interfaces.pm index f4231e922..0a955428d 100644 --- a/src/network/mikrotik/snmp/mode/interfaces.pm +++ b/src/network/mikrotik/snmp/mode/interfaces.pm @@ -180,12 +180,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-errors> diff --git a/src/network/mrv/optiswitch/snmp/mode/interfaces.pm b/src/network/mrv/optiswitch/snmp/mode/interfaces.pm index 68e667616..940e83ae7 100644 --- a/src/network/mrv/optiswitch/snmp/mode/interfaces.pm +++ b/src/network/mrv/optiswitch/snmp/mode/interfaces.pm @@ -463,12 +463,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "enable =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{linkstatus}, %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{linkstatus}, %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "enable" and %{opstatus} eq "enabled" and %{linkstatus} ne "true"'). -Can used special variables like: %{linkstatus}, %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{linkstatus}, %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/netgear/sseries/snmp/mode/interfaces.pm b/src/network/netgear/sseries/snmp/mode/interfaces.pm index d1a1016fb..6691677da 100644 --- a/src/network/netgear/sseries/snmp/mode/interfaces.pm +++ b/src/network/netgear/sseries/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/nokia/timos/snmp/mode/bgpusage.pm b/src/network/nokia/timos/snmp/mode/bgpusage.pm index 5f22f8cf7..9df68ad9b 100644 --- a/src/network/nokia/timos/snmp/mode/bgpusage.pm +++ b/src/network/nokia/timos/snmp/mode/bgpusage.pm @@ -203,12 +203,12 @@ Can be: 'active-prefixes', 'sent-prefixes', 'received-prefixes'. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{state} +You can use the following variables: %{display}, %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /outOfService/') -Can used special variables like: %{display}, %{state} +You can use the following variables: %{display}, %{state} =item B<--filter-name> diff --git a/src/network/nokia/timos/snmp/mode/hardware.pm b/src/network/nokia/timos/snmp/mode/hardware.pm index e23cc01d2..64b3c5a92 100644 --- a/src/network/nokia/timos/snmp/mode/hardware.pm +++ b/src/network/nokia/timos/snmp/mode/hardware.pm @@ -50,7 +50,7 @@ sub set_system { ['preExtension', 'OK'] ] }; - + $self->{components_path} = 'network::nokia::timos::snmp::mode::components'; $self->{components_module} = ['entity']; } @@ -168,35 +168,45 @@ sub check { next if ($oid !~ /^$mapping->{tmnxHwName}->{oid}\.(.*)$/); my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => $instance); - + next if ($self->check_filter(section => 'entity', instance => $result->{tmnxHwClass} . '.' . $instance)); - + $self->{components}->{entity}->{total}++; - $self->{output}->output_add(long_msg => sprintf("%s '%s' status is '%s' [instance = %s, temperature = %s]", - $result->{tmnxHwClass}, $result->{tmnxHwName}, - $result->{tmnxHwOperState}, $result->{tmnxHwClass} . '.' . $instance, - $result->{tmnxHwTempSensor} eq 'true' ? $result->{tmnxHwTemperature} : '-')); + $self->{output}->output_add( + long_msg => sprintf( + "%s '%s' status is '%s' [instance = %s, temperature = %s]", + $result->{tmnxHwClass}, $result->{tmnxHwName}, + $result->{tmnxHwOperState}, $result->{tmnxHwClass} . '.' . $instance, + $result->{tmnxHwTempSensor} eq 'true' ? $result->{tmnxHwTemperature} : '-' + ) + ); $exit = $self->get_severity(label => 'default', section => 'entity', instance => $result->{tmnxHwClass} . '.' . $instance, value => $result->{tmnxHwOperState}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("%s '%s' status is '%s'", $result->{tmnxHwClass}, $result->{tmnxHwName}, $result->{tmnxHwOperState})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("%s '%s' status is '%s'", $result->{tmnxHwClass}, $result->{tmnxHwName}, $result->{tmnxHwOperState})); } - + next if ($result->{tmnxHwTempSensor} eq 'false'); - ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $result->{tmnxHwClass} . '.' . $instance,, value => $result->{tmnxHwTemperature}); + ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $result->{tmnxHwClass} . '.' . $instance, value => $result->{tmnxHwTemperature}); if ($checked == 0 && $result->{tmnxHwTempThreshold} != -1 ) { $self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $result->{tmnxHwClass} . '.' . $instance, value => $result->{tmnxHwTempThreshold}); - $exit = $self->{perfdata}->threshold_check(value => $result->{slHdwTempSensorCurrentTemp}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }]); + $exit = $self->{perfdata}->threshold_check(value => $result->{tmnxHwTemperature}, threshold => [ { label => 'critical-temperature-instance-' . $instance, exit_litteral => 'critical' }]); $warn = undef; $crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $result->{tmnxHwClass} . '.' . $instance); } - + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("%s '%s' temperature is '%s' C", $result->{tmnxHwClass}, - $result->{tmnxHwName}, $result->{tmnxHwTemperature})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf( + "%s '%s' temperature is '%s' C", $result->{tmnxHwClass}, + $result->{tmnxHwName}, $result->{tmnxHwTemperature} + ) + ); } + $self->{output}->perfdata_add( label => 'temperature', unit => 'C', nlabel => 'hardware.entity.temperature.celsius', diff --git a/src/network/nokia/timos/snmp/mode/isisusage.pm b/src/network/nokia/timos/snmp/mode/isisusage.pm index 3c980c99a..dc3adb676 100644 --- a/src/network/nokia/timos/snmp/mode/isisusage.pm +++ b/src/network/nokia/timos/snmp/mode/isisusage.pm @@ -212,12 +212,12 @@ Can be: 'total-int-inservice', 'total-int-outservice'. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{oper_state}, %{admin_state}. +You can use the following variables: %{display}, %{oper_state}, %{admin_state}. =item B<--critical-status> Set critical threshold for status (Default: '%{admin_state} eq "inService" and %{oper_state} !~ /inService|transition/'). -Can used special variables like: %{display}, %{oper_state}, %{admin_state}. +You can use the following variables: %{display}, %{oper_state}, %{admin_state}. =item B<--filter-name> diff --git a/src/network/nokia/timos/snmp/mode/l2tpusage.pm b/src/network/nokia/timos/snmp/mode/l2tpusage.pm index 85355cfef..9adea3f3f 100644 --- a/src/network/nokia/timos/snmp/mode/l2tpusage.pm +++ b/src/network/nokia/timos/snmp/mode/l2tpusage.pm @@ -299,12 +299,12 @@ Can be: 'vrtr-tunnel-total', 'vrtr-tunnel-active-sessions', 'vrtr-tunnel-total-s =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{state} +You can use the following variables: %{display}, %{state} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{display}, %{state} +You can use the following variables: %{display}, %{state} =item B<--filter-vrtr-name> diff --git a/src/network/nokia/timos/snmp/mode/ldpusage.pm b/src/network/nokia/timos/snmp/mode/ldpusage.pm index 487a688ab..54fd1a2d8 100644 --- a/src/network/nokia/timos/snmp/mode/ldpusage.pm +++ b/src/network/nokia/timos/snmp/mode/ldpusage.pm @@ -223,12 +223,12 @@ Can be: 'ipv4-oper-down-events', 'ipv4-active-sessions', 'ipv4-active-link-adj', =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{ipv4_oper_state}, %{admin_state}, %{display} +You can use the following variables: %{ipv4_oper_state}, %{admin_state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admin_state} eq "inService" and %{ipv4_oper_state} !~ /inService|transition/'). -Can used special variables like: %{ipv4_oper_state}, %{admin_state}, %{display} +You can use the following variables: %{ipv4_oper_state}, %{admin_state}, %{display} =item B<--filter-name> diff --git a/src/network/nokia/timos/snmp/mode/sapusage.pm b/src/network/nokia/timos/snmp/mode/sapusage.pm index 1a39082c7..febaa64d8 100644 --- a/src/network/nokia/timos/snmp/mode/sapusage.pm +++ b/src/network/nokia/timos/snmp/mode/sapusage.pm @@ -218,12 +218,12 @@ Check service access point usage. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admin_state} eq "up" and %{oper_state} !~ /up/'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/nortel/standard/snmp/mode/interfaces.pm b/src/network/nortel/standard/snmp/mode/interfaces.pm index 5a683c2fd..8c44ab99f 100644 --- a/src/network/nortel/standard/snmp/mode/interfaces.pm +++ b/src/network/nortel/standard/snmp/mode/interfaces.pm @@ -104,12 +104,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/nortel/standard/snmp/mode/stack.pm b/src/network/nortel/standard/snmp/mode/stack.pm index 3a87f0955..e87a91a49 100644 --- a/src/network/nortel/standard/snmp/mode/stack.pm +++ b/src/network/nortel/standard/snmp/mode/stack.pm @@ -218,17 +218,17 @@ Check stack units. =item B<--unknown-unit-status> Set unknown threshold for status. -Can used special variables like: %{operState}, %{adminState}, %{serial} +You can use the following variables: %{operState}, %{adminState}, %{serial} =item B<--warning-unit-status> Set warning threshold for status (Default: '%{adminState} eq "enable" && %{operState} =~ /nonFatalErr|warning/i'). -Can used special variables like: %{operState}, %{adminState}, %{serial} +You can use the following variables: %{operState}, %{adminState}, %{serial} =item B<--critical-unit-status> Set critical threshold for status (Default: '%{adminState} eq "enable" && %{operState} =~ /fatalErr/i'). -Can used special variables like: %{operState}, %{adminState}, %{serial} +You can use the following variables: %{operState}, %{adminState}, %{serial} =item B<--unit> diff --git a/src/network/oneaccess/snmp/mode/cellsradio.pm b/src/network/oneaccess/snmp/mode/cellsradio.pm index aa3fe1c33..5fb1e3d4b 100644 --- a/src/network/oneaccess/snmp/mode/cellsradio.pm +++ b/src/network/oneaccess/snmp/mode/cellsradio.pm @@ -295,17 +295,17 @@ Filter cell modules by id (IMEI or MEID). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{simStatus}, %{signalQuality}, %{cellId}, %{operator}, %{imsi} +You can use the following variables: %{simStatus}, %{signalQuality}, %{cellId}, %{operator}, %{imsi} =item B<--warning-status> Set warning threshold for status (Default: '%{signalQuality} =~ /poor/'). -Can used special variables like: %{simStatus}, %{signalQuality}, %{cellId}, %{operator}, %{imsi} +You can use the following variables: %{simStatus}, %{signalQuality}, %{cellId}, %{operator}, %{imsi} =item B<--critical-status> Set critical threshold for status (Default: '%{simStatus} eq "notPresent" || %{signalQuality} =~ /none/'). -Can used special variables like: %{simStatus}, %{signalQuality}, %{cellId}, %{operator}, %{imsi} +You can use the following variables: %{simStatus}, %{signalQuality}, %{cellId}, %{operator}, %{imsi} =item B<--warning-*> B<--critical-*> diff --git a/src/network/oneaccess/snmp/mode/interfaces.pm b/src/network/oneaccess/snmp/mode/interfaces.pm index 021a2d696..ca1b3ef2b 100644 --- a/src/network/oneaccess/snmp/mode/interfaces.pm +++ b/src/network/oneaccess/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/oneaccess/snmp/mode/rttprobes.pm b/src/network/oneaccess/snmp/mode/rttprobes.pm index adeee9b0a..58106be5a 100644 --- a/src/network/oneaccess/snmp/mode/rttprobes.pm +++ b/src/network/oneaccess/snmp/mode/rttprobes.pm @@ -191,17 +191,17 @@ Filter probes by name. =item B<--unknown-probe-status> Set unknown threshold for status. -Can used special variables like: %{adminStatus}, %{status}, %{type}, %{tag} +You can use the following variables: %{adminStatus}, %{status}, %{type}, %{tag} =item B<--warning-probe-estatus> Set warning threshold for status. -Can used special variables like: %{adminStatus}, %{status}, %{type}, %{tag} +You can use the following variables: %{adminStatus}, %{status}, %{type}, %{tag} =item B<--critical-probe-status> Set critical threshold for status (Default: '%{adminStatus} eq "active" and %{status} ne "ok"'). -Can used special variables like: %{adminStatus}, %{status}, %{type}, %{tag} +You can use the following variables: %{adminStatus}, %{status}, %{type}, %{tag} =item B<--warning-*> B<--critical-*> diff --git a/src/network/opengear/snmp/mode/interfaces.pm b/src/network/opengear/snmp/mode/interfaces.pm index e2c9da614..c99887a02 100644 --- a/src/network/opengear/snmp/mode/interfaces.pm +++ b/src/network/opengear/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/oracle/infiniband/snmp/mode/infinibandusage.pm b/src/network/oracle/infiniband/snmp/mode/infinibandusage.pm index e3eb48cc3..ebe25c97f 100644 --- a/src/network/oracle/infiniband/snmp/mode/infinibandusage.pm +++ b/src/network/oracle/infiniband/snmp/mode/infinibandusage.pm @@ -345,12 +345,12 @@ Units of thresholds for the traffic (Default: '%') ('%', 'b/s'). =item B<--warning-ib-status> Set warning threshold for ib status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-ib-status> Set critical threshold for ib status (Default: '%{status} !~ /up/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/network/paloalto/snmp/mode/panorama.pm b/src/network/paloalto/snmp/mode/panorama.pm index 046af622f..c3152e5de 100644 --- a/src/network/paloalto/snmp/mode/panorama.pm +++ b/src/network/paloalto/snmp/mode/panorama.pm @@ -112,12 +112,12 @@ Check panorama connection status. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /not-connected/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =back diff --git a/src/network/paloalto/ssh/mode/interfaces.pm b/src/network/paloalto/ssh/mode/interfaces.pm index 09ceaf486..308c2723a 100644 --- a/src/network/paloalto/ssh/mode/interfaces.pm +++ b/src/network/paloalto/ssh/mode/interfaces.pm @@ -132,17 +132,17 @@ Filter interface name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{type}, %{ha_state}, %{display} +You can use the following variables: %{state}, %{type}, %{ha_state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{type}, %{ha_state}, %{display} +You can use the following variables: %{state}, %{type}, %{ha_state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} ne "active"'). -Can used special variables like: %{state}, %{type}, %{ha_state}, %{display} +You can use the following variables: %{state}, %{type}, %{ha_state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/paloalto/ssh/mode/ipsec.pm b/src/network/paloalto/ssh/mode/ipsec.pm index 5958dad28..f0e764003 100644 --- a/src/network/paloalto/ssh/mode/ipsec.pm +++ b/src/network/paloalto/ssh/mode/ipsec.pm @@ -150,17 +150,17 @@ Filter tunnels by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{ike_phase1_state}, %{state}, %{monitor_status}, %{display}. +You can use the following variables: %{ike_phase1_state}, %{state}, %{monitor_status}, %{display}. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{ike_phase1_state}, %{state}, %{monitor_status}, %{display}. +You can use the following variables: %{ike_phase1_state}, %{state}, %{monitor_status}, %{display}. =item B<--critical-status> Set critical threshold for status (Default: '%{ike_phase1_state} eq "down" or %{state} ne "active"'). -Can used special variables like: %{ike_phase1_state}, %{state}, %{monitor_status}, %{display}. +You can use the following variables: %{ike_phase1_state}, %{state}, %{monitor_status}, %{display}. =item B<--warning-*> B<--critical-*> diff --git a/src/network/paloalto/ssh/mode/system.pm b/src/network/paloalto/ssh/mode/system.pm index 7fce52b20..183c66e7f 100644 --- a/src/network/paloalto/ssh/mode/system.pm +++ b/src/network/paloalto/ssh/mode/system.pm @@ -258,12 +258,12 @@ Timezone options. Default is 'GMT'. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{oper_mode} +You can use the following variables: %{oper_mode} =item B<--critical-status> Set critical threshold for status (Default: '%{oper_mode} !~ /normal/i'). -Can used special variables like: %{oper_mode} +You can use the following variables: %{oper_mode} =item B<--warning-*> B<--critical-*> diff --git a/src/network/peplink/pepwave/snmp/mode/wanusage.pm b/src/network/peplink/pepwave/snmp/mode/wanusage.pm index 4961fd19f..45385ff7b 100644 --- a/src/network/peplink/pepwave/snmp/mode/wanusage.pm +++ b/src/network/peplink/pepwave/snmp/mode/wanusage.pm @@ -196,12 +196,12 @@ Filter wan name (can be a regexp). =item B<--warning-health-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{health_status}, %{display} +You can use the following variables: %{health_status}, %{display} =item B<--critical-health-status> Set critical threshold for status (Default: '%{health_status} =~ /fail/'). -Can used special variables like: %{health_status}, %{display} +You can use the following variables: %{health_status}, %{display} =item B<--warning-*> diff --git a/src/network/perle/ids/snmp/mode/alarms.pm b/src/network/perle/ids/snmp/mode/alarms.pm index 2057ae381..4a7d27916 100644 --- a/src/network/perle/ids/snmp/mode/alarms.pm +++ b/src/network/perle/ids/snmp/mode/alarms.pm @@ -177,12 +177,12 @@ Filter by message (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor/i') -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical|major/i'). -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--memory> diff --git a/src/network/rad/airmux/snmp/mode/alarms.pm b/src/network/rad/airmux/snmp/mode/alarms.pm index 246783335..7f89c115a 100644 --- a/src/network/rad/airmux/snmp/mode/alarms.pm +++ b/src/network/rad/airmux/snmp/mode/alarms.pm @@ -171,12 +171,12 @@ Filter by message (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor|warning/i') -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical|major/i'). -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--memory> diff --git a/src/network/radware/alteon/snmp/mode/vserverstatus.pm b/src/network/radware/alteon/snmp/mode/vserverstatus.pm index 90fe48e6d..63619f40a 100644 --- a/src/network/radware/alteon/snmp/mode/vserverstatus.pm +++ b/src/network/radware/alteon/snmp/mode/vserverstatus.pm @@ -206,12 +206,12 @@ Can be: 'traffic', 'total-sessions', 'current-sessions'. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--filter-name> diff --git a/src/network/raisecom/snmp/mode/interfaces.pm b/src/network/raisecom/snmp/mode/interfaces.pm index 021d7b78e..00bbb4f75 100644 --- a/src/network/raisecom/snmp/mode/interfaces.pm +++ b/src/network/raisecom/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/ruckus/scg/snmp/mode/apstatus.pm b/src/network/ruckus/scg/snmp/mode/apstatus.pm index 9edbf406c..cdbe9bbd8 100644 --- a/src/network/ruckus/scg/snmp/mode/apstatus.pm +++ b/src/network/ruckus/scg/snmp/mode/apstatus.pm @@ -156,12 +156,12 @@ Filter by AP name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{configuration_status} !~ /^Up-to-date$/i'). -Can used special variables like: %{connection_status}, %{registration_status}, %{configuration_status}, %{display} +You can use the following variables: %{connection_status}, %{registration_status}, %{configuration_status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{connection_status} =~ /^Disconnect$/i'). -Can used special variables like: %{connection_status}, %{registration_status}, %{configuration_status}, %{display} +You can use the following variables: %{connection_status}, %{registration_status}, %{configuration_status}, %{display} =back diff --git a/src/network/ruckus/smartzone/snmp/mode/accesspoints.pm b/src/network/ruckus/smartzone/snmp/mode/accesspoints.pm index e08c49ee6..eba3318ca 100644 --- a/src/network/ruckus/smartzone/snmp/mode/accesspoints.pm +++ b/src/network/ruckus/smartzone/snmp/mode/accesspoints.pm @@ -221,17 +221,17 @@ Filter by access point name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{config_status}, %{connection_status}, %{registration_status} +You can use the following variables: %{config_status}, %{connection_status}, %{registration_status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{config_status}, %{connection_status}, %{registration_status} +You can use the following variables: %{config_status}, %{connection_status}, %{registration_status} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{config_status}, %{connection_status}, %{registration_status} +You can use the following variables: %{config_status}, %{connection_status}, %{registration_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/ruckus/zonedirector/snmp/mode/accesspoints.pm b/src/network/ruckus/zonedirector/snmp/mode/accesspoints.pm index 1859cf595..69f295892 100644 --- a/src/network/ruckus/zonedirector/snmp/mode/accesspoints.pm +++ b/src/network/ruckus/zonedirector/snmp/mode/accesspoints.pm @@ -303,17 +303,17 @@ Filter by access point name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{zd_connection_status} +You can use the following variables: %{zd_connection_status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{zd_connection_status} +You can use the following variables: %{zd_connection_status} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{zd_connection_status} +You can use the following variables: %{zd_connection_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/ruckus/zonedirector/snmp/mode/system.pm b/src/network/ruckus/zonedirector/snmp/mode/system.pm index 5ae574bb1..0e7ccea65 100644 --- a/src/network/ruckus/zonedirector/snmp/mode/system.pm +++ b/src/network/ruckus/zonedirector/snmp/mode/system.pm @@ -264,17 +264,17 @@ Check system. =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{system_status}, %{peer_connected_status} +You can use the following variables: %{system_status}, %{peer_connected_status} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{system_status}, %{peer_connected_status} +You can use the following variables: %{system_status}, %{peer_connected_status} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{system_status}, %{peer_connected_status} +You can use the following variables: %{system_status}, %{peer_connected_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/silverpeak/snmp/mode/alarms.pm b/src/network/silverpeak/snmp/mode/alarms.pm index 8b1567e26..369979236 100644 --- a/src/network/silverpeak/snmp/mode/alarms.pm +++ b/src/network/silverpeak/snmp/mode/alarms.pm @@ -206,12 +206,12 @@ Filter by message (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor|warning/i') -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical|major/i'). -Can used special variables like: %{severity}, %{text}, %{source}, %{since} +You can use the following variables: %{severity}, %{text}, %{source}, %{since} =item B<--memory> diff --git a/src/network/sonus/sbc/snmp/mode/channels.pm b/src/network/sonus/sbc/snmp/mode/channels.pm index 7ea06b92c..7a32aff0d 100644 --- a/src/network/sonus/sbc/snmp/mode/channels.pm +++ b/src/network/sonus/sbc/snmp/mode/channels.pm @@ -378,12 +378,12 @@ Filter channels by channel id (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/sonus/sbc/snmp/mode/dspstats.pm b/src/network/sonus/sbc/snmp/mode/dspstats.pm index b6ce02f4c..11a21da98 100644 --- a/src/network/sonus/sbc/snmp/mode/dspstats.pm +++ b/src/network/sonus/sbc/snmp/mode/dspstats.pm @@ -136,12 +136,12 @@ Thresholds. Can be: 'cpu-utilization', 'channels-active'. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} eq "down"'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =back diff --git a/src/network/sonus/sbc/snmp/mode/interfaces.pm b/src/network/sonus/sbc/snmp/mode/interfaces.pm index cd3656ac3..ee0e1251a 100644 --- a/src/network/sonus/sbc/snmp/mode/interfaces.pm +++ b/src/network/sonus/sbc/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/stonesoft/snmp/mode/clusterstate.pm b/src/network/stonesoft/snmp/mode/clusterstate.pm index 0a4612945..491e61e76 100644 --- a/src/network/stonesoft/snmp/mode/clusterstate.pm +++ b/src/network/stonesoft/snmp/mode/clusterstate.pm @@ -110,17 +110,17 @@ Check status of clustered node. =item B<--unknown-status> Set unknown threshold for status (Default: '%{node_status} =~ /unknown/i'). -Can used special variables like: %{node_status}, %{node_member_id}. +You can use the following variables: %{node_status}, %{node_member_id}. =item B<--warning-status> Set warning threshold for status (Default: '%{node_status} =~ /lockedOnline/i'). -Can used special variables like: %{node_status}, %{node_member_id}. +You can use the following variables: %{node_status}, %{node_member_id}. =item B<--critical-status> Set critical threshold for status (Default: '%{node_status} =~ /^(?:offline|goingOffline|lockedOffline|goingLockedOffline|standby|goingStandby)$/i'). -Can used special variables like: %{node_status}, %{node_member_id}. +You can use the following variables: %{node_status}, %{node_member_id}. =back diff --git a/src/network/stormshield/api/mode/ha.pm b/src/network/stormshield/api/mode/ha.pm index 3c2ac5c35..28130616e 100644 --- a/src/network/stormshield/api/mode/ha.pm +++ b/src/network/stormshield/api/mode/ha.pm @@ -222,47 +222,47 @@ Check high availability. =item B<--unknown-member-state> Set unknown threshold for status. -Can used special variables like: %{state}, %{name} +You can use the following variables: %{state}, %{name} =item B<--warning-member-state> Set warning threshold for status. -Can used special variables like: %{state}, %{name} +You can use the following variables: %{state}, %{name} =item B<--critical-member-state> Set critical threshold for status. -Can used special variables like: %{state}, %{name} +You can use the following variables: %{state}, %{name} =item B<--unknown-member-link-status> Set unknown threshold for status (Default: '%{linkStatus} =~ /unknown/i'). -Can used special variables like: %{linkStatus}, %{name} +You can use the following variables: %{linkStatus}, %{name} =item B<--warning-member-link-status> Set warning threshold for status. -Can used special variables like: %{linkStatus}, %{name} +You can use the following variables: %{linkStatus}, %{name} =item B<--critical-member-link-status> Set critical threshold for status (Default: '%{linkStatus} =~ /failed|failing/i'). -Can used special variables like: %{linkStatus}, %{name} +You can use the following variables: %{linkStatus}, %{name} =item B<--unknown-member-config> Set unknown threshold for status. -Can used special variables like: %{isConfigSync}, %{name} +You can use the following variables: %{isConfigSync}, %{name} =item B<--warning-member-config> Set warning threshold for status (Default: '%{isConfigSync} eq "no"'). -Can used special variables like: %{isConfigSync}, %{name} +You can use the following variables: %{isConfigSync}, %{name} =item B<--critical-member-config> Set critical threshold for status. -Can used special variables like: %{isConfigSync}, %{name} +You can use the following variables: %{isConfigSync}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/stormshield/api/mode/health.pm b/src/network/stormshield/api/mode/health.pm index 237948e00..486288a03 100644 --- a/src/network/stormshield/api/mode/health.pm +++ b/src/network/stormshield/api/mode/health.pm @@ -136,17 +136,17 @@ Filter by firewalls by serial (can be a regexp). =item B<--unknown-service-status> Set unknown threshold for status. -Can used special variables like: %{health}, %{service} +You can use the following variables: %{health}, %{service} =item B<--warning-service-status> Set warning threshold for status (Default: '%{health} =~ /minor/i'). -Can used special variables like: %{health}, %{service} +You can use the following variables: %{health}, %{service} =item B<--critical-service-status> Set critical threshold for status (Default: '%{health} =~ /major/i'). -Can used special variables like: %{health}, %{service} +You can use the following variables: %{health}, %{service} =back diff --git a/src/network/stormshield/api/mode/interfaces.pm b/src/network/stormshield/api/mode/interfaces.pm index 0192a655a..949267290 100644 --- a/src/network/stormshield/api/mode/interfaces.pm +++ b/src/network/stormshield/api/mode/interfaces.pm @@ -435,17 +435,17 @@ Units of thresholds for the traffic (Default: 'percent_delta') ('percent_delta', =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{plugged}, %{user_name}, %{real_name} +You can use the following variables: %{state}, %{plugged}, %{user_name}, %{real_name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{plugged}, %{user_name}, %{real_name} +You can use the following variables: %{state}, %{plugged}, %{user_name}, %{real_name} =item B<--critical-status> Set critical threshold for status (Default: "%{state} eq 'enabled' and %{plugged} eq 'unplugged'") -Can used special variables like: %{state}, %{plugged}, %{user_name}, %{real_name} +You can use the following variables: %{state}, %{plugged}, %{user_name}, %{real_name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/stormshield/snmp/mode/hanodes.pm b/src/network/stormshield/snmp/mode/hanodes.pm index d2c5898b7..c9f693881 100644 --- a/src/network/stormshield/snmp/mode/hanodes.pm +++ b/src/network/stormshield/snmp/mode/hanodes.pm @@ -239,12 +239,12 @@ Critical on deadnode (absolute unless --percent is used) =item B<--warning-state> Set warning threshold for state. -Can used special variables like: %{state}, %{role} +You can use the following variables: %{state}, %{role} =item B<--critical-state> Set critical threshold for state. (Default: '%{state} =~ /offline/i'). -Can used special variables like: %{state}, %{role} +You can use the following variables: %{state}, %{role} =item B<--percent> diff --git a/src/network/stormshield/snmp/mode/health.pm b/src/network/stormshield/snmp/mode/health.pm index 1424c7688..3182af885 100644 --- a/src/network/stormshield/snmp/mode/health.pm +++ b/src/network/stormshield/snmp/mode/health.pm @@ -172,17 +172,17 @@ Filter by firewall serial (can be a regexp). =item B<--unknown-service-status> Set unknown threshold for status. -Can used special variables like: %{health}, %{service} +You can use the following variables: %{health}, %{service} =item B<--warning-service-status> Set warning threshold for status (Default: '%{health} =~ /minor/i'). -Can used special variables like: %{health}, %{service} +You can use the following variables: %{health}, %{service} =item B<--critical-service-status> Set critical threshold for status (Default: '%{health} =~ /major/i'). -Can used special variables like: %{health}, %{service} +You can use the following variables: %{health}, %{service} =back diff --git a/src/network/stormshield/snmp/mode/vpnstatus.pm b/src/network/stormshield/snmp/mode/vpnstatus.pm index ae122de87..f0e2a42e3 100644 --- a/src/network/stormshield/snmp/mode/vpnstatus.pm +++ b/src/network/stormshield/snmp/mode/vpnstatus.pm @@ -251,17 +251,17 @@ Filter by dst ip (regexp can be used). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{srcIp}, %{dstIp} +You can use the following variables: %{state}, %{srcIp}, %{dstIp} =item B<--warning-status> Set warning threshold for status (Default: '%{state} eq "dead"'). -Can used special variables like: %{state}, %{srcIp}, %{dstIp} +You can use the following variables: %{state}, %{srcIp}, %{dstIp} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{srcIp}, %{dstIp} +You can use the following variables: %{state}, %{srcIp}, %{dstIp} =item B<--warning-*> B<--critical-*> diff --git a/src/network/teltonika/snmp/mode/system.pm b/src/network/teltonika/snmp/mode/system.pm index e11ce4734..6fb50c00f 100644 --- a/src/network/teltonika/snmp/mode/system.pm +++ b/src/network/teltonika/snmp/mode/system.pm @@ -184,12 +184,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{sim_state}, %{pin_state}, %{net_state}, %{connection_state} +You can use the following variables: %{sim_state}, %{pin_state}, %{net_state}, %{connection_state} =item B<--critical-status> Set critical threshold for status (Default: '%{connection_state} !~ /connected/i'). -Can used special variables like: %{sim_state}, %{pin_state}, %{net_state}, %{connection_state} +You can use the following variables: %{sim_state}, %{pin_state}, %{net_state}, %{connection_state} =item B<--warning-*> B<--critical-*> diff --git a/src/network/ubiquiti/airfiber/snmp/mode/radios.pm b/src/network/ubiquiti/airfiber/snmp/mode/radios.pm index cb4dd8562..2e2fc86d4 100644 --- a/src/network/ubiquiti/airfiber/snmp/mode/radios.pm +++ b/src/network/ubiquiti/airfiber/snmp/mode/radios.pm @@ -222,17 +222,17 @@ Filter interface by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{enabled}, %{state}, %{name} +You can use the following variables: %{enabled}, %{state}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{enabled}, %{state}, %{name} +You can use the following variables: %{enabled}, %{state}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{enabled} eq "yes" and %{state} eq "down"'). -Can used special variables like: %{enabled}, %{state}, %{name} +You can use the following variables: %{enabled}, %{state}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/ubiquiti/unifi/snmp/mode/virtualaccesspoints.pm b/src/network/ubiquiti/unifi/snmp/mode/virtualaccesspoints.pm index 9d8158350..57e66fc31 100644 --- a/src/network/ubiquiti/unifi/snmp/mode/virtualaccesspoints.pm +++ b/src/network/ubiquiti/unifi/snmp/mode/virtualaccesspoints.pm @@ -228,17 +228,17 @@ Filter virtual access points by SSID (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{name}, %{ssid}, %{status} +You can use the following variables: %{name}, %{ssid}, %{status} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{name}, %{ssid}, %{status} +You can use the following variables: %{name}, %{ssid}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "down"'). -Can used special variables like: %{name}, %{ssid}, %{status} +You can use the following variables: %{name}, %{ssid}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/ucopia/wlc/snmp/mode/system.pm b/src/network/ucopia/wlc/snmp/mode/system.pm index 5ebfe22cb..649895ecb 100644 --- a/src/network/ucopia/wlc/snmp/mode/system.pm +++ b/src/network/ucopia/wlc/snmp/mode/system.pm @@ -224,22 +224,22 @@ Example: --filter-counters='service-status' =item B<--warning-service-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-service-status> Set critical threshold for status (Default: '%{status} eq "stopped"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-ha-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{ha_status} +You can use the following variables: %{ha_status} =item B<--critical-ha-status> Set critical threshold for status (Default: '%{ha_status} eq "fault"'). -Can used special variables like: %{ha_status} +You can use the following variables: %{ha_status} =item B<--warning-*> B<--critical-*> diff --git a/src/network/vectra/restapi/mode/disk.pm b/src/network/vectra/restapi/mode/disk.pm index f4b84efa1..efac5d075 100644 --- a/src/network/vectra/restapi/mode/disk.pm +++ b/src/network/vectra/restapi/mode/disk.pm @@ -134,17 +134,17 @@ Check disks. =item B<--unknown-raid-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-raid-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-raid-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/vectra/restapi/mode/interfaces.pm b/src/network/vectra/restapi/mode/interfaces.pm index 84f9d128d..5f4474fc1 100644 --- a/src/network/vectra/restapi/mode/interfaces.pm +++ b/src/network/vectra/restapi/mode/interfaces.pm @@ -120,17 +120,17 @@ Filter interfaces by name (can be a regexp). =item B<--unknown-interface-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-interface-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-interface-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/vectra/restapi/mode/memory.pm b/src/network/vectra/restapi/mode/memory.pm index fafbdd25c..014eedfff 100644 --- a/src/network/vectra/restapi/mode/memory.pm +++ b/src/network/vectra/restapi/mode/memory.pm @@ -136,17 +136,17 @@ Check memory usage. =item B<--unknown-dimm-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-dimm-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-dimm-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/network/vectra/restapi/mode/sensors.pm b/src/network/vectra/restapi/mode/sensors.pm index 376f9e0b3..2dbda1767 100644 --- a/src/network/vectra/restapi/mode/sensors.pm +++ b/src/network/vectra/restapi/mode/sensors.pm @@ -205,62 +205,62 @@ Filter sensors by name (can be a regexp). =item B<--unknown-sensor-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-sensor-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-sensor-status> Set critical threshold for status (Default: '%{status} !~ /^paired/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-trafficdrop-status> Set warning threshold for status. -Can used special variables like: %{trafficDropStatus}, %{name} +You can use the following variables: %{trafficDropStatus}, %{name} =item B<--warning-trafficdrop-status> Set warning threshold for status (Default: '%{trafficDropStatus} =~ /warning|unknown|skip/i'). -Can used special variables like: %{trafficDropStatus}, %{name} +You can use the following variables: %{trafficDropStatus}, %{name} =item B<--critical-trafficdrop-status> Set critical threshold for status. -Can used special variables like: %{trafficDropStatus}, %{name} +You can use the following variables: %{trafficDropStatus}, %{name} =item B<--unknown-connectivity-status> Set warning threshold for status (Default: '%{connectivityStatus} =~ /unknown/i'). -Can used special variables like: %{connectivityStatus}, %{name} +You can use the following variables: %{connectivityStatus}, %{name} =item B<--warning-connectivity-status> Set warning threshold for status (Default: '%{connectivityStatus} =~ /warning/i'). -Can used special variables like: %{connectivityStatus}, %{name} +You can use the following variables: %{connectivityStatus}, %{name} =item B<--critical-connectivity-status> Set critical threshold for status (Default: '%{connectivityStatus} =~ /critical/i'). -Can used special variables like: %{connectivityStatus}, %{name} +You can use the following variables: %{connectivityStatus}, %{name} =item B<--unknown-interface-status> Set warning threshold for status. -Can used special variables like: %{status}, %{interfaceName}, %{sensorName} +You can use the following variables: %{status}, %{interfaceName}, %{sensorName} =item B<--warning-interface-status> Set warning threshold for status. -Can used special variables like: %{status}, %{interfaceName}, %{sensorName} +You can use the following variables: %{status}, %{interfaceName}, %{sensorName} =item B<--critical-interface-status> Set critical threshold for status (Default: '%{status} =~ /down/i'). -Can used special variables like: %{status}, %{interfaceName}, %{sensorName} +You can use the following variables: %{status}, %{interfaceName}, %{sensorName} =item B<--warning-*> B<--critical-*> diff --git a/src/network/versa/director/restapi/mode/devices.pm b/src/network/versa/director/restapi/mode/devices.pm index 41b5e3752..c9e806957 100644 --- a/src/network/versa/director/restapi/mode/devices.pm +++ b/src/network/versa/director/restapi/mode/devices.pm @@ -498,17 +498,17 @@ Add path statuses count. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{ping_status}, %{services_status}, %{sync_status}, %{controller_status}, %{path_status}, %{display} +You can use the following variables: %{ping_status}, %{services_status}, %{sync_status}, %{controller_status}, %{path_status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{ping_status}, %{service_sstatus}, %{sync_status}, %{controller_status}, %{path_status}, %{display} +You can use the following variables: %{ping_status}, %{service_sstatus}, %{sync_status}, %{controller_status}, %{path_status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{ping_status} ne "reachable" or %{services_status} ne "good"'). -Can used special variables like: %{ping_status}, %{services_status}, %{sync_status}, %{controller_status}, %{path_status}, %{display} +You can use the following variables: %{ping_status}, %{services_status}, %{sync_status}, %{controller_status}, %{path_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/versa/snmp/mode/bgppeers.pm b/src/network/versa/snmp/mode/bgppeers.pm index b3c0d022c..941a1bbf6 100644 --- a/src/network/versa/snmp/mode/bgppeers.pm +++ b/src/network/versa/snmp/mode/bgppeers.pm @@ -205,17 +205,17 @@ Critical threshold on last update (seconds) =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{local_addr}, %{remote_addr}, %{as}, %{state}, %{display} +You can use the following variables: %{local_addr}, %{remote_addr}, %{as}, %{state}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{local_addr}, %{remote_addr}, %{as}, %{state}, %{display} +You can use the following variables: %{local_addr}, %{remote_addr}, %{as}, %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /established/'). -Can used special variables like: %{local_addr}, %{remote_addr}, %{as}, %{state}, %{display} +You can use the following variables: %{local_addr}, %{remote_addr}, %{as}, %{state}, %{display} =back diff --git a/src/network/viptela/snmp/mode/controlconnections.pm b/src/network/viptela/snmp/mode/controlconnections.pm index 2dba53f62..73e169650 100644 --- a/src/network/viptela/snmp/mode/controlconnections.pm +++ b/src/network/viptela/snmp/mode/controlconnections.pm @@ -212,17 +212,17 @@ Filter connections by type. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{type}, %{privateIp}, %{publicIp} +You can use the following variables: %{status}, %{type}, %{privateIp}, %{publicIp} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{type}, %{privateIp}, %{publicIp} +You can use the following variables: %{status}, %{type}, %{privateIp}, %{publicIp} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /up|connect/'). -Can used special variables like: %{status}, %{type}, %{privateIp}, %{publicIp} +You can use the following variables: %{status}, %{type}, %{privateIp}, %{publicIp} =item B<--warning-*> B<--critical-*> diff --git a/src/network/viptela/snmp/mode/gretunnels.pm b/src/network/viptela/snmp/mode/gretunnels.pm index 39c133b32..7a96f8c39 100644 --- a/src/network/viptela/snmp/mode/gretunnels.pm +++ b/src/network/viptela/snmp/mode/gretunnels.pm @@ -276,17 +276,17 @@ Filter tunnels by destination ip address. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{adminState}, %{operState}, %{sourceIp}, %{destIp} +You can use the following variables: %{adminState}, %{operState}, %{sourceIp}, %{destIp} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{adminState}, %{operState}, %{sourceIp}, %{destIp} +You can use the following variables: %{adminState}, %{operState}, %{sourceIp}, %{destIp} =item B<--critical-status> Set critical threshold for status (Default: '%{adminState} eq "up" and %{operState} ne "up"'). -Can used special variables like: %{adminState}, %{operState}, %{sourceIp}, %{destIp} +You can use the following variables: %{adminState}, %{operState}, %{sourceIp}, %{destIp} =item B<--warning-*> B<--critical-*> diff --git a/src/network/viptela/snmp/mode/interfaces.pm b/src/network/viptela/snmp/mode/interfaces.pm index 7827a6f93..088b15447 100644 --- a/src/network/viptela/snmp/mode/interfaces.pm +++ b/src/network/viptela/snmp/mode/interfaces.pm @@ -82,12 +82,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/network/watchguard/snmp/mode/cluster.pm b/src/network/watchguard/snmp/mode/cluster.pm index d39c1cce9..3833d5203 100644 --- a/src/network/watchguard/snmp/mode/cluster.pm +++ b/src/network/watchguard/snmp/mode/cluster.pm @@ -162,32 +162,32 @@ Check cluster. =item B<--unknown-cluster-status> Set unknown threshold for status. -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--warning-cluster-status> Set warning threshold for status. -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--critical-cluster-status> Set critical threshold for status. -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--unknown-member-status> Set unknown threshold for status. -Can used special variables like: %{role}, %{serial} +You can use the following variables: %{role}, %{serial} =item B<--warning-member-status> Set warning threshold for status. -Can used special variables like: %{role}, %{serial} +You can use the following variables: %{role}, %{serial} =item B<--critical-member-status> Set critical threshold for status. -Can used special variables like: %{role}, %{serial} +You can use the following variables: %{role}, %{serial} =item B<--warning-*> B<--critical-*> diff --git a/src/network/zyxel/snmp/mode/vpnstatus.pm b/src/network/zyxel/snmp/mode/vpnstatus.pm index 93109bb9d..72e668f40 100644 --- a/src/network/zyxel/snmp/mode/vpnstatus.pm +++ b/src/network/zyxel/snmp/mode/vpnstatus.pm @@ -197,12 +197,12 @@ Can be: 'traffic-in', 'traffic-out'. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{activestatus}, %{connectstatus}, %{display} +You can use the following variables: %{activestatus}, %{connectstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{connectstatus} eq "disconnected"'). -Can used special variables like: %{activestatus}, %{connectstatus}, %{display} +You can use the following variables: %{activestatus}, %{connectstatus}, %{display} =back diff --git a/src/os/aix/local/mode/lvsync.pm b/src/os/aix/local/mode/lvsync.pm index 12aee1806..5b9ff0c66 100644 --- a/src/os/aix/local/mode/lvsync.pm +++ b/src/os/aix/local/mode/lvsync.pm @@ -146,17 +146,17 @@ Filter storage mount point (regexp can be used). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{lv}, %{mount}, %{type}. +You can use the following variables: %{state}, %{lv}, %{mount}, %{type}. =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{lv}, %{mount}, %{type}. +You can use the following variables: %{state}, %{lv}, %{mount}, %{type}. =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /stale/i'). -Can used special variables like: %{state}, %{lv}, %{mount}, %{type}. +You can use the following variables: %{state}, %{lv}, %{mount}, %{type}. =back diff --git a/src/os/aix/local/mode/process.pm b/src/os/aix/local/mode/process.pm index 3b9c8253b..a7148c1eb 100644 --- a/src/os/aix/local/mode/process.pm +++ b/src/os/aix/local/mode/process.pm @@ -205,12 +205,12 @@ You can use: 'Canceled', 'Nonexistent', 'Active', =item B<--warning-status> Set warning threshold for status (Default: '') -Can used special variables like: %{ppid}, %{state}, %{elapsed}, %{cmd}, %{args} +You can use the following variables: %{ppid}, %{state}, %{elapsed}, %{cmd}, %{args} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{ppid}, %{state}, %{elapsed}, %{cmd}, %{args} +You can use the following variables: %{ppid}, %{state}, %{elapsed}, %{cmd}, %{args} =item B<--warning-*> B<--critical-*> diff --git a/src/os/as400/connector/mode/command.pm b/src/os/as400/connector/mode/command.pm index 4dccecc24..1c19aca4f 100644 --- a/src/os/as400/connector/mode/command.pm +++ b/src/os/as400/connector/mode/command.pm @@ -116,17 +116,17 @@ Specify the command to execute (Required). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning--status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =back diff --git a/src/os/as400/connector/mode/disks.pm b/src/os/as400/connector/mode/disks.pm index 1c3e01709..a1b291346 100644 --- a/src/os/as400/connector/mode/disks.pm +++ b/src/os/as400/connector/mode/disks.pm @@ -241,17 +241,17 @@ Filter disks by name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning--status> Set warning threshold for status (Default: '%{status} =~ /noReady|busy|hwFailureOk|hwFailurePerf|Protected|rebuilding/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /^(noAccess|otherDiskSubFailed|failed|notOperational|noUnitControl)$/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/os/as400/connector/mode/jobqueues.pm b/src/os/as400/connector/mode/jobqueues.pm index 26ac1a6b1..4c2b8f6af 100644 --- a/src/os/as400/connector/mode/jobqueues.pm +++ b/src/os/as400/connector/mode/jobqueues.pm @@ -206,17 +206,17 @@ JOBQ selection. Eg: --jobq="QGPL:QBASE" --jobq="QGPL:QPGMR" =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name}, %{library} +You can use the following variables: %{status}, %{name}, %{library} =item B<--warning--status> Set warning threshold for status. -Can used special variables like: %{status}, %{name}, %{library} +You can use the following variables: %{status}, %{name}, %{library} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /HELD/i'). -Can used special variables like: %{status}, %{name}, %{library} +You can use the following variables: %{status}, %{name}, %{library} =item B<--warning-*> B<--critical-*> diff --git a/src/os/as400/connector/mode/subsystems.pm b/src/os/as400/connector/mode/subsystems.pm index e5b2f0f00..9f6d1bf63 100644 --- a/src/os/as400/connector/mode/subsystems.pm +++ b/src/os/as400/connector/mode/subsystems.pm @@ -188,17 +188,17 @@ Filter subsystems by library (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name}, %{library} +You can use the following variables: %{status}, %{name}, %{library} =item B<--warning--status> Set warning threshold for status (Default: '%{status} =~ /ending|restricted|starting/i'). -Can used special variables like: %{status}, %{name}, %{library} +You can use the following variables: %{status}, %{name}, %{library} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status}, %{name}, %{library} +You can use the following variables: %{status}, %{name}, %{library} =item B<--warning-*> B<--critical-*> diff --git a/src/os/linux/local/mode/checkplugin.pm b/src/os/linux/local/mode/checkplugin.pm index f2297fb87..cd94380c4 100644 --- a/src/os/linux/local/mode/checkplugin.pm +++ b/src/os/linux/local/mode/checkplugin.pm @@ -192,17 +192,17 @@ command to execute on the remote machine =item B<--unknown-status> Set unknown threshold for status (Default: '%{exit_code} == 3'). -Can used special variables like: %{short_message}, %{exit_code} +You can use the following variables: %{short_message}, %{exit_code} =item B<--warning-status> Set warning threshold for status (Default: '%{exit_code} == 1'). -Can used special variables like: %{short_message}, %{exit_code} +You can use the following variables: %{short_message}, %{exit_code} =item B<--critical-status> Set critical threshold for status (Default: '%{exit_code} == 2'). -Can used special variables like: %{short_message}, %{exit_code} +You can use the following variables: %{short_message}, %{exit_code} =item B<--warning-time> diff --git a/src/os/linux/local/mode/discoverysnmp.pm b/src/os/linux/local/mode/discoverysnmp.pm index dd5211659..1ea297988 100644 --- a/src/os/linux/local/mode/discoverysnmp.pm +++ b/src/os/linux/local/mode/discoverysnmp.pm @@ -219,11 +219,11 @@ Specify SNMP port (Default: 161). =item B<--snmp-version> -Specify SNMP version (Can be multiple) (Mandatory). +Specify SNMP version (can be defined multiple times) (Mandatory). =item B<--snmp-community> -Specify SNMP community (Can be multiple) (Mandatory). +Specify SNMP community (can be defined multiple times) (Mandatory). =item B<--snmp-timeout> diff --git a/src/os/linux/local/mode/discoverysnmpv3.pm b/src/os/linux/local/mode/discoverysnmpv3.pm index 6e3c00a80..22fd7608d 100644 --- a/src/os/linux/local/mode/discoverysnmpv3.pm +++ b/src/os/linux/local/mode/discoverysnmpv3.pm @@ -247,7 +247,7 @@ Resources discovery. Specify subnet from which discover resources (Must be <ip>/<cidr> format) (Mandatory). -Specify SNMP community (Can be multiple) (Mandatory). +Specify SNMP community (can be defined multiple times) (Mandatory). =item B<--snmp-timeout> diff --git a/src/os/linux/local/mode/ntp.pm b/src/os/linux/local/mode/ntp.pm index 11a22df4c..f45bc4091 100644 --- a/src/os/linux/local/mode/ntp.pm +++ b/src/os/linux/local/mode/ntp.pm @@ -353,17 +353,17 @@ Threshold critical. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{rawstate}, %{type}, %{rawtype}, %{reach}, %{display} +You can use the following variables: %{state}, %{rawstate}, %{type}, %{rawtype}, %{reach}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{rawstate}, %{type}, %{rawtype}, %{reach}, %{display} +You can use the following variables: %{state}, %{rawstate}, %{type}, %{rawtype}, %{reach}, %{display} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{state}, %{rawstate}, %{type}, %{rawtype}, %{reach}, %{display} +You can use the following variables: %{state}, %{rawstate}, %{type}, %{rawtype}, %{reach}, %{display} =back diff --git a/src/os/linux/local/mode/systemdscstatus.pm b/src/os/linux/local/mode/systemdscstatus.pm index 61ce68cef..87cf150df 100644 --- a/src/os/linux/local/mode/systemdscstatus.pm +++ b/src/os/linux/local/mode/systemdscstatus.pm @@ -189,12 +189,12 @@ Can be: 'total-running', 'total-dead', 'total-exited', =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{display}, %{active}, %{sub}, %{load}, %{boot} +You can use the following variables: %{display}, %{active}, %{sub}, %{load}, %{boot} =item B<--critical-status> Set critical threshold for status (Default: '%{active} =~ /failed/i'). -Can used special variables like: %{display}, %{active}, %{sub}, %{load}, %{boot} +You can use the following variables: %{display}, %{active}, %{sub}, %{load}, %{boot} =back diff --git a/src/os/linux/local/mode/traffic.pm b/src/os/linux/local/mode/traffic.pm index dac33da63..37d80be82 100644 --- a/src/os/linux/local/mode/traffic.pm +++ b/src/os/linux/local/mode/traffic.pm @@ -306,17 +306,17 @@ Threshold critical in percent for 'out' traffic. =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} ne "RU"'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--units> diff --git a/src/os/picos/snmp/mode/interfaces.pm b/src/os/picos/snmp/mode/interfaces.pm index 85e385f3a..db94a20b1 100644 --- a/src/os/picos/snmp/mode/interfaces.pm +++ b/src/os/picos/snmp/mode/interfaces.pm @@ -226,12 +226,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/os/windows/local/mode/pendingreboot.pm b/src/os/windows/local/mode/pendingreboot.pm index 792881908..be99c8485 100644 --- a/src/os/windows/local/mode/pendingreboot.pm +++ b/src/os/windows/local/mode/pendingreboot.pm @@ -199,13 +199,13 @@ Print powershell output. =item B<--warning-status> Set warning threshold for status (Default: '%{RebootPending} =~ /true/i'). -Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, +You can use the following variables: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, %{PendFileRename}, %{PendComputerRename}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, +You can use the following variables: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, %{PendFileRename}, %{PendComputerRename}. =back diff --git a/src/os/windows/wsman/mode/pendingreboot.pm b/src/os/windows/wsman/mode/pendingreboot.pm index b83a16ce5..62e93c81d 100644 --- a/src/os/windows/wsman/mode/pendingreboot.pm +++ b/src/os/windows/wsman/mode/pendingreboot.pm @@ -145,13 +145,13 @@ Print powershell output. =item B<--warning-status> Set warning threshold for status (Default: '%{RebootPending} =~ /true/i'). -Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, +You can use the following variables: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, %{PendFileRename}, %{PendComputerRename}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, +You can use the following variables: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, %{PendFileRename}, %{PendComputerRename}. =back diff --git a/src/snmp_standard/mode/interfaces.pm b/src/snmp_standard/mode/interfaces.pm index d6193f0f6..2066fdee1 100644 --- a/src/snmp_standard/mode/interfaces.pm +++ b/src/snmp_standard/mode/interfaces.pm @@ -1585,12 +1585,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/snmp_standard/mode/printererror.pm b/src/snmp_standard/mode/printererror.pm index 6a23f547a..d8731e6c7 100644 --- a/src/snmp_standard/mode/printererror.pm +++ b/src/snmp_standard/mode/printererror.pm @@ -172,22 +172,22 @@ Use that option if your printer provides big-endian bits ordering. =item B<--ok-status> Set warning threshold for status (Default: '%{status} =~ /ok/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /.*/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/snmp_standard/mode/spanningtree.pm b/src/snmp_standard/mode/spanningtree.pm index dc5a623ec..179ccfb5d 100644 --- a/src/snmp_standard/mode/spanningtree.pm +++ b/src/snmp_standard/mode/spanningtree.pm @@ -209,13 +209,13 @@ Filter on port description (can be a regexp). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{op_status}, +You can use the following variables: %{state}, %{op_status}, %{admin_status}, %{port}, %{index}. =item B<--critical-status> Set critical threshold for status (Default: '%{op_status} =~ /up/ && %{state} =~ /blocking|broken/'). -Can used special variables like: %{state}, %{op_status}, +You can use the following variables: %{state}, %{op_status}, %{admin_status}, %{port}, %{index}. =back diff --git a/src/snmp_standard/mode/stringvalue.pm b/src/snmp_standard/mode/stringvalue.pm index 2d635ea33..1cfd0ed3f 100644 --- a/src/snmp_standard/mode/stringvalue.pm +++ b/src/snmp_standard/mode/stringvalue.pm @@ -366,13 +366,14 @@ Allows to use regexp non case-sensitive. =item B<--format-*> -Output format according the threshold. +Output format according to the threshold. Can be: 'ok' (default: '%{filter_rows} value(s)'), 'warning' (default: 'value(s): %{details_warning}'), 'critical' (default: 'value(s): %{details_critical}'), 'unknown' (default: 'value(s): %{details_unknown}'). -Can used: %{rows}, %{filter_rows}, %{details_warning}, %{details_ok}, %{details_critical}, %{details_unknown} +You can use the following variables: +%{rows}, %{filter_rows}, %{details_warning}, %{details_ok}, %{details_critical}, %{details_unknown} =item B<--map-values> @@ -394,7 +395,7 @@ Example to convert octetstring to macaddress: --convert-custom-values='join(":", =item B<--use-perl-mod> -Load additional Perl module (Can be multiple) +Load additional Perl module (can be defined multiple times) Example : --use-perl-mod='Date::Parse' =back diff --git a/src/snmp_standard/mode/vrrp.pm b/src/snmp_standard/mode/vrrp.pm index 067a91e76..45b97e546 100644 --- a/src/snmp_standard/mode/vrrp.pm +++ b/src/snmp_standard/mode/vrrp.pm @@ -144,12 +144,12 @@ Check VRRP status (VRRP-MIB). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{adminState}, %{operStateLast}, %{operState}, %{masterIpAddr} +You can use the following variables: %{adminState}, %{operStateLast}, %{operState}, %{masterIpAddr} =item B<--critical-status> Set critical threshold for status (Default: '%{adminState} eq "up" and %{operState} ne %{operStateLast}'). -Can used special variables like: %{adminState}, %{operStateLast}, %{operState}, %{masterIpAddr} +You can use the following variables: %{adminState}, %{operStateLast}, %{operState}, %{masterIpAddr} =back diff --git a/src/storage/dell/compellent/snmp/mode/globalstatus.pm b/src/storage/dell/compellent/snmp/mode/globalstatus.pm index 4ace0e28d..24907cb37 100644 --- a/src/storage/dell/compellent/snmp/mode/globalstatus.pm +++ b/src/storage/dell/compellent/snmp/mode/globalstatus.pm @@ -131,17 +131,17 @@ Check the overall status of Dell Compellent. =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /nonCritical|other/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /critical|nonRecoverable/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/storage/dell/equallogic/snmp/mode/diskusage.pm b/src/storage/dell/equallogic/snmp/mode/diskusage.pm index c1a8a66dd..656f57c6b 100644 --- a/src/storage/dell/equallogic/snmp/mode/diskusage.pm +++ b/src/storage/dell/equallogic/snmp/mode/diskusage.pm @@ -192,17 +192,17 @@ Filter disk name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{health}, %{status}, %{display} +You can use the following variables: %{health}, %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{health}, %{status}, %{display} +You can use the following variables: %{health}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /on-line|spare|off-line/i'). -Can used special variables like: %{health}, %{status}, %{display} +You can use the following variables: %{health}, %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/dell/me4/restapi/mode/interfaces.pm b/src/storage/dell/me4/restapi/mode/interfaces.pm index da5c4fafe..dc220ff8b 100644 --- a/src/storage/dell/me4/restapi/mode/interfaces.pm +++ b/src/storage/dell/me4/restapi/mode/interfaces.pm @@ -238,17 +238,17 @@ Filter port name (Can be a regexp). =item B<--unknown-port-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{health}, %{display} +You can use the following variables: %{status}, %{health}, %{display} =item B<--warning-port-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{health}, %{display} +You can use the following variables: %{status}, %{health}, %{display} =item B<--critical-port-status> Set critical threshold for status (Default: '%{status} =~ /fault/i'). -Can used special variables like: %{status}, %{health}, %{display} +You can use the following variables: %{status}, %{health}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/dell/powerstore/restapi/mode/alerts.pm b/src/storage/dell/powerstore/restapi/mode/alerts.pm index 03d3d5a79..bde98e134 100644 --- a/src/storage/dell/powerstore/restapi/mode/alerts.pm +++ b/src/storage/dell/powerstore/restapi/mode/alerts.pm @@ -184,12 +184,12 @@ Filter alerts by name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /minor/i') -Can used special variables like: %{severity}, %{resource}, %{name}, %{timeraised}, %{acknowledged} +You can use the following variables: %{severity}, %{resource}, %{name}, %{timeraised}, %{acknowledged} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /major|critical/i'). -Can used special variables like: %{severity}, %{resource}, %{name}, %{timeraised}, %{acknowledged} +You can use the following variables: %{severity}, %{resource}, %{name}, %{timeraised}, %{acknowledged} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/emc/DataDomain/mode/replication.pm b/src/storage/emc/DataDomain/mode/replication.pm index ba5690004..1721b7397 100644 --- a/src/storage/emc/DataDomain/mode/replication.pm +++ b/src/storage/emc/DataDomain/mode/replication.pm @@ -161,17 +161,17 @@ Example: --filter-counters='^status$' =item B<--unknown-status> Set unknown threshold for status (Default: none). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--warning-status> Set warning threshold for status (Default: '%{state} =~ /initializing|recovering/i'). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /disabledNeedsResync|uninitialized/i'). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/emc/isilon/snmp/mode/clusterusage.pm b/src/storage/emc/isilon/snmp/mode/clusterusage.pm index bd84267ac..877d4ab2b 100644 --- a/src/storage/emc/isilon/snmp/mode/clusterusage.pm +++ b/src/storage/emc/isilon/snmp/mode/clusterusage.pm @@ -224,12 +224,12 @@ Example: --filter-counters='^status$' =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /attn/). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /down|invalid/'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> diff --git a/src/storage/emc/isilon/snmp/mode/components/disk.pm b/src/storage/emc/isilon/snmp/mode/components/disk.pm index cbf6e8baf..3d1681427 100644 --- a/src/storage/emc/isilon/snmp/mode/components/disk.pm +++ b/src/storage/emc/isilon/snmp/mode/components/disk.pm @@ -27,7 +27,7 @@ my $mapping = { diskLogicalNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.2' }, diskChassisNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.3' }, diskDeviceName => { oid => '.1.3.6.1.4.1.12124.2.52.1.4' }, - diskStatus => { oid => '.1.3.6.1.4.1.12124.2.52.1.5' }, + diskStatus => { oid => '.1.3.6.1.4.1.12124.2.52.1.5' } }; my $oid_diskEntry = '.1.3.6.1.4.1.12124.2.52.1'; @@ -52,17 +52,22 @@ sub check { next if ($self->check_filter(section => 'disk', instance => $instance)); $self->{components}->{disk}->{total}++; - $self->{output}->output_add(long_msg => sprintf("disk '%s' status is '%s' [instance = %s] [logical = %s] [chassis = %s]", - $result->{diskDeviceName}, $result->{diskStatus}, $instance, - $result->{diskLogicalNumber}, $result->{diskChassisNumber} - )); - + $self->{output}->output_add( + long_msg => sprintf( + "disk '%s' status is '%s' [instance: %s] [logical: %s] [chassis: %s]", + $result->{diskDeviceName}, $result->{diskStatus}, $instance, + $result->{diskLogicalNumber}, $result->{diskChassisNumber} + ) + ); + my $exit = $self->get_severity(section => 'disk', value => $result->{diskStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Disk '%s' status is '%s'", $result->{diskDeviceName}, $result->{diskStatus})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Disk '%s' status is '%s'", $result->{diskDeviceName}, $result->{diskStatus}) + ); } } } -1; \ No newline at end of file +1; diff --git a/src/storage/emc/isilon/snmp/mode/components/fan.pm b/src/storage/emc/isilon/snmp/mode/components/fan.pm index e84843156..d72b3841f 100644 --- a/src/storage/emc/isilon/snmp/mode/components/fan.pm +++ b/src/storage/emc/isilon/snmp/mode/components/fan.pm @@ -52,23 +52,30 @@ sub check { next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; - $self->{output}->output_add(long_msg => sprintf("fan '%s' is %s rpm [instance = %s] [description = %s]", - $result->{fanName}, $result->{fanSpeed}, $instance, - $result->{fanDescription})); - + $self->{output}->output_add( + long_msg => sprintf( + "fan '%s' is %s rpm [instance = %s] [description = %s]", + $result->{fanName}, $result->{fanSpeed}, $instance, + $result->{fanDescription} + ) + ); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{fanSpeed}); - + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Fan '%s' is %s rpm", $result->{fanName}, $result->{fanSpeed})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Fan '%s' is %s rpm", $result->{fanName}, $result->{fanSpeed}) + ); } + $self->{output}->perfdata_add( label => 'speed', unit => 'rpm', nlabel => 'hardware.fan.speed.rpm', instances => $result->{fanName}, value => $result->{fanSpeed}, warning => $warn, - critical => $crit, + critical => $crit ); } } diff --git a/src/storage/emc/isilon/snmp/mode/components/power.pm b/src/storage/emc/isilon/snmp/mode/components/power.pm index 4161ebf29..e52d121c0 100644 --- a/src/storage/emc/isilon/snmp/mode/components/power.pm +++ b/src/storage/emc/isilon/snmp/mode/components/power.pm @@ -26,7 +26,7 @@ use warnings; my $mapping = { powerSensorName => { oid => '.1.3.6.1.4.1.12124.2.55.1.2' }, powerSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.55.1.3' }, - powerSensorValue => { oid => '.1.3.6.1.4.1.12124.2.55.1.4' }, + powerSensorValue => { oid => '.1.3.6.1.4.1.12124.2.55.1.4' } }; my $oid_powerSensorEntry = '.1.3.6.1.4.1.12124.2.55.1'; @@ -52,16 +52,23 @@ sub check { next if ($self->check_filter(section => 'power', instance => $instance)); $self->{components}->{power}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Power '%s' sensor is %s [instance = %s] [description = %s]", - $result->{powerSensorName}, $result->{powerSensorValue}, $instance, - $result->{powerSensorDescription})); - - my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{powerSensorValue}); + $self->{output}->output_add( + long_msg => sprintf( + "power '%s' sensor is %s [instance: %s] [description: %s]", + $result->{powerSensorName}, $result->{powerSensorValue}, $instance, + $result->{powerSensorDescription} + ) + ); + + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'power', instance => $instance, value => $result->{powerSensorValue}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Power '%s' sensor is %s (Volt or Amp)", $result->{powerSensorName}, $result->{powerSensorValue})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Power '%s' sensor is %s (Volt or Amp)", $result->{powerSensorName}, $result->{powerSensorValue}) + ); } + $self->{output}->perfdata_add( label => 'power', nlabel => 'hardware.power.sensor.count', diff --git a/src/storage/emc/isilon/snmp/mode/components/temperature.pm b/src/storage/emc/isilon/snmp/mode/components/temperature.pm index 29a7715f2..4e089cfb7 100644 --- a/src/storage/emc/isilon/snmp/mode/components/temperature.pm +++ b/src/storage/emc/isilon/snmp/mode/components/temperature.pm @@ -26,7 +26,7 @@ use warnings; my $mapping = { tempSensorName => { oid => '.1.3.6.1.4.1.12124.2.54.1.2' }, tempSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.54.1.3' }, - tempSensorValue => { oid => '.1.3.6.1.4.1.12124.2.54.1.4' }, + tempSensorValue => { oid => '.1.3.6.1.4.1.12124.2.54.1.4' } }; my $oid_tempSensorEntry = '.1.3.6.1.4.1.12124.2.54.1'; @@ -52,23 +52,30 @@ sub check { next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; - $self->{output}->output_add(long_msg => sprintf("temperature '%s' is %s C [instance = %s] [description = %s]", - $result->{tempSensorName}, $result->{tempSensorValue}, $instance, - $result->{tempSensorDescription})); - + $self->{output}->output_add( + long_msg => sprintf( + "temperature '%s' is %s C [instance: %s] [description: %s]", + $result->{tempSensorName}, $result->{tempSensorValue}, $instance, + $result->{tempSensorDescription} + ) + ); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{tempSensorValue}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Temperature '%s' is %s C", $result->{tempSensorName}, $result->{tempSensorValue})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Temperature '%s' is %s C", $result->{tempSensorName}, $result->{tempSensorValue}) + ); } + $self->{output}->perfdata_add( label => 'temperature', unit => 'C', nlabel => 'hardware.temperature.celsius', instances => $result->{tempSensorName}, value => $result->{tempSensorValue}, warning => $warn, - critical => $crit, + critical => $crit ); } } diff --git a/src/storage/emc/unisphere/restapi/mode/pools.pm b/src/storage/emc/unisphere/restapi/mode/pools.pm index fb302d404..74202357b 100644 --- a/src/storage/emc/unisphere/restapi/mode/pools.pm +++ b/src/storage/emc/unisphere/restapi/mode/pools.pm @@ -208,17 +208,17 @@ Filter pool name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /ok_but|degraded|minor/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /major|critical|non_recoverable/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/emc/unisphere/restapi/mode/replications.pm b/src/storage/emc/unisphere/restapi/mode/replications.pm index 08ca8eb79..93ed37dbe 100644 --- a/src/storage/emc/unisphere/restapi/mode/replications.pm +++ b/src/storage/emc/unisphere/restapi/mode/replications.pm @@ -142,32 +142,32 @@ Filter replication name (can be a regexp). =item B<--unknown-health-status> Set unknown threshold for status (Default: '%{health_status} =~ /unknown/i'). -Can used special variables like: %{health_status}, %{display} +You can use the following variables: %{health_status}, %{display} =item B<--warning-health-status> Set warning threshold for status (Default: '%{health_status} =~ /ok_but|degraded|minor/i'). -Can used special variables like: %{health_status}, %{display} +You can use the following variables: %{health_status}, %{display} =item B<--critical-health-status> Set critical threshold for status (Default: '%{health_status} =~ /major|critical|non_recoverable/i'). -Can used special variables like: %{health_status}, %{display} +You can use the following variables: %{health_status}, %{display} =item B<--unknown-repl-status> Set unknown threshold for status (Default: '%{repl_status} =~ /unknown/i'). -Can used special variables like: %{repl_status}, %{display} +You can use the following variables: %{repl_status}, %{display} =item B<--warning-repl-status> Set warning threshold for status (Default: '%{repl_status} =~ /syncing/i'). -Can used special variables like: %{repl_status}, %{display} +You can use the following variables: %{repl_status}, %{display} =item B<--critical-repl-status> Set critical threshold for status (Default: '%{repl_status} =~ /inconsistent/i'). -Can used special variables like: %{repl_status}, %{display} +You can use the following variables: %{repl_status}, %{display} =back diff --git a/src/storage/emc/unisphere/restapi/mode/storageresources.pm b/src/storage/emc/unisphere/restapi/mode/storageresources.pm index f7570be36..41325df5e 100644 --- a/src/storage/emc/unisphere/restapi/mode/storageresources.pm +++ b/src/storage/emc/unisphere/restapi/mode/storageresources.pm @@ -211,17 +211,17 @@ Filter name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /ok_but|degraded|minor/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /major|critical|non_recoverable/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/emc/vplex/restapi/mode/clustercommunication.pm b/src/storage/emc/vplex/restapi/mode/clustercommunication.pm index 9b7b7af84..e24d1616d 100644 --- a/src/storage/emc/vplex/restapi/mode/clustercommunication.pm +++ b/src/storage/emc/vplex/restapi/mode/clustercommunication.pm @@ -103,12 +103,12 @@ Filter components by name (can be a regexp). =item B<--warning-operational-status> Set warning threshold for status. -Can used special variables like: %{operational_state}, %{admin_state}, %{name} +You can use the following variables: %{operational_state}, %{admin_state}, %{name} =item B<--critical-operational-status> Set critical threshold for status (Default: '%{admin_state} eq "enabled" and %{operational_state} !~ /cluster-in-contact|in-contact/i'). -Can used special variables like: %{operational_state}, %{admin_state}, %{name} +You can use the following variables: %{operational_state}, %{admin_state}, %{name} =back diff --git a/src/storage/emc/vplex/restapi/mode/clusterdevices.pm b/src/storage/emc/vplex/restapi/mode/clusterdevices.pm index a1ccc69c2..9f26d441d 100644 --- a/src/storage/emc/vplex/restapi/mode/clusterdevices.pm +++ b/src/storage/emc/vplex/restapi/mode/clusterdevices.pm @@ -114,12 +114,12 @@ Filter devices by device name (can be a regexp). =item B<--warning-health-status> Set warning threshold for status. -Can used special variables like: %{health_state}, %{cluster_name}, %{device_name} +You can use the following variables: %{health_state}, %{cluster_name}, %{device_name} =item B<--critical-health-status> Set critical threshold for status (Default: '%{health_state} ne "ok"'). -Can used special variables like: %{health_state}, %{cluster_name}, %{device_name} +You can use the following variables: %{health_state}, %{cluster_name}, %{device_name} =back diff --git a/src/storage/emc/vplex/restapi/mode/directors.pm b/src/storage/emc/vplex/restapi/mode/directors.pm index 46755432e..d5ec9e9b8 100644 --- a/src/storage/emc/vplex/restapi/mode/directors.pm +++ b/src/storage/emc/vplex/restapi/mode/directors.pm @@ -137,52 +137,52 @@ Filter directors by director name (can be a regexp). =item B<--warning-health-status> Set warning threshold for status. -Can used special variables like: %{operational_status}, %{engine_id}, %{director_name} +You can use the following variables: %{operational_status}, %{engine_id}, %{director_name} =item B<--critical-health-status> Set critical threshold for status (Default: '%{health_state} ne "ok"'). -Can used special variables like: %{operational_status}, %{engine_id}, %{director_name} +You can use the following variables: %{operational_status}, %{engine_id}, %{director_name} =item B<--warning-communication-status> Set warning threshold for status. -Can used special variables like: %{communication_status}, %{engine_id}, %{director_name} +You can use the following variables: %{communication_status}, %{engine_id}, %{director_name} =item B<--critical-communication-status> Set critical threshold for status (Default: '%{communication_status} ne "ok"'). -Can used special variables like: %{communication_status}, %{engine_id}, %{director_name} +You can use the following variables: %{communication_status}, %{engine_id}, %{director_name} =item B<--warning-temperature-status> Set warning threshold for status. -Can used special variables like: %{temperature_threshold_exceeded}, %{engine_id}, %{director_name} +You can use the following variables: %{temperature_threshold_exceeded}, %{engine_id}, %{director_name} =item B<--critical-temperature-status> Set critical threshold for status (Default: '%{temperature_threshold_exceeded} ne "false"'). -Can used special variables like: %{temperature_threshold_exceeded}, %{engine_id}, %{director_name} +You can use the following variables: %{temperature_threshold_exceeded}, %{engine_id}, %{director_name} =item B<--warning-voltage-status> Set warning threshold for status. -Can used special variables like: %{voltage_threshold_exceeded}, %{engine_id}, %{director_name} +You can use the following variables: %{voltage_threshold_exceeded}, %{engine_id}, %{director_name} =item B<--critical-voltage-status> Set critical threshold for status (Default: '%{voltage_threshold_exceeded} ne "false"'). -Can used special variables like: %{voltage_threshold_exceeded}, %{engine_id}, %{director_name} +You can use the following variables: %{voltage_threshold_exceeded}, %{engine_id}, %{director_name} =item B<--warning-vplex-kdriver-status> Set warning threshold for status. -Can used special variables like: %{vplex_kdriver_status}, %{engine_id}, %{director_name} +You can use the following variables: %{vplex_kdriver_status}, %{engine_id}, %{director_name} =item B<--critical-vplex-kdriver-status> Set critical threshold for status (Default: '%{vplex_kdriver_status} ne "ok"'). -Can used special variables like: %{vplex_kdriver_status}, %{engine_id}, %{director_name} +You can use the following variables: %{vplex_kdriver_status}, %{engine_id}, %{director_name} =back diff --git a/src/storage/emc/vplex/restapi/mode/distributeddevices.pm b/src/storage/emc/vplex/restapi/mode/distributeddevices.pm index 1501095df..8649da724 100644 --- a/src/storage/emc/vplex/restapi/mode/distributeddevices.pm +++ b/src/storage/emc/vplex/restapi/mode/distributeddevices.pm @@ -111,32 +111,32 @@ Filter devices by device name (can be a regexp). =item B<--warning-operational-status> Set warning threshold for status. -Can used special variables like: %{operational_status}, %{device_name} +You can use the following variables: %{operational_status}, %{device_name} =item B<--critical-operational-status> Set critical threshold for status (Default: '%{operational_status} ne "ok"'). -Can used special variables like: %{operational_status}, %{device_name} +You can use the following variables: %{operational_status}, %{device_name} =item B<--warning-health-status> Set warning threshold for status. -Can used special variables like: %{health_state}, %{device_name} +You can use the following variables: %{health_state}, %{device_name} =item B<--critical-health-status> Set critical threshold for status (Default: '%{health_state} ne "ok"'). -Can used special variables like: %{health_state}, %{device_name} +You can use the following variables: %{health_state}, %{device_name} =item B<--warning-service-status> Set warning threshold for status. -Can used special variables like: %{service_status}, %{device_name} +You can use the following variables: %{service_status}, %{device_name} =item B<--critical-service-status> Set critical threshold for status (Default: '%{service_status} ne "running"'). -Can used special variables like: %{service_status}, %{device_name} +You can use the following variables: %{service_status}, %{device_name} =back diff --git a/src/storage/emc/vplex/restapi/mode/fans.pm b/src/storage/emc/vplex/restapi/mode/fans.pm index f433cbaa5..fa464a343 100644 --- a/src/storage/emc/vplex/restapi/mode/fans.pm +++ b/src/storage/emc/vplex/restapi/mode/fans.pm @@ -112,22 +112,22 @@ Filter fans by fan name (can be a regexp). =item B<--warning-operational-status> Set warning threshold for status. -Can used special variables like: %{operational_status}, %{engine_id}, %{fan_name} +You can use the following variables: %{operational_status}, %{engine_id}, %{fan_name} =item B<--critical-operational-status> Set critical threshold for status (Default: '%{operational_status} ne "online"'). -Can used special variables like: %{operational_status}, %{engine_id}, %{fan_name} +You can use the following variables: %{operational_status}, %{engine_id}, %{fan_name} =item B<--warning-speed-status> Set warning threshold for status. -Can used special variables like: %{speed_threshold_exceeded}, %{engine_id}, %{fan_name} +You can use the following variables: %{speed_threshold_exceeded}, %{engine_id}, %{fan_name} =item B<--critical-speed-status> Set critical threshold for status (Default: '%{operational_status} ne "online"'). -Can used special variables like: %{speed_threshold_exceeded}, %{engine_id}, %{fan_name} +You can use the following variables: %{speed_threshold_exceeded}, %{engine_id}, %{fan_name} =back diff --git a/src/storage/emc/vplex/restapi/mode/psus.pm b/src/storage/emc/vplex/restapi/mode/psus.pm index 1b8432ff8..cde4c3a04 100644 --- a/src/storage/emc/vplex/restapi/mode/psus.pm +++ b/src/storage/emc/vplex/restapi/mode/psus.pm @@ -111,22 +111,22 @@ Filter power supplies by power supply name (can be a regexp). =item B<--warning-operational-status> Set warning threshold for status. -Can used special variables like: %{operational_status}, %{engine_id}, %{psu_name} +You can use the following variables: %{operational_status}, %{engine_id}, %{psu_name} =item B<--critical-operational-status> Set critical threshold for status (Default: '%{operational_status} ne "online"'). -Can used special variables like: %{operational_status}, %{engine_id}, %{psu_name} +You can use the following variables: %{operational_status}, %{engine_id}, %{psu_name} =item B<--warning-temperature-status> Set warning threshold for status. -Can used special variables like: %{temperature_threshold_exceeded}, %{engine_id}, %{psu_name} +You can use the following variables: %{temperature_threshold_exceeded}, %{engine_id}, %{psu_name} =item B<--critical-temperature-status> Set critical threshold for status (Default: '%{operational_status} ne "online"'). -Can used special variables like: %{temperature_threshold_exceeded}, %{engine_id}, %{psu_name} +You can use the following variables: %{temperature_threshold_exceeded}, %{engine_id}, %{psu_name} =back diff --git a/src/storage/emc/vplex/restapi/mode/storagevolumes.pm b/src/storage/emc/vplex/restapi/mode/storagevolumes.pm index a8dd6f838..8e205697e 100644 --- a/src/storage/emc/vplex/restapi/mode/storagevolumes.pm +++ b/src/storage/emc/vplex/restapi/mode/storagevolumes.pm @@ -114,12 +114,12 @@ Filter volumes by volume name (can be a regexp). =item B<--warning-health-status> Set warning threshold for status. -Can used special variables like: %{health_state}, %{cluster_name}, %{volume_name} +You can use the following variables: %{health_state}, %{cluster_name}, %{volume_name} =item B<--critical-health-status> Set critical threshold for status (Default: '%{health_state} ne "ok"'). -Can used special variables like: %{health_state}, %{cluster_name}, %{volume_name} +You can use the following variables: %{health_state}, %{cluster_name}, %{volume_name} =back diff --git a/src/storage/emc/xtremio/restapi/custom/xtremioapi.pm b/src/storage/emc/xtremio/restapi/custom/xtremioapi.pm index 7cd75502f..88c6afedc 100644 --- a/src/storage/emc/xtremio/restapi/custom/xtremioapi.pm +++ b/src/storage/emc/xtremio/restapi/custom/xtremioapi.pm @@ -195,7 +195,7 @@ sub get_details_lookup_clusters { } # object is not found. - $self->{output}->add_option_msg(short_msg => "xtremio api issue: cannot found object details"); + $self->{output}->add_option_msg(short_msg => "xtremio api issue: cannot find object details"); $self->{output}->option_exit(); } diff --git a/src/storage/emc/xtremio/restapi/mode/dpg.pm b/src/storage/emc/xtremio/restapi/mode/dpg.pm index ffb38718b..18909eab7 100644 --- a/src/storage/emc/xtremio/restapi/mode/dpg.pm +++ b/src/storage/emc/xtremio/restapi/mode/dpg.pm @@ -146,17 +146,17 @@ Filter data protection groups by name (can be a regexp). =item B<--unknown-health-indicator> Set unknown threshold for status. -Can used special variables like: %{health}, %{indicator} +You can use the following variables: %{health}, %{indicator} =item B<--warning-health-indicator> Set warning threshold for status. -Can used special variables like: %{health}, %{indicator} +You can use the following variables: %{health}, %{indicator} =item B<--critical-health-indicator> Set critical threshold for status (Default: '%{health} !~ /done|normal|null/i'). -Can used special variables like: %{health}, %{indicator} +You can use the following variables: %{health}, %{indicator} =back diff --git a/src/storage/emc/xtremio/restapi/mode/storagecontrollers.pm b/src/storage/emc/xtremio/restapi/mode/storagecontrollers.pm index 907ad7148..250e94f3f 100644 --- a/src/storage/emc/xtremio/restapi/mode/storagecontrollers.pm +++ b/src/storage/emc/xtremio/restapi/mode/storagecontrollers.pm @@ -149,17 +149,17 @@ Filter storage controllers by name (can be a regexp). =item B<--unknown-health-indicator> Set unknown threshold for status. -Can used special variables like: %{health}, %{indicator} +You can use the following variables: %{health}, %{indicator} =item B<--warning-health-indicator> Set warning threshold for status. -Can used special variables like: %{health}, %{indicator} +You can use the following variables: %{health}, %{indicator} =item B<--critical-health-indicator> Set critical threshold for status (Default: '%{health} !~ /done|normal|null/i'). -Can used special variables like: %{health}, %{indicator} +You can use the following variables: %{health}, %{indicator} =back diff --git a/src/storage/exagrid/snmp/mode/serverusage.pm b/src/storage/exagrid/snmp/mode/serverusage.pm index 3107b410f..9b7324d1b 100644 --- a/src/storage/exagrid/snmp/mode/serverusage.pm +++ b/src/storage/exagrid/snmp/mode/serverusage.pm @@ -190,12 +190,12 @@ Example: --filter-counters='^status$' =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /error/i'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hitachi/hcp/snmp/mode/nodes.pm b/src/storage/hitachi/hcp/snmp/mode/nodes.pm index bf2a51f9e..2fe512320 100644 --- a/src/storage/hitachi/hcp/snmp/mode/nodes.pm +++ b/src/storage/hitachi/hcp/snmp/mode/nodes.pm @@ -412,62 +412,62 @@ Filter nodes by id (can be a regexp). =item B<--unknown-node-status> Set unknown threshold for status. -Can used special variables like: %{node_status}, %{node_id} +You can use the following variables: %{node_status}, %{node_id} =item B<--warning-node-status> Set warning threshold for status. -Can used special variables like: %{node_status}, %{node_id} +You can use the following variables: %{node_status}, %{node_id} =item B<--critical-node-status> Set critical threshold for status (Default: '%{node_status} eq "unavailable"'). -Can used special variables like: %{node_status}, %{node_id} +You can use the following variables: %{node_status}, %{node_id} =item B<--unknown-nic-status> Set unknown threshold for status. -Can used special variables like: %{nic_status}, %{node_id} +You can use the following variables: %{nic_status}, %{node_id} =item B<--warning-nic-status> Set warning threshold for status. -Can used special variables like: %{nic_status}, %{node_id} +You can use the following variables: %{nic_status}, %{node_id} =item B<--critical-nic-status> Set critical threshold for status (Default: '%{nic_status} eq "failed"'). -Can used special variables like: %{nic_status}, %{node_id} +You can use the following variables: %{nic_status}, %{node_id} =item B<--unknown-san-path-status> Set unknown threshold for status. -Can used special variables like: %{san_path_status}, %{node_id} +You can use the following variables: %{san_path_status}, %{node_id} =item B<--warning-san-path-status> Set warning threshold for status. -Can used special variables like: %{san_path_status}, %{node_id} +You can use the following variables: %{san_path_status}, %{node_id} =item B<--critical-san-path-status> Set critical threshold for status (Default: '%{san_path_status} eq "error"'). -Can used special variables like: %{san_path_status}, %{node_id} +You can use the following variables: %{san_path_status}, %{node_id} =item B<--unknown-bbu-status> Set unknown threshold for status. -Can used special variables like: %{bbu_status}, %{node_id} +You can use the following variables: %{bbu_status}, %{node_id} =item B<--warning-bbu-status> Set warning threshold for status. -Can used special variables like: %{bbu_status}, %{node_id} +You can use the following variables: %{bbu_status}, %{node_id} =item B<--critical-bbu-status> Set critical threshold for status (Default: '%{bbu_status} !~ /healthy/i'). -Can used special variables like: %{bbu_status}, %{node_id} +You can use the following variables: %{bbu_status}, %{node_id} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hitachi/hcp/snmp/mode/volumes.pm b/src/storage/hitachi/hcp/snmp/mode/volumes.pm index e4e412d37..0a97dfaea 100644 --- a/src/storage/hitachi/hcp/snmp/mode/volumes.pm +++ b/src/storage/hitachi/hcp/snmp/mode/volumes.pm @@ -232,17 +232,17 @@ Filter volumes by node id (can be a regexp). =item B<--unknown-volume-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{node_id}, %{label} +You can use the following variables: %{status}, %{node_id}, %{label} =item B<--warning-volume-status> Set warning threshold for status (Default: '%{status} =~ /degraded/'). -Can used special variables like: %{status}, %{node_id}, %{label} +You can use the following variables: %{status}, %{node_id}, %{label} =item B<--critical-volume-status> Set critical threshold for status (Default: '%{status} =~ /broken/'). -Can used special variables like: %{status}, %{node_id}, %{label} +You can use the following variables: %{status}, %{node_id}, %{label} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/3par/ssh/mode/afc.pm b/src/storage/hp/3par/ssh/mode/afc.pm index 5ae403c85..b2e904eb4 100644 --- a/src/storage/hp/3par/ssh/mode/afc.pm +++ b/src/storage/hp/3par/ssh/mode/afc.pm @@ -281,7 +281,7 @@ Filter volumes by name (can be a regexp). Set thresholds for status (Default critical: '%{status} !~ /normal/i') -Can used special variables like: %{status}, %{node_id} +You can use the following variables: %{status}, %{node_id} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/3par/ssh/mode/cages.pm b/src/storage/hp/3par/ssh/mode/cages.pm index 1b9820b7d..1de203892 100644 --- a/src/storage/hp/3par/ssh/mode/cages.pm +++ b/src/storage/hp/3par/ssh/mode/cages.pm @@ -324,7 +324,7 @@ Filter cages by id (can be a regexp). Set thresholds for status (Default critical: '%{status} !~ /Normal/i') -Can used special variables like: %{status}, %{cage_id} +You can use the following variables: %{status}, %{cage_id} =item B<--unknown-board-firmware-status> @@ -336,7 +336,7 @@ Can used special variables like: %{status}, %{cage_id} Set thresholds for status (Default critical: '%{status} !~ /Current/i') -Can used special variables like: %{status}, %{cage_id}, %{board_id} +You can use the following variables: %{status}, %{cage_id}, %{board_id} =item B<--unknown-board-[self|partner]-status> @@ -348,7 +348,7 @@ Can used special variables like: %{status}, %{cage_id}, %{board_id} Set thresholds for status (Default critical: '%{status} !~ /ok/i') -Can used special variables like: %{status}, %{cage_id}, %{board_id} +You can use the following variables: %{status}, %{cage_id}, %{board_id} =item B<--unknown-psu-status> @@ -360,7 +360,7 @@ Can used special variables like: %{status}, %{cage_id}, %{board_id} Set thresholds for status (Default critical: '%{status} !~ /ok/i') -Can used special variables like: %{status}, %{cage_id}, %{psu_id} +You can use the following variables: %{status}, %{cage_id}, %{psu_id} =item B<--unknown-psu-[ac|dc|fan]-status> @@ -372,7 +372,7 @@ Can used special variables like: %{status}, %{cage_id}, %{psu_id} Set thresholds for status (Default critical: '%{status} !~ /ok/i') -Can used special variables like: %{status}, %{cage_id}, %{psu_id} +You can use the following variables: %{status}, %{cage_id}, %{psu_id} =item B<--unknown-drive-status> @@ -384,7 +384,7 @@ Can used special variables like: %{status}, %{cage_id}, %{psu_id} Set thresholds for status (Default critical: '%{status} !~ /normal/i') -Can used special variables like: %{status}, %{cage_id}, %{drive_id} +You can use the following variables: %{status}, %{cage_id}, %{drive_id} =item B<--unknown-drive-[porta|portb]-status> @@ -396,7 +396,7 @@ Can used special variables like: %{status}, %{cage_id}, %{drive_id} Set thresholds for status (Default critical: '%{status} !~ /ok/i') -Can used special variables like: %{status}, %{cage_id}, %{drive_id} +You can use the following variables: %{status}, %{cage_id}, %{drive_id} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/3par/ssh/mode/diskusage.pm b/src/storage/hp/3par/ssh/mode/diskusage.pm index a29cf8759..ba8f8e1d9 100644 --- a/src/storage/hp/3par/ssh/mode/diskusage.pm +++ b/src/storage/hp/3par/ssh/mode/diskusage.pm @@ -167,12 +167,12 @@ Filter disk name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /normal/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/3par/ssh/mode/nodes.pm b/src/storage/hp/3par/ssh/mode/nodes.pm index a6361c587..1031cc427 100644 --- a/src/storage/hp/3par/ssh/mode/nodes.pm +++ b/src/storage/hp/3par/ssh/mode/nodes.pm @@ -192,17 +192,17 @@ Filter nodes by id (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{node_id} +You can use the following variables: %{status}, %{node_id} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{node_id} +You can use the following variables: %{status}, %{node_id} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{node_id} +You can use the following variables: %{status}, %{node_id} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/3par/ssh/mode/psu.pm b/src/storage/hp/3par/ssh/mode/psu.pm index f2d024174..978efb2d4 100644 --- a/src/storage/hp/3par/ssh/mode/psu.pm +++ b/src/storage/hp/3par/ssh/mode/psu.pm @@ -240,77 +240,77 @@ Filter power supplies by id (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--unknown-ac-status> Set unknown threshold for AC status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--warning-ac-status> Set warning threshold for AC status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--critical-ac-status> Set critical threshold for AC status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--unknown-dc-status> Set unknown threshold for DC status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--warning-dc-status> Set warning threshold for DC status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--critical-dc-status> Set critical threshold for DC status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--unknown-fan-status> Set unknown threshold for fan status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--warning-fan-status> Set warning threshold for fan status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--critical-fan-status> Set critical threshold for fan status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--unknown-battery-status> Set unknown threshold for battery status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--warning-battery-status> Set warning threshold for battery status. -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--critical-battery-status> Set critical threshold for battery status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{node_id}, %{psu_id} +You can use the following variables: %{status}, %{node_id}, %{psu_id} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/lefthand/snmp/mode/volumeusage.pm b/src/storage/hp/lefthand/snmp/mode/volumeusage.pm index ffb50ca7a..302eb1c0f 100644 --- a/src/storage/hp/lefthand/snmp/mode/volumeusage.pm +++ b/src/storage/hp/lefthand/snmp/mode/volumeusage.pm @@ -302,12 +302,12 @@ Filter volume name (can be a regexp). =item B<--warning-replication-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-replication-status> Set critical threshold for status (Default: '%{status} !~ /normal/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> diff --git a/src/storage/hp/p2000/xmlapi/mode/controllers.pm b/src/storage/hp/p2000/xmlapi/mode/controllers.pm index c74fba14d..51ea2754e 100644 --- a/src/storage/hp/p2000/xmlapi/mode/controllers.pm +++ b/src/storage/hp/p2000/xmlapi/mode/controllers.pm @@ -392,77 +392,77 @@ Filter controllers by controller name (can be a regexp). =item B<--unknown-controller-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-controller-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-controller-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-network-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-network-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-network-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-port-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-port-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-port-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-expander-port-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-expander-port-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-expander-port-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-compact-flash-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-compact-flash-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-compact-flash-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/p2000/xmlapi/mode/vdisks.pm b/src/storage/hp/p2000/xmlapi/mode/vdisks.pm index dc82c23d9..8db795db3 100644 --- a/src/storage/hp/p2000/xmlapi/mode/vdisks.pm +++ b/src/storage/hp/p2000/xmlapi/mode/vdisks.pm @@ -194,17 +194,17 @@ Filter virtual disk name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/storeonce/3/restapi/mode/clusterusage.pm b/src/storage/hp/storeonce/3/restapi/mode/clusterusage.pm index 89375f848..d68f4ada6 100644 --- a/src/storage/hp/storeonce/3/restapi/mode/clusterusage.pm +++ b/src/storage/hp/storeonce/3/restapi/mode/clusterusage.pm @@ -227,12 +227,12 @@ Filter cluster name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{health} =~ /warning/'). -Can used special variables like: %{health}, %{display} +You can use the following variables: %{health}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{health} =~ /critical/'). -Can used special variables like: %{health}, %{display} +You can use the following variables: %{health}, %{display} =item B<--warning-*> diff --git a/src/storage/hp/storeonce/3/restapi/mode/fcsusage.pm b/src/storage/hp/storeonce/3/restapi/mode/fcsusage.pm index 9526f1366..819e7b978 100644 --- a/src/storage/hp/storeonce/3/restapi/mode/fcsusage.pm +++ b/src/storage/hp/storeonce/3/restapi/mode/fcsusage.pm @@ -158,12 +158,12 @@ Filter name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{is_online} == 1 and %{health} =~ /warning/i'). -Can used special variables like: %{health}, %{is_online}, %{display} +You can use the following variables: %{health}, %{is_online}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{is_online} == 1 and %{health} =~ /critical/i'). -Can used special variables like: %{health}, %{is_online}, %{display} +You can use the following variables: %{health}, %{is_online}, %{display} =item B<--warning-*> diff --git a/src/storage/hp/storeonce/3/restapi/mode/nasusage.pm b/src/storage/hp/storeonce/3/restapi/mode/nasusage.pm index e76ba26ca..a9ff7fa08 100644 --- a/src/storage/hp/storeonce/3/restapi/mode/nasusage.pm +++ b/src/storage/hp/storeonce/3/restapi/mode/nasusage.pm @@ -171,22 +171,22 @@ Filter nas name (can be a regexp). =item B<--warning-nas-status> Set warning threshold for status (Default: '%{health} =~ /warning/i'). -Can used special variables like: %{health}, %{replication_health}, %{display} +You can use the following variables: %{health}, %{replication_health}, %{display} =item B<--critical-nas-status> Set critical threshold for status (Default: '%{health} =~ /critical/i'). -Can used special variables like: %{health}, %{replication_health}, %{display} +You can use the following variables: %{health}, %{replication_health}, %{display} =item B<--warning-share-status> Set warning threshold for status (Default: '%{health} =~ /warning/i'). -Can used special variables like: %{health}, %{replication_health}, %{display} +You can use the following variables: %{health}, %{replication_health}, %{display} =item B<--critical-share-status> Set critical threshold for status (Default: '%{health} =~ /critical/i'). -Can used special variables like: %{health}, %{replication_health}, %{display} +You can use the following variables: %{health}, %{replication_health}, %{display} =back diff --git a/src/storage/hp/storeonce/3/restapi/mode/servicesetusage.pm b/src/storage/hp/storeonce/3/restapi/mode/servicesetusage.pm index 6736d1ae4..2f72470ab 100644 --- a/src/storage/hp/storeonce/3/restapi/mode/servicesetusage.pm +++ b/src/storage/hp/storeonce/3/restapi/mode/servicesetusage.pm @@ -225,12 +225,12 @@ Filter service set name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{health} =~ /warning/). -Can used special variables like: %{health}, %{replication_health}, %{housekeeping_health}, %{display} +You can use the following variables: %{health}, %{replication_health}, %{housekeeping_health}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{health} =~ /critical/'). -Can used special variables like: %{health}, %{replication_health}, %{housekeeping_health}, %{display} +You can use the following variables: %{health}, %{replication_health}, %{housekeeping_health}, %{display} =item B<--warning-*> diff --git a/src/storage/hp/storeonce/4/restapi/mode/appliances.pm b/src/storage/hp/storeonce/4/restapi/mode/appliances.pm index 5cd815462..70c799ff8 100644 --- a/src/storage/hp/storeonce/4/restapi/mode/appliances.pm +++ b/src/storage/hp/storeonce/4/restapi/mode/appliances.pm @@ -232,17 +232,17 @@ Filter appliances by hostname. =item B<--unknown-service-status> Set unknown threshold for status. -Can used special variables like: %{service}, %{status} +You can use the following variables: %{service}, %{status} =item B<--warning-service-status> Set warning threshold for status (Default: '%{status} =~ /warning/i'). -Can used special variables like: %{service}, %{status} +You can use the following variables: %{service}, %{status} =item B<--critical-service-status> Set critical threshold for status (Default: '%{status} =~ /critical/i'). -Can used special variables like: %{service}, %{status} +You can use the following variables: %{service}, %{status} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/hp/storeonce/4/restapi/mode/stores.pm b/src/storage/hp/storeonce/4/restapi/mode/stores.pm index b7ae5cb60..c1a3cd2e0 100644 --- a/src/storage/hp/storeonce/4/restapi/mode/stores.pm +++ b/src/storage/hp/storeonce/4/restapi/mode/stores.pm @@ -202,17 +202,17 @@ Filter stores by hostname. =item B<--unknown-health> Set unknown threshold for status (Default: '%{health} =~ /unknown/i'). -Can used special variables like: %{health}, %{name} +You can use the following variables: %{health}, %{name} =item B<--warning-health> Set warning threshold for status (Default: '%{health} =~ /warning/i'). -Can used special variables like: %{health}, %{name} +You can use the following variables: %{health}, %{name} =item B<--critical-health> Set critical threshold for status (Default: '%{health} =~ /critical/i'). -Can used special variables like: %{health}, %{name} +You can use the following variables: %{health}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/huawei/oceanstor/snmp/mode/controllers.pm b/src/storage/huawei/oceanstor/snmp/mode/controllers.pm index 2c8fa2771..a3ea04983 100644 --- a/src/storage/huawei/oceanstor/snmp/mode/controllers.pm +++ b/src/storage/huawei/oceanstor/snmp/mode/controllers.pm @@ -191,17 +191,17 @@ Filter controller by ID (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{health_status}, %{running_status}, %{id} +You can use the following variables: %{health_status}, %{running_status}, %{id} =item B<--warning-status> Set warning threshold for status (Default: '%{health_status} =~ /degraded|partially broken/i'). -Can used special variables like: %{health_status}, %{running_status}, %{id} +You can use the following variables: %{health_status}, %{running_status}, %{id} =item B<--critical-status> Set critical threshold for status (Default: '%{health_status} =~ /fault|fail/i'). -Can used special variables like: %{health_status}, %{running_status}, %{id} +You can use the following variables: %{health_status}, %{running_status}, %{id} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/huawei/oceanstor/snmp/mode/storagepools.pm b/src/storage/huawei/oceanstor/snmp/mode/storagepools.pm index f359406d0..7f703d4bd 100644 --- a/src/storage/huawei/oceanstor/snmp/mode/storagepools.pm +++ b/src/storage/huawei/oceanstor/snmp/mode/storagepools.pm @@ -237,17 +237,17 @@ Filter storage pool by domain name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{health_status}, %{running_status}, %{name} +You can use the following variables: %{health_status}, %{running_status}, %{name} =item B<--warning-status> Set warning threshold for status (Default: '%{health_status} =~ /degraded|partially broken/i'). -Can used special variables like: %{health_status}, %{running_status}, %{name} +You can use the following variables: %{health_status}, %{running_status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{health_status} =~ /fault|fail/i'). -Can used special variables like: %{health_status}, %{running_status}, %{name} +You can use the following variables: %{health_status}, %{running_status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/ibm/storwize/ssh/mode/poolusage.pm b/src/storage/ibm/storwize/ssh/mode/poolusage.pm index 1ab0ed43a..36d7b4587 100644 --- a/src/storage/ibm/storwize/ssh/mode/poolusage.pm +++ b/src/storage/ibm/storwize/ssh/mode/poolusage.pm @@ -202,12 +202,12 @@ Filter pool name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /offline/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/lenovo/iomega/snmp/mode/interfaces.pm b/src/storage/lenovo/iomega/snmp/mode/interfaces.pm index 244e515d3..7249cbe21 100644 --- a/src/storage/lenovo/iomega/snmp/mode/interfaces.pm +++ b/src/storage/lenovo/iomega/snmp/mode/interfaces.pm @@ -95,12 +95,12 @@ If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} +You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/oncommandapi/mode/aggregateraidstatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/aggregateraidstatus.pm index 145126b4a..446c43d2d 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/aggregateraidstatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/aggregateraidstatus.pm @@ -160,12 +160,12 @@ Can be: 'name', 'node', 'cluster' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{type}, %{size} +You can use the following variables: %{status}, %{type}, %{size} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /normal/i'). -Can used special variables like: %{status}, %{type}, %{size} +You can use the following variables: %{status}, %{type}, %{size} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/aggregatestatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/aggregatestatus.pm index 93db0ede3..8f48347eb 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/aggregatestatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/aggregatestatus.pm @@ -158,12 +158,12 @@ Can be: 'name', 'node', 'cluster' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{mirror_status} +You can use the following variables: %{state}, %{mirror_status} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /online/i'). -Can used special variables like: %{state}, %{mirror_status} +You can use the following variables: %{state}, %{mirror_status} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/clusterstatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/clusterstatus.pm index a1e1a697f..7994adc43 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/clusterstatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/clusterstatus.pm @@ -136,12 +136,12 @@ Filter snapmirror name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{metro_cluster_mode}, %{metro_cluster_configuration_state} +You can use the following variables: %{status}, %{metro_cluster_mode}, %{metro_cluster_configuration_state} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /ok/i'). -Can used special variables like: %{status}, %{metro_cluster_mode}, %{metro_cluster_configuration_state} +You can use the following variables: %{status}, %{metro_cluster_mode}, %{metro_cluster_configuration_state} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/fcportstatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/fcportstatus.pm index 6500ec11a..0f46283d2 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/fcportstatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/fcportstatus.pm @@ -141,12 +141,12 @@ Can be: 'name', 'volume' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{state} +You can use the following variables: %{state}, %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /online/i || %{state} !~ /online/i'). -Can used special variables like: %{status}, %{state} +You can use the following variables: %{status}, %{state} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/nodefailoverstatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/nodefailoverstatus.pm index 56a3d1445..a94f3ff1a 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/nodefailoverstatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/nodefailoverstatus.pm @@ -154,12 +154,12 @@ Can be: 'name', 'clusters' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{interconnect}, %{current_mode}, %{take_over_possible} +You can use the following variables: %{state}, %{interconnect}, %{current_mode}, %{take_over_possible} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /connected/i || %{interconnect} !~ /up/i'). -Can used special variables like: %{state}, %{interconnect}, %{current_mode}, %{take_over_possible} +You can use the following variables: %{state}, %{interconnect}, %{current_mode}, %{take_over_possible} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/nodehardwarestatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/nodehardwarestatus.pm index d986aabdb..b7ab839b8 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/nodehardwarestatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/nodehardwarestatus.pm @@ -182,13 +182,13 @@ Can be: 'failed-fans', 'psu'. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{temperature}, %{battery_status} +You can use the following variables: %{status}, %{temperature}, %{battery_status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /not healthy/i || %{temperature} !~ /ok/i || %{battery_status} !~ /battery_ok|battery_fully_charge|battery_over_charged/i'). -Can used special variables like: %{status}, %{temperature}, %{battery_status} +You can use the following variables: %{status}, %{temperature}, %{battery_status} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/qtreestatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/qtreestatus.pm index 67a978668..304390fdc 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/qtreestatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/qtreestatus.pm @@ -146,12 +146,12 @@ Can be: 'name', 'volume' (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state} +You can use the following variables: %{state} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status} +You can use the following variables: %{status} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/snapmirrorstatus.pm b/src/storage/netapp/ontap/oncommandapi/mode/snapmirrorstatus.pm index c9abd8e97..356fb695f 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/snapmirrorstatus.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/snapmirrorstatus.pm @@ -131,12 +131,12 @@ Filter snapmirror name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{update} +You can use the following variables: %{state}, %{update} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /snapmirrored/i || %{update} =~ /not healthy/i'). -Can used special variables like: %{state}, %{update} +You can use the following variables: %{state}, %{update} =back diff --git a/src/storage/netapp/ontap/oncommandapi/mode/volumes.pm b/src/storage/netapp/ontap/oncommandapi/mode/volumes.pm index cca82652b..c281e43a3 100644 --- a/src/storage/netapp/ontap/oncommandapi/mode/volumes.pm +++ b/src/storage/netapp/ontap/oncommandapi/mode/volumes.pm @@ -433,17 +433,17 @@ Filter volumes by storage virtual machine name. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{volumeName}, %{svmName} +You can use the following variables: %{state}, %{volumeName}, %{svmName} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{volumeName}, %{svmName} +You can use the following variables: %{state}, %{volumeName}, %{svmName} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /online/i'). -Can used special variables like: %{state}, %{volumeName}, %{svmName} +You can use the following variables: %{state}, %{volumeName}, %{svmName} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/restapi/mode/aggregates.pm b/src/storage/netapp/ontap/restapi/mode/aggregates.pm index 2884de6a8..f210897e4 100644 --- a/src/storage/netapp/ontap/restapi/mode/aggregates.pm +++ b/src/storage/netapp/ontap/restapi/mode/aggregates.pm @@ -283,17 +283,17 @@ Filter aggregates by aggregate name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /online/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/restapi/mode/cluster.pm b/src/storage/netapp/ontap/restapi/mode/cluster.pm index 3f6b7a4c2..e246cc8ed 100644 --- a/src/storage/netapp/ontap/restapi/mode/cluster.pm +++ b/src/storage/netapp/ontap/restapi/mode/cluster.pm @@ -250,17 +250,17 @@ Example: --filter-counters='node-status' =item B<--unknown-node-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{link_status}, %{display} +You can use the following variables: %{state}, %{link_status}, %{display} =item B<--warning-node-status> Set warning threshold for status. -Can used special variables like: %{state}, %{link_status}, %{display} +You can use the following variables: %{state}, %{link_status}, %{display} =item B<--critical-node-status> Set critical threshold for status (Default: '%{state} ne "online"'). -Can used special variables like: %{state}, %{link_status}, %{display} +You can use the following variables: %{state}, %{link_status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/restapi/mode/luns.pm b/src/storage/netapp/ontap/restapi/mode/luns.pm index 5205d2cd7..52f55f157 100644 --- a/src/storage/netapp/ontap/restapi/mode/luns.pm +++ b/src/storage/netapp/ontap/restapi/mode/luns.pm @@ -115,17 +115,17 @@ Filter LUN name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{container_state}, %{display} +You can use the following variables: %{state}, %{container_state}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{container_state}, %{display} +You can use the following variables: %{state}, %{container_state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /online/i'). -Can used special variables like: %{state}, %{container_state}, %{display} +You can use the following variables: %{state}, %{container_state}, %{display} =back diff --git a/src/storage/netapp/ontap/restapi/mode/snapmirrors.pm b/src/storage/netapp/ontap/restapi/mode/snapmirrors.pm index 753d4931a..bfff2e735 100644 --- a/src/storage/netapp/ontap/restapi/mode/snapmirrors.pm +++ b/src/storage/netapp/ontap/restapi/mode/snapmirrors.pm @@ -118,17 +118,17 @@ Filter snapmirror name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{healthy}, %{state}, %{transfer_state}, %{display} +You can use the following variables: %{healthy}, %{state}, %{transfer_state}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{healthy}, %{state}, %{transfer_state}, %{display} +You can use the following variables: %{healthy}, %{state}, %{transfer_state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{healthy} ne "true" or %{state} eq "broken_off"'). -Can used special variables like: %{healthy}, %{state}, %{transfer_state}, %{display} +You can use the following variables: %{healthy}, %{state}, %{transfer_state}, %{display} =back diff --git a/src/storage/netapp/ontap/restapi/mode/volumes.pm b/src/storage/netapp/ontap/restapi/mode/volumes.pm index 080639790..4a1aed3b2 100644 --- a/src/storage/netapp/ontap/restapi/mode/volumes.pm +++ b/src/storage/netapp/ontap/restapi/mode/volumes.pm @@ -288,17 +288,17 @@ Filter volumes by vserver name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /online/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/snmp/mode/aggregates.pm b/src/storage/netapp/ontap/snmp/mode/aggregates.pm index 78a71d933..d48a15b95 100644 --- a/src/storage/netapp/ontap/snmp/mode/aggregates.pm +++ b/src/storage/netapp/ontap/snmp/mode/aggregates.pm @@ -134,32 +134,32 @@ Filter aggregates by name. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /normal|mirrored/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--unknown-state> Set unknown threshold for state. -Can used special variables like: %{state}, %{name} +You can use the following variables: %{state}, %{name} =item B<--warning-state> Set warning threshold for state. -Can used special variables like: %{state}, %{name} +You can use the following variables: %{state}, %{name} =item B<--critical-state> Set critical threshold for state (Default: '%{state} =~ /offline/i'). -Can used special variables like: %{state}, %{name} +You can use the following variables: %{state}, %{name} =back diff --git a/src/storage/netapp/ontap/snmp/mode/clusternodes.pm b/src/storage/netapp/ontap/snmp/mode/clusternodes.pm index 640d66e02..d57d3d9a3 100644 --- a/src/storage/netapp/ontap/snmp/mode/clusternodes.pm +++ b/src/storage/netapp/ontap/snmp/mode/clusternodes.pm @@ -391,62 +391,62 @@ Filter ports by role (can be a regexp). =item B<--unknown-node-status> Set unknown threshold for status. -Can used special variables like: %{node_status}, %{node_name} +You can use the following variables: %{node_status}, %{node_name} =item B<--warning-node-status> Set warning threshold for status. -Can used special variables like: %{node_status}, %{node_name} +You can use the following variables: %{node_status}, %{node_name} =item B<--critical-node-status> Set critical threshold for status (Default: '%{node_status} eq "clusterComLost"'). -Can used special variables like: %{node_status}, %{node_name} +You can use the following variables: %{node_status}, %{node_name} =item B<--unknown-bbu-status> Set unknown threshold for status. -Can used special variables like: %{bbu_status}, %{node_name} +You can use the following variables: %{bbu_status}, %{node_name} =item B<--warning-bbu-status> Set warning threshold for status. -Can used special variables like: %{bbu_status}, %{node_name} +You can use the following variables: %{bbu_status}, %{node_name} =item B<--critical-bbu-status> Set critical threshold for status (Default: '%{bbu_status} !~ /fullyCharged|ok/i'). -Can used special variables like: %{bbu_status}, %{node_name} +You can use the following variables: %{bbu_status}, %{node_name} =item B<--unknown-port-link-status> Set unknown threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{port_id}, %{node_name} +You can use the following variables: %{admstatus}, %{opstatus}, %{port_id}, %{node_name} =item B<--warning-port-link-status> Set warning threshold for status. -Can used special variables like: %{admstatus}, %{opstatus}, %{port_id}, %{node_name} +You can use the following variables: %{admstatus}, %{opstatus}, %{port_id}, %{node_name} =item B<--critical-port-link-status> Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). -Can used special variables like: %{admstatus}, %{opstatus}, %{port_id}, %{node_name} +You can use the following variables: %{admstatus}, %{opstatus}, %{port_id}, %{node_name} =item B<--unknown-port-health> Set unknown threshold for status. -Can used special variables like: %{health}, %{port_id}, %{node_name} +You can use the following variables: %{health}, %{port_id}, %{node_name} =item B<--warning-port-health> Set warning threshold for status (Default: '%{health} eq "degraded"'). -Can used special variables like: %{health}, %{port_id}, %{node_name} +You can use the following variables: %{health}, %{port_id}, %{node_name} =item B<--critical-port-health> Set critical threshold for status. -Can used special variables like: %{health}, %{port_id}, %{node_name} +You can use the following variables: %{health}, %{port_id}, %{node_name} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/snmp/mode/failover.pm b/src/storage/netapp/ontap/snmp/mode/failover.pm index a8f97df84..fb629bb64 100644 --- a/src/storage/netapp/ontap/snmp/mode/failover.pm +++ b/src/storage/netapp/ontap/snmp/mode/failover.pm @@ -203,32 +203,32 @@ Filter name with regexp (based on serial) =item B<--unknown-cluster-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{cluster_status}, %{reason_cannot_takeover}, %{partner_status} +You can use the following variables: %{cluster_status}, %{reason_cannot_takeover}, %{partner_status} =item B<--warning-cluster-status> Set warning threshold for status (Default: '%{cluster_status} =~ /^takeover|partialGiveback/i'). -Can used special variables like: %{cluster_status}, %{reason_cannot_takeover}, %{partner_status} +You can use the following variables: %{cluster_status}, %{reason_cannot_takeover}, %{partner_status} =item B<--critical-cluster-status> Set critical threshold for status (Default: '%{cluster_status} =~ /dead|cannotTakeover/i'). -Can used special variables like: %{cluster_status}, %{reason_cannot_takeover}, %{partner_status} +You can use the following variables: %{cluster_status}, %{reason_cannot_takeover}, %{partner_status} =item B<--unknown-node-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{status}, %{reason_cannot_takeover}, %{partner_status}, %{display} +You can use the following variables: %{status}, %{reason_cannot_takeover}, %{partner_status}, %{display} =item B<--warning-node-status> Set warning threshold for status (Default: '%{status} =~ /^takeover|partialGiveback/i'). -Can used special variables like: %{status}, %{reason_cannot_takeover}, %{partner_status}, %{display} +You can use the following variables: %{status}, %{reason_cannot_takeover}, %{partner_status}, %{display} =item B<--critical-node-status> Set critical threshold for status (Default: '%{status} =~ /dead|cannotTakeover/i'). -Can used special variables like: %{status}, %{reason_cannot_takeover}, %{partner_status}, %{display} +You can use the following variables: %{status}, %{reason_cannot_takeover}, %{partner_status}, %{display} =back diff --git a/src/storage/netapp/ontap/snmp/mode/filesys.pm b/src/storage/netapp/ontap/snmp/mode/filesys.pm index 1425b7ea1..89bd19442 100644 --- a/src/storage/netapp/ontap/snmp/mode/filesys.pm +++ b/src/storage/netapp/ontap/snmp/mode/filesys.pm @@ -369,17 +369,17 @@ Check filesystem usage (volumes, snapshots and aggregates also). =item B<--unknown-vserver-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{vserver_status}, %{vserver_name} +You can use the following variables: %{vserver_status}, %{vserver_name} =item B<--warning-vserver-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{vserver_status}, %{vserver_name} +You can use the following variables: %{vserver_status}, %{vserver_name} =item B<--critical-vserver-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{vserver_status}, %{vserver_name} +You can use the following variables: %{vserver_status}, %{vserver_name} =item B<--warning-*> diff --git a/src/storage/netapp/ontap/snmp/mode/plexes.pm b/src/storage/netapp/ontap/snmp/mode/plexes.pm index 399418345..1c6189295 100644 --- a/src/storage/netapp/ontap/snmp/mode/plexes.pm +++ b/src/storage/netapp/ontap/snmp/mode/plexes.pm @@ -221,17 +221,17 @@ Filter plexes by aggregate name. =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name}, %{aggregate} +You can use the following variables: %{status}, %{name}, %{aggregate} =item B<--warning-status> Set warning threshold for status (Default: '%{status} eq "resyncing"'). -Can used special variables like: %{status}, %{name}, %{aggregate} +You can use the following variables: %{status}, %{name}, %{aggregate} =item B<--critical-status> Set critical threshold for status (Default: '%{status} eq "offline"'). -Can used special variables like: %{status}, %{name}, %{aggregate} +You can use the following variables: %{status}, %{name}, %{aggregate} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/snmp/mode/sis.pm b/src/storage/netapp/ontap/snmp/mode/sis.pm index debf7cd34..de81c55a7 100644 --- a/src/storage/netapp/ontap/snmp/mode/sis.pm +++ b/src/storage/netapp/ontap/snmp/mode/sis.pm @@ -175,17 +175,17 @@ Filter name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{lastOpError}, %{display} +You can use the following variables: %{state}, %{status}, %{lastOpError}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{lastOpError}, %{display} +You can use the following variables: %{state}, %{status}, %{lastOpError}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} eq "enabled" and %{lastOpError} !~ /-|Success/i'). -Can used special variables like: %{state}, %{status}, %{lastOpError}, %{display} +You can use the following variables: %{state}, %{status}, %{lastOpError}, %{display} =back diff --git a/src/storage/netapp/ontap/snmp/mode/snapmirrorlag.pm b/src/storage/netapp/ontap/snmp/mode/snapmirrorlag.pm index a69d8b7db..c21647c6d 100644 --- a/src/storage/netapp/ontap/snmp/mode/snapmirrorlag.pm +++ b/src/storage/netapp/ontap/snmp/mode/snapmirrorlag.pm @@ -246,17 +246,17 @@ Example: --filter-counters='^status$' =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{state} =~ /quiesced/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} =~ /unknown|brokenOff|uninitialized/i'). -Can used special variables like: %{state}, %{display} +You can use the following variables: %{state}, %{display} =item B<--warning-lag> diff --git a/src/storage/netapp/ontap/snmp/mode/snapvaultusage.pm b/src/storage/netapp/ontap/snmp/mode/snapvaultusage.pm index 040ed0d04..4c4a11d9b 100644 --- a/src/storage/netapp/ontap/snmp/mode/snapvaultusage.pm +++ b/src/storage/netapp/ontap/snmp/mode/snapvaultusage.pm @@ -220,17 +220,17 @@ Filter snapvault name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{state}, %{status}, %{display} +You can use the following variables: %{state}, %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/ontap/snmp/mode/volumeoptions.pm b/src/storage/netapp/ontap/snmp/mode/volumeoptions.pm index 0b4f11a0c..b9ac7d921 100644 --- a/src/storage/netapp/ontap/snmp/mode/volumeoptions.pm +++ b/src/storage/netapp/ontap/snmp/mode/volumeoptions.pm @@ -198,32 +198,32 @@ Filter on volume status (can be a regexp). =item B<--unknown-status> Set unknown threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--unknown-options> Set warning threshold for status (Default: ''). -Can used special variables like: %{options}, %{display} +You can use the following variables: %{options}, %{display} =item B<--warning-options> Set warning threshold for status (Default: ''). -Can used special variables like: %{options}, %{display} +You can use the following variables: %{options}, %{display} =item B<--critical-options> Set critical threshold for status (Default: ''). -Can used special variables like: %{options}, %{display} +You can use the following variables: %{options}, %{display} =back diff --git a/src/storage/netapp/santricity/restapi/mode/storagecontrollers.pm b/src/storage/netapp/santricity/restapi/mode/storagecontrollers.pm index ca2602363..90e95665d 100644 --- a/src/storage/netapp/santricity/restapi/mode/storagecontrollers.pm +++ b/src/storage/netapp/santricity/restapi/mode/storagecontrollers.pm @@ -217,17 +217,17 @@ Filter controller name (can be a regexp). =item B<--unknown-controller-status> Set unknown threshold for status (Default: '%{status} =~ /unknown/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-controller-status> Set warning threshold for status (Default: '%{status} =~ /rpaParErr|degraded/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-controller-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/santricity/restapi/mode/storagepools.pm b/src/storage/netapp/santricity/restapi/mode/storagepools.pm index 790bdf7b4..ca453daea 100644 --- a/src/storage/netapp/santricity/restapi/mode/storagepools.pm +++ b/src/storage/netapp/santricity/restapi/mode/storagepools.pm @@ -200,17 +200,17 @@ Filter pool name (can be a regexp). =item B<--unknown-pool-status> Set unknown threshold for status. -Can used special variables like: %{raid_status}, %{state}, %{display} +You can use the following variables: %{raid_status}, %{state}, %{display} =item B<--warning-pool-status> Set warning threshold for status (Default: '%{raid_status} =~ /degraded/i'). -Can used special variables like: %{raid_status}, %{state}, %{display} +You can use the following variables: %{raid_status}, %{state}, %{display} =item B<--critical-pool-status> Set critical threshold for status (Default: '%{raid_status} =~ /failed/i'). -Can used special variables like: %{raid_status}, %{state}, %{display} +You can use the following variables: %{raid_status}, %{state}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/santricity/restapi/mode/storagesystems.pm b/src/storage/netapp/santricity/restapi/mode/storagesystems.pm index 22d5a3f49..073bae8ac 100644 --- a/src/storage/netapp/santricity/restapi/mode/storagesystems.pm +++ b/src/storage/netapp/santricity/restapi/mode/storagesystems.pm @@ -161,17 +161,17 @@ Filter storage name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{state}, %{display} +You can use the following variables: %{status}, %{state}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /needsAttn/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/netapp/santricity/restapi/mode/storagevolumes.pm b/src/storage/netapp/santricity/restapi/mode/storagevolumes.pm index 1ca983129..1627a340f 100644 --- a/src/storage/netapp/santricity/restapi/mode/storagevolumes.pm +++ b/src/storage/netapp/santricity/restapi/mode/storagevolumes.pm @@ -203,17 +203,17 @@ Filter volume name (can be a regexp). =item B<--unknown-volume-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-volume-status> Set warning threshold for status (Default: '%{status} =~ /degraded/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-volume-status> Set critical threshold for status (Default: '%{status} =~ /failed/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/nimble/restapi/mode/arrays.pm b/src/storage/nimble/restapi/mode/arrays.pm index a9c331c5a..94f573323 100644 --- a/src/storage/nimble/restapi/mode/arrays.pm +++ b/src/storage/nimble/restapi/mode/arrays.pm @@ -182,17 +182,17 @@ Filter array name (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status. -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} =~ /unreachable/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/nimble/restapi/mode/volumes.pm b/src/storage/nimble/restapi/mode/volumes.pm index a04efa1b4..1b56918b5 100644 --- a/src/storage/nimble/restapi/mode/volumes.pm +++ b/src/storage/nimble/restapi/mode/volumes.pm @@ -202,17 +202,17 @@ Filter volumes by replication role (can be a regexp). =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{state}, %{space_level_usage}, %{display} +You can use the following variables: %{state}, %{space_level_usage}, %{display} =item B<--warning-status> Set warning threshold for status (Default: '%{space_usage_level} =~ /warning/'). -Can used special variables like: %{state}, %{space_level_usage}, %{display} +You can use the following variables: %{state}, %{space_level_usage}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{state} !~ /online/i || %{space_usage_level} =~ /critical/'). -Can used special variables like: %{state}, %{space_level_usage}, %{display} +You can use the following variables: %{state}, %{space_level_usage}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/oracle/zs/restapi/mode/pools.pm b/src/storage/oracle/zs/restapi/mode/pools.pm index 5bb237146..f1416a2ec 100644 --- a/src/storage/oracle/zs/restapi/mode/pools.pm +++ b/src/storage/oracle/zs/restapi/mode/pools.pm @@ -175,17 +175,17 @@ Filter pool name (can be a regexp). =item B<--unknown-status> Set unknon threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /online|exported/i'). -Can used special variables like: %{status}, %{display} +You can use the following variables: %{status}, %{display} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/purestorage/flasharray/legacy/restapi/mode/alarms.pm b/src/storage/purestorage/flasharray/legacy/restapi/mode/alarms.pm index 0200fd647..e549d0c92 100644 --- a/src/storage/purestorage/flasharray/legacy/restapi/mode/alarms.pm +++ b/src/storage/purestorage/flasharray/legacy/restapi/mode/alarms.pm @@ -176,12 +176,12 @@ Filter by category name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{severity} =~ /warning/i') -Can used special variables like: %{category}, %{code}, %{severity}, %{opened}, %{event}, %{component_name} +You can use the following variables: %{category}, %{code}, %{severity}, %{opened}, %{event}, %{component_name} =item B<--critical-status> Set critical threshold for status (Default: '%{severity} =~ /critical/i'). -Can used special variables like: %{category}, %{code}, %{severity}, %{opened}, %{event}, %{component_name} +You can use the following variables: %{category}, %{code}, %{severity}, %{opened}, %{event}, %{component_name} =item B<--memory> diff --git a/src/storage/purestorage/flasharray/v2/restapi/mode/alerts.pm b/src/storage/purestorage/flasharray/v2/restapi/mode/alerts.pm index 215a9765c..89a7ba4cf 100644 --- a/src/storage/purestorage/flasharray/v2/restapi/mode/alerts.pm +++ b/src/storage/purestorage/flasharray/v2/restapi/mode/alerts.pm @@ -166,12 +166,12 @@ Filter by category name (can be a regexp). =item B<--warning-status> Set warning threshold for status (Default: '%{state} ne "closed" and %{severity} =~ /warning/i') -Can used special variables like: %{category}, %{code}, %{severity}, %{opened}, %{state}, %{issue}, %{component_name} +You can use the following variables: %{category}, %{code}, %{severity}, %{opened}, %{state}, %{issue}, %{component_name} =item B<--critical-status> Set critical threshold for status (Default: '%{state} ne "closed" and %{severity} =~ /critical/i'). -Can used special variables like: %{category}, %{code}, %{severity}, %{opened}, %{state}, %{issue}, %{component_name} +You can use the following variables: %{category}, %{code}, %{severity}, %{opened}, %{state}, %{issue}, %{component_name} =item B<--memory> diff --git a/src/storage/purestorage/flashblade/v2/restapi/mode/alerts.pm b/src/storage/purestorage/flashblade/v2/restapi/mode/alerts.pm index 0706ca44f..174772ecc 100644 --- a/src/storage/purestorage/flashblade/v2/restapi/mode/alerts.pm +++ b/src/storage/purestorage/flashblade/v2/restapi/mode/alerts.pm @@ -161,12 +161,12 @@ Check alerts. =item B<--warning-status> Set warning threshold for status (Default: '%{state} ne "closed" and %{severity} =~ /warning/i') -Can used special variables like: %{code}, %{severity}, %{opened}, %{state}, %{component_name} +You can use the following variables: %{code}, %{severity}, %{opened}, %{state}, %{component_name} =item B<--critical-status> Set critical threshold for status (Default: '%{state} ne "closed" and %{severity} =~ /critical/i'). -Can used special variables like: %{code}, %{severity}, %{opened}, %{state}, %{component_name} +You can use the following variables: %{code}, %{severity}, %{opened}, %{state}, %{component_name} =item B<--memory> diff --git a/src/storage/qnap/snmp/mode/pools.pm b/src/storage/qnap/snmp/mode/pools.pm index 45bcf2e27..80238b029 100644 --- a/src/storage/qnap/snmp/mode/pools.pm +++ b/src/storage/qnap/snmp/mode/pools.pm @@ -258,17 +258,17 @@ Filter pools by name (can be a regexp). =item B<--unknown-pool-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-pool-status> Set warning threshold for status (Default: '%{status} =~ /degraded|warning/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-pool-status> Set critical threshold for status (Default: '%{status} =~ /error|critical/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/qnap/snmp/mode/upgrade.pm b/src/storage/qnap/snmp/mode/upgrade.pm index e247ea6a5..d209b030f 100644 --- a/src/storage/qnap/snmp/mode/upgrade.pm +++ b/src/storage/qnap/snmp/mode/upgrade.pm @@ -99,12 +99,12 @@ Check upgrade status (only works with QTS OS). =item B<--warning-status> Set warning threshold for status (Default : '%{upgrade} eq "available"'). -Can used special variables like: %{model}, %{version}, %{upgrade} +You can use the following variables: %{model}, %{version}, %{upgrade} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{model}, %{version}, %{upgrade} +You can use the following variables: %{model}, %{version}, %{upgrade} =back diff --git a/src/storage/qnap/snmp/mode/volumes.pm b/src/storage/qnap/snmp/mode/volumes.pm index fa3e8df65..903bd9fcb 100644 --- a/src/storage/qnap/snmp/mode/volumes.pm +++ b/src/storage/qnap/snmp/mode/volumes.pm @@ -270,17 +270,17 @@ Force to use legacy counters. Should be used when EX/QTS counters are buggy. =item B<--unknown-volume-status> Set unknown threshold for status. -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-volume-status> Set warning threshold for status (Default: '%{status} =~ /degraded|warning/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--critical-volume-status> Set critical threshold for status (Default: '%{status} =~ /critical/i'). -Can used special variables like: %{status}, %{name} +You can use the following variables: %{status}, %{name} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/quantum/dxi/ssh/mode/compaction.pm b/src/storage/quantum/dxi/ssh/mode/compaction.pm index edc57a876..df9005739 100644 --- a/src/storage/quantum/dxi/ssh/mode/compaction.pm +++ b/src/storage/quantum/dxi/ssh/mode/compaction.pm @@ -173,12 +173,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{compaction_status} +You can use the following variables: %{compaction_status} =item B<--critical-status> Set critical threshold for status (Default: '%{compaction_status} !~ /ready/i'). -Can used special variables like: %{compaction_status} +You can use the following variables: %{compaction_status} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/quantum/dxi/ssh/mode/dedupnas.pm b/src/storage/quantum/dxi/ssh/mode/dedupnas.pm index 0945be108..57d20604f 100644 --- a/src/storage/quantum/dxi/ssh/mode/dedupnas.pm +++ b/src/storage/quantum/dxi/ssh/mode/dedupnas.pm @@ -201,12 +201,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: '%{state} !~ /Enabled/i'). -Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}. +You can use the following variables: %{status}, %{state}, %{duration}, %{percent_complete}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}. +You can use the following variables: %{status}, %{state}, %{duration}, %{percent_complete}. =item B<--warning-*> B<--critical-*> diff --git a/src/storage/quantum/dxi/ssh/mode/dedupvtl.pm b/src/storage/quantum/dxi/ssh/mode/dedupvtl.pm index 9ef08349a..6f37fe8d4 100644 --- a/src/storage/quantum/dxi/ssh/mode/dedupvtl.pm +++ b/src/storage/quantum/dxi/ssh/mode/dedupvtl.pm @@ -202,12 +202,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: '%{state} !~ /Enabled/i'). -Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}. +You can use the following variables: %{status}, %{state}, %{duration}, %{percent_complete}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}. +You can use the following variables: %{status}, %{state}, %{duration}, %{percent_complete}. =item B<--warning-*> B<--critical-*> diff --git a/src/storage/quantum/dxi/ssh/mode/health.pm b/src/storage/quantum/dxi/ssh/mode/health.pm index 740956449..2824ca20e 100644 --- a/src/storage/quantum/dxi/ssh/mode/health.pm +++ b/src/storage/quantum/dxi/ssh/mode/health.pm @@ -119,12 +119,12 @@ Check health status. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{name}, %{status}, %{state} +You can use the following variables: %{name}, %{status}, %{state} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Ready|Success/i'). -Can used special variables like: %{name}, %{status}, %{state} +You can use the following variables: %{name}, %{status}, %{state} =back diff --git a/src/storage/quantum/dxi/ssh/mode/hostbusadapterstatus.pm b/src/storage/quantum/dxi/ssh/mode/hostbusadapterstatus.pm index bfdd45b0d..0277f0760 100644 --- a/src/storage/quantum/dxi/ssh/mode/hostbusadapterstatus.pm +++ b/src/storage/quantum/dxi/ssh/mode/hostbusadapterstatus.pm @@ -118,12 +118,12 @@ Check hostbus adapters status. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Normal/i'). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =back diff --git a/src/storage/quantum/dxi/ssh/mode/network.pm b/src/storage/quantum/dxi/ssh/mode/network.pm index cbef07afa..8b898eeb2 100644 --- a/src/storage/quantum/dxi/ssh/mode/network.pm +++ b/src/storage/quantum/dxi/ssh/mode/network.pm @@ -119,12 +119,12 @@ Check network ports status. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Up/i'). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =back diff --git a/src/storage/quantum/dxi/ssh/mode/reclamation.pm b/src/storage/quantum/dxi/ssh/mode/reclamation.pm index 6aea623da..36b1164a8 100644 --- a/src/storage/quantum/dxi/ssh/mode/reclamation.pm +++ b/src/storage/quantum/dxi/ssh/mode/reclamation.pm @@ -186,12 +186,12 @@ Example: --filter-counters='status' =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{reclamation_status} +You can use the following variables: %{reclamation_status} =item B<--critical-status> Set critical threshold for status (Default: '%{reclamation_status} !~ /ready/i'). -Can used special variables like: %{reclamation_status} +You can use the following variables: %{reclamation_status} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/quantum/dxi/ssh/mode/storagearraystatus.pm b/src/storage/quantum/dxi/ssh/mode/storagearraystatus.pm index 384db12dc..e14f8e82d 100644 --- a/src/storage/quantum/dxi/ssh/mode/storagearraystatus.pm +++ b/src/storage/quantum/dxi/ssh/mode/storagearraystatus.pm @@ -112,12 +112,12 @@ Check storage array status. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Normal/i'). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =back diff --git a/src/storage/quantum/dxi/ssh/mode/systemstatus.pm b/src/storage/quantum/dxi/ssh/mode/systemstatus.pm index 838fed8c7..f45d4d3d2 100644 --- a/src/storage/quantum/dxi/ssh/mode/systemstatus.pm +++ b/src/storage/quantum/dxi/ssh/mode/systemstatus.pm @@ -123,12 +123,12 @@ Check system board status. =item B<--warning-status> Set warning threshold for status (Default: ''). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =item B<--critical-status> Set critical threshold for status (Default: '%{status} !~ /Normal/i'). -Can used special variables like: %{name}, %{status} +You can use the following variables: %{name}, %{status} =back diff --git a/src/storage/synology/snmp/mode/ha.pm b/src/storage/synology/snmp/mode/ha.pm index eef814674..cb998cedc 100644 --- a/src/storage/synology/snmp/mode/ha.pm +++ b/src/storage/synology/snmp/mode/ha.pm @@ -132,17 +132,17 @@ Example: --filter-counters='^status$' =item B<--unknown-status> Set unknown threshold for status. -Can used special variables like: %{cluster_status}, %{heartbeat_status}, %{active_node_name}, %{passive_node_name} +You can use the following variables: %{cluster_status}, %{heartbeat_status}, %{active_node_name}, %{passive_node_name} =item B<--warning-status> Set warning threshold for status (Default: '%{cluster_status} =~ /warning/i || %{heartbeat_status} =~ /abnormal/i'). -Can used special variables like: %{cluster_status}, %{heartbeat_status}, %{active_node_name}, %{passive_node_name} +You can use the following variables: %{cluster_status}, %{heartbeat_status}, %{active_node_name}, %{passive_node_name} =item B<--critical-status> Set critical threshold for status (Default: '%{cluster_status} =~ /critical/i || %{heartbeat_status} =~ /disconnected/i'). -Can used special variables like: %{cluster_status}, %{heartbeat_status}, %{active_node_name}, %{passive_node_name} +You can use the following variables: %{cluster_status}, %{heartbeat_status}, %{active_node_name}, %{passive_node_name} =item B<--warning-*> B<--critical-*> diff --git a/src/storage/synology/snmp/mode/upgrade.pm b/src/storage/synology/snmp/mode/upgrade.pm index fa4e5dc3b..c89d8739b 100644 --- a/src/storage/synology/snmp/mode/upgrade.pm +++ b/src/storage/synology/snmp/mode/upgrade.pm @@ -104,12 +104,12 @@ Check upgrade status =item B<--warning-status> Set warning threshold for status (Default : '%{upgrade} ne "unavailable"'). -Can used special variables like: %{model}, %{version}, %{upgrade} +You can use the following variables: %{model}, %{version}, %{upgrade} =item B<--critical-status> Set critical threshold for status. -Can used special variables like: %{model}, %{version}, %{upgrade} +You can use the following variables: %{model}, %{version}, %{upgrade} =back diff --git a/src/storage/wd/nas/snmp/mode/hardware.pm b/src/storage/wd/nas/snmp/mode/hardware.pm index bbb063a42..4f4686b1f 100644 --- a/src/storage/wd/nas/snmp/mode/hardware.pm +++ b/src/storage/wd/nas/snmp/mode/hardware.pm @@ -204,12 +204,12 @@ Check hardware. =item B<--warning-fan-status> Set warning threshold for status (Default : '%{status} ne "running"'). -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--critical-fan-status> Set critical threshold for status. -Can used special variables like: %{status} +You can use the following variables: %{status} =item B<--warning-*> B<--critical-*> diff --git a/tests/functional/cloud/aws/cloudtrail/checktrailstatus.sh b/tests/functional/cloud/aws/cloudtrail/checktrailstatus.sh new file mode 100644 index 000000000..252d7c44c --- /dev/null +++ b/tests/functional/cloud/aws/cloudtrail/checktrailstatus.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +current_dir="$( cd "$(dirname "$0")/../../../../.." >/dev/null 2>&1 || exit ; pwd -P )" +cmd="perl $current_dir/src/centreon_plugins.pl --plugin=cloud::aws::cloudtrail::plugin --custommode=paws --region=eu-west --aws-secret-key=secret --aws-access-key=key" + +nb_tests=0 +nb_tests_ok=0 + +test_status_ok=$($cmd --mode=checktrailstatus --endpoint=http://localhost:3000/cloudtrail/gettrailstatus/true --trail-name=TrailName) +((nb_tests++)) +if [[ $test_status_ok = "OK: Trail is logging: 1 | 'trail_is_logging'=1;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_status_ok ko" + echo $test_status_ok +fi + +test_status_critical=$($cmd --mode=checktrailstatus --endpoint=http://localhost:3000/cloudtrail/gettrailstatus/false --trail-name=TrailName) +((nb_tests++)) +if [[ $test_status_critical = "CRITICAL: Trail is logging: 0 | 'trail_is_logging'=0;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_status_critical ko" + echo $test_status_critical +fi + +if [[ $nb_tests_ok = $nb_tests ]] +then + echo "OK: "$nb_tests_ok"/"$nb_tests" tests OK" +else + echo "NOK: "$nb_tests_ok"/"$nb_tests" tests OK" +fi diff --git a/tests/functional/cloud/aws/cloudtrail/countevents.sh b/tests/functional/cloud/aws/cloudtrail/countevents.sh new file mode 100644 index 000000000..7656ba872 --- /dev/null +++ b/tests/functional/cloud/aws/cloudtrail/countevents.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +current_dir="$( cd "$(dirname "$0")/../../../../.." >/dev/null 2>&1 || exit ; pwd -P )" +cmd="perl $current_dir/src/centreon_plugins.pl --plugin=cloud::aws::cloudtrail::plugin --custommode=paws --region=eu-west --aws-secret-key=secret --aws-access-key=key" + +nb_tests=0 +nb_tests_ok=0 + +endpoint_url="http://localhost:3000/cloudtrail/events/AwsApiCall/4/AwsServiceEvent/2/AwsConsoleAction/1/AwsConsoleSignIn/3/NextToken/t" + +test_ok=$($cmd --mode=countevents --endpoint=$endpoint_url) +((nb_tests++)) +if [[ $test_ok = "OK: Number of events: 10.00 | 'events_count'=10.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_ok ko" + echo $test_ok +fi + +test_oknexttoken=$($cmd --mode=countevents --endpoint=$endpoint_url"rue") +((nb_tests++)) +if [[ $test_oknexttoken = "OK: Number of events: 20.00 | 'events_count'=20.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "$test_oknexttoken ko" + echo $test_oknexttoken +fi + +test_okeventtype=$($cmd --mode=countevents --endpoint=$endpoint_url --event-type=AwsApiCall) +((nb_tests++)) +if [[ $test_okeventtype = "OK: Number of events: 4.00 | 'events_count'=4.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_okeventtype ko" + echo $test_okeventtype +fi + +test_okeventtypenexttoken=$($cmd --mode=countevents --endpoint=$endpoint_url"rue" --event-type=AwsServiceEvent) +((nb_tests++)) +if [[ $test_okeventtypenexttoken = "OK: Number of events: 4.00 | 'events_count'=4.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_okeventtypenexttoken ko" + echo $test_okeventtypenexttoken +fi + +test_okdelta=$($cmd --mode=countevents --endpoint=$endpoint_url --event-type=AwsApiCall --delta=10) +((nb_tests++)) +if [[ $test_okdelta = "OK: Number of events: 4.00 | 'events_count'=4.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_okdelta ko" + echo $test_okdelta +fi + +test_okerrormessage=$($cmd --mode=countevents --endpoint=$endpoint_url --error-message='Login error') +((nb_tests++)) +if [[ $test_okerrormessage = "OK: Number of events: 3.00 | 'events_count'=3.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_okerrormessage ko" + echo $test_okerrormessage +fi + +test_okerrormessagepartial=$($cmd --mode=countevents --endpoint=$endpoint_url --error-message='.*error') +((nb_tests++)) +if [[ $test_okerrormessagepartial = "OK: Number of events: 4.00 | 'events_count'=4.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_okerrormessagepartial ko" + echo $test_okerrormessagepartial +fi + +test_warning=$($cmd --mode=countevents --endpoint=$endpoint_url --warning-count=3) +((nb_tests++)) +if [[ $test_warning = "WARNING: Number of events: 10.00 | 'events_count'=10.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_warning ko" + echo $test_warning +fi + +test_critical=$($cmd --mode=countevents --endpoint=$endpoint_url --critical-count=5) +((nb_tests++)) +if [[ $test_critical = "CRITICAL: Number of events: 10.00 | 'events_count'=10.00;;;0;" ]] +then + ((nb_tests_ok++)) +else + echo "test_critical ko" + echo $test_critical +fi + +if [[ $nb_tests_ok = $nb_tests ]] +then + echo "OK: "$nb_tests_ok"/"$nb_tests" tests OK" +else + echo "NOK: "$nb_tests_ok"/"$nb_tests" tests OK" +fi diff --git a/tests/resources/mockoon/cloud-aws-cloudtrail.json b/tests/resources/mockoon/cloud-aws-cloudtrail.json new file mode 100644 index 000000000..f25264798 --- /dev/null +++ b/tests/resources/mockoon/cloud-aws-cloudtrail.json @@ -0,0 +1,130 @@ +{ + "uuid": "e59ad81e-2050-480d-bbae-0e71c607c927", + "lastMigration": 27, + "name": "Aws cloudtrail", + "endpointPrefix": "", + "latency": 0, + "port": 3000, + "hostname": "", + "folders": [], + "routes": [ + { + "uuid": "b5e25f3a-a8e3-4128-9e45-f2654c5a599d", + "type": "http", + "documentation": "", + "method": "post", + "endpoint": "cloudtrail/gettrailstatus/:islogging", + "responses": [ + { + "uuid": "76483999-2022-4610-8e8c-9c0bd535e4c5", + "body": "{\r\n \"IsLogging\": {{ urlParam 'islogging' 'true' }},\r\n \"LatestCloudWatchLogsDeliveryError\": \"error\",\r\n \"LatestCloudWatchLogsDeliveryTime\": 1683298944.125,\r\n \"LatestDeliveryAttemptSucceeded\": \"2023-05-05T15:02:24Z\",\r\n \"LatestDeliveryAttemptTime\": \"2023-05-05T15:02:24Z\",\r\n \"LatestDeliveryError\": \"error\",\r\n \"LatestDeliveryTime\": 1683298944.125,\r\n \"LatestDigestDeliveryError\": \"error\",\r\n \"LatestDigestDeliveryTime\": 1683298944.125,\r\n \"LatestNotificationAttemptSucceeded\": \"2023-05-05T15:02:24Z\",\r\n \"LatestNotificationAttemptTime\": \"2023-05-05T15:02:24Z\",\r\n \"LatestNotificationError\": \"error\",\r\n \"LatestNotificationTime\": 1683298944.125,\r\n \"StartLoggingTime\": 1683298944.125,\r\n \"StopLoggingTime\": 1683298477.918,\r\n \"TimeLoggingStarted\": \"2023-05-05T15:02:24Z\",\r\n \"TimeLoggingStopped\": \"2023-05-05T14:54:37Z\"\r\n}", + "latency": 0, + "statusCode": 200, + "label": "", + "headers": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "bodyType": "INLINE", + "filePath": "", + "databucketID": "", + "sendFileAsBody": false, + "rules": [], + "rulesOperator": "OR", + "disableTemplating": false, + "fallbackTo404": false, + "default": true + } + ], + "enabled": true, + "responseMode": null + }, + { + "uuid": "77f82f1c-b06e-478a-8366-ab325830f00e", + "type": "http", + "documentation": "", + "method": "post", + "endpoint": "cloudtrail/events/AwsApiCall/:AwsApiCall/AwsServiceEvent/:AwsServiceEvent/AwsConsoleAction/:AwsConsoleAction/AwsConsoleSignIn/:AwsConsoleSignIn/NextToken/:NextToken", + "responses": [ + { + "uuid": "7dd41177-8d63-458a-abcc-b3af3ea8c9cd", + "body": "{\r\n\t\"Events\": [\r\n\t\t{{#each (dataRaw 'Events')}}\r\n\t\t {{#if (gt @index 0)}}\r\n\t\t ,\r\n\t\t {{/if}}\r\n \t\t{\r\n \t\t\t\"AccessKeyId\": \"{{AccessKeyId}}\",\r\n \t\t\t\"CloudTrailEvent\": \"{\\\"awsRegion\\\": \\\"eu-west-1\\\", {{#if Error}}\\\"errorCode\\\": \\\"{{ErrorCode}}\\\", \\\"errorMessage\\\": \\\"{{ErrorMessage}}\\\",{{/if}} \\\"eventCategory\\\": \\\"Management\\\", \\\"eventID\\\": \\\"{{EventId}}\\\", \\\"eventName\\\": \\\"{{EventName}}\\\", \\\"eventSource\\\": \\\"{{EventSource}}\\\", \\\"eventTime\\\": \\\"{{EventTime}}\\\", \\\"eventType\\\": \\\"{{EventType}}\\\", \\\"eventVersion\\\": \\\"1.08\\\", \\\"managementEvent\\\": true, \\\"readOnly\\\": true, \\\"recipientAccountId\\\": \\\"{{AccountId}}\\\", \\\"requestID\\\": \\\"{{ faker 'datatype.uuid' }}\\\", \\\"requestParameters\\\": null, \\\"responseElements\\\": null, \\\"sourceIPAddress\\\": \\\"{{ faker 'internet.ip' }}\\\", \\\"tlsDetails\\\": {\\\"cipherSuite\\\": \\\"ECDHE-RSA-AES128-GCM-SHA256\\\", \\\"clientProvidedHostHeader\\\": \\\"cloudtrail.eu-west-1.amazonaws.com\\\", \\\"tlsVersion\\\": \\\"TLSv1.2\\\"}, \\\"userAgent\\\": \\\"aws-cli/2.11.0 Python/3.11.2 Darwin/22.2.0 source/x86_64 prompt/off command/cloudtrail.lookup-events\\\", \\\"userIdentity\\\": {\\\"accessKeyId\\\": \\\"{{AccessKeyId}}\\\", \\\"accountId\\\": \\\"{{AccountId}}\\\", \\\"arn\\\": \\\"arn:aws:sts::{{AccountId}}:assumed-role/{{UserRole}}/{{UserName}}\\\", \\\"principalId\\\": \\\"{{PrincipalId}}:{{UserName}}\\\", \\\"sessionContext\\\": {\\\"attributes\\\": {\\\"creationDate\\\": \\\"{{ faker 'date.past' EventTime }}\\\", \\\"mfaAuthenticated\\\": \\\"false\\\"}, \\\"sessionIssuer\\\": {\\\"accountId\\\": \\\"{{AccountId}}\\\", \\\"arn\\\": \\\"arn:aws:iam::{{AccountId}}:role/{{UserRole}}\\\", \\\"principalId\\\": \\\"{{PrincipalId}}\\\", \\\"type\\\": \\\"Role\\\", \\\"userName\\\": \\\"{{UserRole}}\\\"}, \\\"webIdFederationData\\\": {}}, \\\"type\\\": \\\"{{ faker 'name.jobArea' }}\\\"}}\",\r\n \t\t\t\"EventId\": \"{{EventId}}\",\r\n \t\t\t\"EventName\": \"{{EventName}}\",\r\n \t\t\t\"EventSource\": \"{{EventSource}}\",\r\n \t\t\t\"EventTime\": \"{{EventTime}}\",\r\n \t\t\t\"ReadOnly\": \"true\",\r\n \t\t\t\"Resources\": [\r\n \t\t\t],\r\n \t\t\t\"Username\": \"{{UserName}}\"\r\n \t\t}\r\n\t\t{{/each}}\r\n\t]\r\n\t{{#if (gte (indexOf (urlParam 'NextToken') 'true' 0) 0)}}\r\n\t {{#unless (includes (stringify (body)) 'NextToken')}}\r\n\t\t ,\"NextToken\": \"{{ faker 'random.alphaNumeric' 64 casing='upper' }}\"\r\n\t\t{{/unless}}\r\n\t{{/if}}\r\n}", + "latency": 0, + "statusCode": 200, + "label": "", + "headers": [], + "bodyType": "INLINE", + "filePath": "", + "databucketID": "c5kh", + "sendFileAsBody": false, + "rules": [], + "rulesOperator": "OR", + "disableTemplating": false, + "fallbackTo404": false, + "default": true + } + ], + "enabled": true, + "responseMode": null + } + ], + "rootChildren": [ + { + "type": "route", + "uuid": "b5e25f3a-a8e3-4128-9e45-f2654c5a599d" + }, + { + "type": "route", + "uuid": "77f82f1c-b06e-478a-8366-ab325830f00e" + } + ], + "proxyMode": false, + "proxyHost": "", + "proxyRemovePrefix": false, + "tlsOptions": { + "enabled": false, + "type": "CERT", + "pfxPath": "", + "certPath": "", + "keyPath": "", + "caPath": "", + "passphrase": "" + }, + "cors": true, + "headers": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "proxyReqHeaders": [ + { + "key": "", + "value": "" + } + ], + "proxyResHeaders": [ + { + "key": "", + "value": "" + } + ], + "data": [ + { + "uuid": "76dec2a5-ff63-4e81-9611-94b900ab16e1", + "id": "c5kh", + "name": "EventsData", + "documentation": "", + "value": "[\n {{#each (dataRaw 'EventsTypeData')}}\n {{#if (gte @isEvent 1)}}\n ,\n {{/if}}\n {{setVar 'isEvent' (add (urlParam name) @isEvent)}}\n {{#repeat (urlParam name comma=true)}}\n {\n \"AccessKeyId\": \"{{ faker 'random.alphaNumeric' 20 casing='upper' }}\",\n \"AccountId\": \"{{ faker 'random.numeric' 12 }}\",\n \"Error\": {{error}},\n {{#if error}}\n \"ErrorCode\": \"{{errorCode}}\",\n\t \"ErrorMessage\": \"{{errorMessage}}\",\n {{/if}}\n \"EventId\": \"{{ faker 'datatype.uuid' }}\",\n \"EventName\": \"{{oneOf (array 'LookupEvents' 'ListInstanceAssociations' 'AssumeRoleWithWebIdentity')}}\",\n \"EventSource\": \"{{oneOf (array 'cloudtrail.amazonaws.com' 'ssm.amazonaws.com' 'sts.amazonaws.com')}}\",\n \"EventTime\": \"{{ faker 'date.recent' }}\",\n \"EventType\": \"{{name}}\",\n \"PrincipalId\": \"{{ faker 'random.alphaNumeric' 20 casing='upper' }}\",\n \"UserName\": \"{{ faker 'internet.userName' }}\",\n \"UserRole\": \"{{ faker 'name.jobType' }}\"\n }\n {{/repeat}}\n {{/each}}\n]" + }, + { + "uuid": "5dce6340-bade-4336-8041-50fd22570055", + "id": "nu28", + "name": "EventsTypeData", + "documentation": "", + "value": "[\n {\n \"name\": \"AwsApiCall\",\n \"error\": false\n },\n {\n \"name\": \"AwsServiceEvent\",\n \"error\": false\n },\n {\n \"name\": \"AwsConsoleAction\",\n \"error\": true,\n \t\"errorCode\": \"ThrottlingException\",\n \t\"errorMessage\": \"Rate exceeded error\"\n },\n {\n \"name\": \"AwsConsoleSignIn\",\n \"error\": true,\n \"errorCode\": \"LoginErrorException\",\n \"errorMessage\": \"Login error\"\n }\n]" + } + ] +} \ No newline at end of file